NOTE: All these works here are still under testing and may not be suitable for production environment. We only support FreeBSD/i386 for now. As for the dom0 suppport of FreeBSD, we still need some time to get it ready. Stay tuned :-)
There are several files needed if one wants to install FreeBSD as a domU domain: kernel (freebsd-XENU_INSTALL & freebsd-XENU), config (freebsd_xen_INSTALL) and of course an image file if you install FreeBSD into a file instead of a real hard disk.
1. If you prefer a file backed system, then the first thing should do is to create an image file. It could be done like the following:
This will create a 1GB blank image file for use. Feel free to change the parameters to match your own needs.
2. Make sure the kernel file and config file are in proper place. Typically, the config file would be placed in /etc/xen/vm, and the kernel's location is specified in that config file.
3. To install FreeBSD as domU, make sure these two lines are used in config file:
4. Now we could start installing. Just create the domain as usual:
After the domain boots, it will ask you to choose a console to continue the intallation process. "2 ...................... VT100 or compatible terminal." is a good choice here. Then we will be brought to the familiar Sysinstall Menu dialog. The very first thing needs to do here is change the Release Name from 7.0-CURRENT to the RELEASE version that you intend to install, since we port Xen in 7.0-CURRENT and don't offer a RELEASE kernel with Xen support currently. This could be done in the menu entry "Options".
NOTE: The installation will hang when "Extracting base in / directory" if you choose to install 6.1-RELEASE , while 6.0-RELEASE works fine in my machine using a file backed system. So it's up to you whether or not to test 6.1-RELEASE.
5. After choosing a proper FreeBSD release, continue the installation process as you usually do. When it is time to come into FDISK Partition Editor dialog, you would find that the DISK Geometry showing here is 0 cyls/0 heads/0 sectors, which ends up with a 0MB disk for us to use. Make sure to use "G" to set Drive Geometry manually. Just to type something like "1000/1000/1000" is enough, as sysintall will first complain the geometry we typed makes no sense and then offer us some certain disk geometry workable. Then continue.
6. The whole installation made via FTP has been tested and works very well. Other methods for installation via network should also work. Choose your own preferred installation media and let sysinstall finish the left installation.
7. When the installing process is finished, almost everything has been done. DO NOT reboot this domain immediately, we still need to do one more trick. In the Main Installation Menu, go into Configure entry, select "TTYs" item, and press "Yes" to edit /etc/ttys. What should be done here is simple: Add one line and comment all the ttyv lines or turn them off.
The modified ttys file would look like this:
8. Now the config file for this domain needs to be modified since the whole installaion has been done and we want to boot into this system next. Change it like this:
9. OK. Now you could safely reboot this domain, either using "xm reboot domainID" or sysinstall itself. Or you could shutdown this domain using "xm shutdown domainID" and then restart it. If you choose rebooting, then use "xm list" to figure out domainID for this domain after rebooting (usually it will increase 1 compared with the domainID it has before rebooting). "xm console domainID" will now bring you into the brand new system that you just installed. Enjoy it. :-)
I still use file backed system as a example. For real hard disk situation, a few modificaitons will be needed.
1. Create the image for file backed system. Since we want to put a existing system on it rather than installing FreeBSD on it, it is not as simple as creating a blank image while doing the install-domU process. The following is the basic way to do it:
2. After the image is created, apply some tricks to get it work under Xen.
This is because Xen doesn't know anything about ad0, ad0s1 or somthing like that, we should please it using the way that Linux use.
xc0 is the console name for FreeBSD that Xen would recognizes.
xn0 is the NIC name for FreeBSD that Xen would recognizes.