Qemu is an open source CPU emulator. It can be used to run Minix quite nicely. I use Linux as my main operating system so these instructions are geared towards running qemu under Linux but it's possible to run under Windows too. Qemu version 0.8.1 is the version I used. I tried earlier versions but had some networking problems.
The first step is to create a disk image for Minix. This will appear to Minix running inside qemu as a hard drive. I use a 2GB image but smaller images are quite workable. Minix 3 with all contributed binaries installed takes about 500MB. Without the contributed binaries it's about 80MB I think. The reason I went for the 2GB image is to enable including all the source for all the included programs and to be able to develop software as well. Create the image using 'qemu-img':
qemu-img create minix.img 2G
This will create a 2GB file. Qemu does have a 'copy on write' format which grows the file as needed. You can try that with:
qemu-img create -f qcow minix.img 2G
I had random segfaults when trying this but it may have been due to other issues. The nice thing about it is the initial file is very small.
With the file created and the
Minix 3 IDE CD-ROM image downloaded you can start the install process:
qemu -localtime -net user -net nic -m 128 -cdrom IDE-3.1.2a.iso -hda minix.img -boot d
This command will boot Minix from the IDE CD-ROM image inside of qemu. The '-m 128' indicates we want 128MB of memory to be provided to the Minix system. Any amount can be used here, the more the better if you want to use X11.
The initial boot process will take you through to a login prompt. Login as 'root', no password and run 'setup'.
# setup
From here work through the prompts. The main thing to watch out for is the request for the network card type. Use option (4), the Realtek 8029, as this is emulated by qemu.
As a disk image is being used you can safely avoid the check for bad disk blocks by pressing CTRL+C.
Once the 'setup' is completed, use 'shutdown' to safely close Minix down. When the boot prompt appears after the 'shutdown' command, close qemu.
# shutdown
fd0>
Now we restart qemu but change the '-boot d' parameter to '-boot c' to boot off our newly installed Minix image. We need to make one important change before the system boots to enable the network card though. Minix requires a parameter to be set, qemu_pci=1. This can be done once and saved to the image. The easiest approach is to start the new image, ignore the network errors, login as root, shutdown, set qemu_pci=1, save it, then reboot:
qemu -localtime -net user -net nic -m 128 -cdrom IDE-3.1.2a.iso -hda minix.img -boot c
...login as root...
# shutdown
d0p0s0> qemu_pci=1
save
boot
This system will boot again and the network card should work. From now on you can start by using the qemu command as above, there's no need to set the parameter again.
You should change your 'root' password as soon as possible. Use 'passwd' to do this:
# passwd
Once logged in as root you can use 'packman' to install packages:
# packman
This will bring up a list of packages which you can install, including gcc, X11, various GNU tools, etc.
Categories: minix, install, qemu