As of October 2024, GXemul runs all versions of NetBSD/cats, including all releases and -current. Note that at the time of this writing, the latest GXemul release (0.7.0) has a bug that prevents builds compiled with GCC 10 (NetBSD 10.0 and later releases and -current after June 2021 and) from booting. To run such a release either install GXemul from pkgsrc or apply the patch linked below.
Requirements
- GXemul from pkgsrc (otherwise make sure it contains this patch)
- an installation .iso, e.g., NetBSD-10.0-cats.iso and corresponding kernel
Creating a disk image
$ dd if=/dev/zero of=hdd.img bs=1M count=1 seek=1023
Installing NetBSD/cats in GXemul
$ gxemul -E cats -q -d c:NetBSD-10.0-cats.iso -d d:disk.img -j 'NETBSD.;1'
Go through a standard NetBSD installation. At the end, when configuring the NetBSD, use the following settings:
- media type: autoselect
- autoconfiguration: no
- host name: up to you
- DNS domain: up to you
- IPv4 address: 10.0.0.1
- IPv4 netmask: 0xff000000
- IPv4 gateway: 10.0.0.254
- name server: 10.0.0.254
After you set a root password, reboot and GXemul will exit.
Running your NetBSD/cats installation
Unlike when booting from CD, GXemul cannot load the kernel from inside the disk image, that is why we downloaded that earlier.
$ gxemul -E cats -d d:disk.img netbsd-GENERIC.gz
Note that the default networking is somewhat rudimentary. You can establish TCP connections to the outside world and ping destinations there (GXemul has NAT built in) and you can ping 10.0.0.254 (the "gateway"), but you cannot establish TCP connections to 10.0.0.254. In order to connect to the host via ssh, you need to connect to a "real" IP address on the host (not necessarily a public one - just not 10.0.0.254 or anything in 127/8).