Xen 
 
Home Products Support Community News
 
   

FreeBSD as DomU/Guest HOWTO

1) Kip Macy's brief instructions and get the necessary files from that site.

Or:

2) Alternative HOWTO and install files at this site.

FreeBSD DomU on Debian GNU/Linux Dom0 with Xen 3.0.3

I wanted to migrate an existing FreeBSD system to Xen. The first part included creating dd of the hard drive image. Than i've downloaded a xen domU kernel and the appropriate config from http://www.yuanjue.net/xen/howto.html.

The FreeBSD kernel refused to boot with the following error:

Error: (22, 'Invalid argument')
ERROR: Initial guest OS requires too much space (0xc08MB is greater than 256MB limit) 

The problem was, that Xen 3.0.3 requires a VIRTUAL_BASE=0xC0000000 option in the __xen_guest section of the kernel binary. You can view the section of your kernel binary using

objdump -j __xen_guest -s freebsd-XENU 

and replace it using

objcopy -R __xen_guest freebsd-XENU
objcopy --add-section __xen_guest=file_with_new_contents freebsd-XENU

(thanks to this post). The contents of the section is basically a string, but it has to be zero terminated.

The second problem i faced was that from the FreeBSD domU TCP connections worked to the outside world, but I was unable to establish a TCP connection to other (Linux) domUs on the same machine. The setup uses bridged networking. The solution that worked originates from and is explained in this post:

FreeBSD domU> ifconfig xn0 -txcsum
All Linux domUs> ethtool -K eth0 tx off

Later i faced another problem. Multithreaded programs crashed in pthread_self. Beeing a FreeBSD newbie i learned that FreeBSD provides multiple threading libraries and that you can choose which one apps should use editing /etc/libmap.conf. The user space threads library libc_r worked for me and is good enough for a developement system, but its performence is probably suboptimal.

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.. :)

FreeBSDdomU (last edited 2007-03-05 02:02:22 by pm)