How to install FreeBSD on a compact-flash disk using Qemu

I recently installed FreeBSD 8.2 on a compact-flash disk for my home-build CPE project. Previously, I would use a laptop, a CF-adapter and boot a FreeBSD installation CD. For my latest project, I thought of a new way. Using Qemu, it is very easy to install and configure the OS prior to mounting the CF into the device.

 

Qemu is virtualization software, similar to VMware. The big difference is that Qemu is completely free. Once Qemu is downloaded and the folder is opened (no installation required), all that is needed is to copy the CD iso-file in that directory and launch Qemu. Assuming that your CF is recognized as the third harddrive, Qemu needs to be invoked as follows:

qemu -boot d -cdrom cd.iso  -m 512 -L bios -bios bios.bin -hda \\.\PhysicalDrive2

In this case, I assume that your cd is named cd.iso. Remember to check after installation whether or not the correct disk numbering is being used in /etc/fstab. Also, make sure you have enabled the serial console during boot:

echo '-h' > /boot.config

And don’t forget that you have enable the serial console AFTER boot. This is done by enabling /dev/ttyu0 in /etc/ttys. Happy installing :-)

Leave a Reply