Vnx-rootfsfreebsd

 Create the filesystem disk image: qemu-img create -f qcow2 root_fs_freebsd-base.qcow2 5GB Get FreeBSD installation CD. For example: wget ftp://ftp.rediris.es/mirror/FreeBSD/ISO-IMAGES-i386/8.1/FreeBSD-8.1-RELEASE-i386-disc1.iso cp FreeBSD-8.1-RELEASE-i386-disc1.iso /almacen/iso Create a libvirt XML definition (root_fs_freebsd.xml) containing the virtual machine description:  Freebsd 524288  1    hvm    /usr/bin/kvm     <disk type='file' device='cdrom'> <source file='/almacen/iso/FreeBSD-8.1-RELEASE-i386-disc1.iso'/> <target dev='hdb'/> <interface type='network'> <source network='default'/> <graphics type='vnc'/> Note: change "source file=" lines to whatever fits your case (use full paths).

Start the virtual machine with:</li> virsh create root_fs_freebsd.xml Access virtual machine console with:</li> virt-viewer Freebsd Follow FreeBSD installation menus to install a basic system with DHCP configured in the network interface, a user named "vnx", and after that:</li> <ul> Install bash and change package repository:</li> pkg_add -r bash pw usermod root -s /usr/local/bin/bash pw usermod vnx -s /usr/local/bin/bash echo "export PACKAGEROOT=ftp://ftp.es.freebsd.org" > ~/.bash_profile Install perl and XML::DOM library:</li> pkg_add -r perl p5-libxml-enno Disable DHCP on network interface by editing the /etc/rc.conf file and commenting the following line:</li> ifconfig_re0="DHCP" Install VNX autoconfiguration daemon:</li> <ul> From the host execute:</li> /usr/share/vnx/bin/vnx_update_aced Freebsd /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz From the virtual machine console:</li> mount /cdrom /cdrom/install_vnxdaemon </ul> Optional: allow root login thorugh ssh by editing /etc/ssh/sshd_config file:</li> PermitRootLogin yes Optional: set locales according to your preferences in /etc/profile:</li> export LANG=es_ES.UTF-8 export LC_ALL=es_ES.UTF-8 Optional: add gnome window manager with:</li> <ul> Install packages needed:</li> pkg_add -r xorg-minimal gnome2-lite gdm Add the following line to /etc/rc.conf:</li> gname_enable="YES" Add the following line to /etc/fstab:</li> proc   /proc   procfs  rw      0       0 Disable the screensaver and change keyboard configuration in "System->Keyboard" menu.</li> </ul> <li>Optional: reduce the boot timeout from 10 seconds to, for example, 3 seconds. Edit /boot/loader.conf and add:</li> autoboot_delay="3" <li>Optional: give vnx user (or whatever one you have created during installation) permissions tu su root:</li> pw usermod vnx -G wheel <li>Optional: if you have installed gnome, you can add automatic login following the instructions in:</li> http://www.freebsd.org/gnome/docs/faq2.html#q23 <li>Stop the machine with:</li> halt -p </ul> </ul>

Note: after installing gnome, you probaly will get the following error message on the console: acd0: FAILURE - unknown CMD (0x03) ILLEGAL REQUEST asc=0x20 ascq=0x00 To eliminate them you can execute: hal-disable-polling --device /dev/acd0

Installing additional software
To install additional software or modify your root file system, you just have to start it as described above and: <ul> <li>Configure network interface with:</li> dhclient re0 <li>Install new packages using "pkg_add -r ..." commands or using "sysinstall" utility. For example, to install apache web server:</li> pkg_add -r apache22 <li>Stop de virtual machine with:</li> halt -p </ul>

Updating ACE daemon
If you have a root filesystem with the autoconfiguration and command execution daemon (ACE) already installed, you can use the autoupdate functionallity to update the daemon to a newer version. Just follow this procedure:

/usr/share/vnx/bin/vnx_modify_rootfs root_fs_freebsd.xml /usr/share/vnx/bin/vnx_update_aced Freebsd /usr/share/vnx/aced/vnx-aced-lf-0.1b.tgz
 * Edit the xml described above and comment the line defining the Freebsd iso file for the cdrom:
 * Start the virtual machine (directly using virsh or the vnx_modify_rootfs utility):
 * Execute the update utility:
 * Once the ace daemon is updated the virtual machine will be rebooted automatically.