How to Install a FreeBSD domU on a Linux Host

From Xen
Revision as of 14:40, 30 July 2012 by OliverChick (talk | contribs) (→‎FreeBSD DomU on Debian GNU/Linux Dom0 with Xen 3.0.3: The config that this bug refers to is no longer available)
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

Notes

Ariel E. Antigua writes:

I was reading in the xen-users list and read a few emails from people that cant boot FreeBSD as a domU using the Kip Macy instructions at http://www.fsmware.com/xenofreebsd/5.3/ i have the pleasure to inform that his work is still usefull, the only thing that stop me booting that FreeBSD domU image was i forget to add de ufs: root mount device but using this config http://lists.xensource.com/archives/html/xen-users/2005-09/msg00594.html i finally have the domU boot and runing.

PS: My dom0 is Debian Sarge with Xen 2.0.6 , i get this dom0 running thanks to this guide http://www.option-c.com/xwiki/Xen_Debian_Quick_Start

I hope this can help someone else having troble with FreeBSD as domU.....

Thanks Kip Macy for the FreeBSD/domU howto..  :)