How to install PC-BSD using the QEMU Emulator

What is QEMU?

QEMU is software that allows you to emulate another computer in order to
install and use an operating system on your physical machine without actually
installing it. Much like a Famcom emulator uses software to create the
impression to a game ROM that it’s really running on a Nintendo 8-Bit console.
It’s really running on your PC. It’s basically the same thing.

For Windows you can download QEMU as a ZIP archive and unpack it to any working
directory. If your using an older version of windows you may want to install a
program such as 7-Zip or WinZip (I reccomend the former). In order to use the
accelerator module you need to download it as well. You can find a link to it
on the main QEMU web site. Un pack the archive (it’s tared and bzipped, try
7Zip or WinRar). Copy the kqemu.inf and kqemnu.sys files to your QEMU

If you are using a Unix/Linux system it is best to use what ever package
management system you have to install it. One should be able to find an RPM or
Deb for there system. PC-BSD users can install QEMU and KQEMU via PBI which
includes a simple GUI for setting it up.

The KQEMU module will make the installed system faster but it is not open
source software. Qemu is Open Source and Free Software. Installing this will
likey vary from system to system.

Qemu Website

Qemu for Windows

I will deal with using QEMU at the command line since it is the only portable
interface (Win, Lin, BSD, Mac). If your using a Unix/Linux system strip off the
“.exe” every where.

Find the location of QEMU on your system once it’s installed. Open a terminal
emulator (command prompt window) and change directory to it’s location like
this, cd “C:Program FilesQEMU” or if using a Uinx/Linux system you can check
it’s installed location with the command “which qemu” -> C Shell users may have
to “rehash” after installing qemu before they can run it.

Now since QEMU does not use your actual hard ware (it emulates it’s own) you
need to create a file that QEMU can use to store data (acts like a hard drive
or swap file). We can create a harddisk image file in several different
formats. “raw” which should be portable between emulation software. “qcow”
which is probably the best choice for Windows systems. “cow” for Linux systems,
“vmdk” which makes a VMWare image, and cloop which ya don’t want to toy with
right now !

Depending on the format used the size of the file should grow till it reaches
the limit we give it. Now PC-BSD should fit on a 6GB hard drive but to get any
real work done 15GB would be more realistic, assuming you like to store a lot
of photos, music, and video files. Then again for getting real work done you
should install an operating system not use an emulator (in my humble opinion).
It is good for testing things though but a few things to remember.

0.) Emulated hardware does not relate to YOUR hardware. So some things may work
or not work after really installing an operating system. Just the same some
things may not work in the Emulator but may work on the real system as the
emulator is simulating hardware.

1.) The system will run much slower then had you really installed it. Not only
is it going to use an alloted amount of memory (RAM) your computer will all
ready be running it’s current operating system and other softwares. This is not
suitable for the “faint hearted” machines. The test system I have runs a
Pentium D 930 (2 x 3.0Ghz) CPU and 2048MB (2GB) of fast DDR2 Memory.

3.) With virtual solutions some times odd things about software just “don’t”
work but are fixed when installed on the real system. Like wise it can be the
other way around.

4.) A lot of things won’t work under emulation or not well, i.e. 3D Games e.t.c.

Ok phase one we will create a disk image to install an operating system on. I
suggest 5GB minimal, for this I will use an 8GB image file. Thanks to having a
500GB hard drive xD

qemu -create -f qcow acd.img 8G

The syntax as you can see is `qemu-img -option -f format filename sizeG. Now we
have to basic options on how to install, we can boot the emulator off a CD/DVD
or an ISO image.It’s rather nice if you can use the ISO image and save your
self from burning a CD-R just for testing the system.

If using a Windows system

qemu -L . -cdrom “\.E:” -hda acd.img -m 512 -boot d

If using a FreeBSD system

qemu -cdrom /dev/acd0 -hda acd.img -m 512 -boot d

The device names vary from Unix to Unix some tiems even Linux Distro to Distro.
It will probably be some thing like /dev/scd0 on a Linux based system.

Now this is very important the number after the -m is how many megabytes of
memory to give the emulated “virtual” PC. In my case I chose to allow 512MB of
Memory to run PC-BSD under emulation.

Now if you want to use the ISO image file it’s slightly different.

qemu -L . -cdrom Imagefile.iso -hda acd0.img -m 512 -boot -d

qemu -cdrom Imagefile.iso -hda acd0.img -m 512 -boot -d

After the system is installed you can run it like so

qemu -L . -hda acd0.img -m 512

qemu -hda acd0.img -m 512

To try and enable KQEMU for more speed add a “-kernel-kqemu” option like so

qemu -hda acd0.img -m 512 -kernel-kqemu

The system should now boot and you can see how it works.

I’ve installed the system but it is very slow, taking about 2 times longer to install then normal and many minutes to boot + without sound or network. I don’t have KQEMU so it makes emulated hardware feel faster then our first Pentium PC (with 32MB of memory). If my laptop wasn’t so slow I might try it out that way. For running WinVista I’d say go with KQEMU on a system with 4GB of RAM and a lot 3.5 GB for it hehehehahhA !