This article explain how to install a Qemu based FreeBSD virtual machine under Win 7 64bit OS. The reason for making this tutorial is the usability of Qemu FreeBSD machine inside of the GNS3 network simulator, where the FreeBSD is used as the framework for running JunOS Olive routers.
Environment and Prerequisities
My environment:
- Win 7 64 bit operating system.
Prerequisities:
- In the time of writing I have used Qemu 0.11, version for Win 32 bit, downloaded from here. However even works for a qemu installed together with GNS3 of 1.2.3 version.
- Downloaded a mini install ISO image of the FreeBSD OS. In my case I'm using 4.11 downloaded from here (as the framework for future Junos Install).
Installing the FreeBSD OS
As the first step we have to create a virtual image where we will install FreeBSD. So run from the qemu install folder:
qemu-img create -f qcow2 olive-base.img 4G
where the command create a Qemu image disk, here named olive-base.img of the 4GB size.
Next we will install FreeBSD inside of created image. To do that copy downloaded FreeBSD ISO image into the directory, where the qemu is installed, in my case
c:\Program Files (x86)\Qemu>
and run
qemu -m 256 -hda olive-base.img -cdrom 4.11-RELEASE-i386-miniinst.iso \ -boot d -localtime
The command starts the qemu virtual machine (VM) with previously created disk olive-base.img. The VM have 256MB of RAM and attached CDROM with inserted the FreeBSD install ISO image, 4.11 mini install ISO in my case.
Qemu VM should start immediately within of a new window (note: Ctrl + Alt willl release the coursor)
Skip kernel config:
Select Standard system installation:
Make a disk partition pressing "A", where we wil use all the disk space, and press "Q" to finish the partitioning:
Select “Standard – install a standard MBR (no boot manager)”:
Next we will create four logical partitions of correct types and mounting points.
To create a partition press C, then we have to setup the size (for example 1024M), choosing a type of partition (File system or swap ) and for the File system we have to select the mounting point:
Partit. Mount. Point Size (type) ad0s1a / 1024M (File System) ad0s1b swap 1024M (Swap) ad0s1e /config 12M (File System) ad0s1f /var rest (File System)
it should look like:
Press "q" to finish partitioning.
(Note: Some tutorials point out, that if they tried installing higher version of FreeBSD, they must have exact partitioning. I've tried 5 release of FreeBSD, installation hang out on some point, on 8 and 9 version of FreeBSD installation failed on bad disk parameter, disk not found).
Then choose minimal distribution installation:
and as the install media choose CD/DVD:
File copy process will start:
The installer program will ask you for many of user confirmation questions (Ethernet/SLIP config, gateway, inetd, FTP, NFS, security, console, linux compatibility, set time, etc), answer no for each of them.
Do not forget to enter a root password, just do and remember it!
Finally exit the the FreeBSD installer by choosing X Exit Install. While FreeBSD CD is rebooting, quit Qemu (closing the window or by by pressing Ctrl-Alt-2, and then typing: "quit").