How to Install a FreeBSD domU on a Linux Host

From Xen
Revision as of 14:41, 30 July 2012 by OliverChick (talk | contribs) (→‎Notes: Very out of date. Xen 2.0 is no longer used.)
Jump to navigationJump to search


The FreeBSD wiki describes the current state of the FreeBSD xen port(s).

FreeBSD will run in 3 configurations:

  1. 32-bit PV (kernel "XEN"; requires "PAE" option)
  2. 64-bit HVM with PV drivers (kernel "XENHVM")
  3. 32- or 64-bit HVM without PV drivers (kernel "GENERIC")

For instructions on building user-space xenstore tools, see HOWTO-xen-tools.txt.

For instructions on building and installing a "XENHVM" kernel on XCP, see this blog post.

FreeBSD 7.2 domU on a linux dom0

It is fairly straightforward to create a FreeBSD DOMU virtual machine inside a linux DOM0.

Here's a sample configuration file. This is set to boot an ISO image file of freebsd7.2, which the author happened to need in order to create a development environment for pfSense firewall.


import os, re
arch = os.uname()[4]
if re.search('64', arch):
        arch_libdir = 'lib64'
else:
        arch_libdir = 'lib'

kernel = "/usr/lib/xen-4.0/boot/hvmloader"
builder = 'hvm'
memory = 768
vcpus = 1

name = "xenfreebsd"

vif = [ 'type=ioemu, bridge=eth0' ]
acpi = 1
apic = 1
disk = [ 'phy:/dev/xen/xen4-freebsd72-00,hda,w', 'file:/home/download/freebsd-7.2-RELEASE-i386-dvd1.iso,hdc:cdrom,r' ]
device_model = '/usr/' + arch_libdir + '/xen-4.0/bin/qemu-dm'
usbdevice='tablet'

# boot on floppy (a), hard disk (c) or CD-ROM (d)
boot='d'

# use vnc for console not sdl, don't start vnc console
vnc=1
sdl=0
vncconsole=0

on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'


The main change required will be to fix the paths to the CD or DVD iso.

Once started with xm create, use "vncviewer localhost:0" to attach to the installer and complete the process.

It may be necessary to use ssh forwarding if the xen server isn't your local machine; e.g. "ssh -L5900:127.0.0.1:myxenhost.example.com" and then "vncviewer localhost:0".


The information below is quite out of date and has been kept for reference purposes only. Most of the links are also broken!


FreeBSD as DomU/Guest HOWTO