Setting up Stable Xen DomU with Fedora: Unmodified Fedora 11 with pv_ops Kernel
Creating file-backed virtual block device (VBD) for Xen virtual machines and installing Fedora 11 in Xen DomU via internet will be introduced.
The Dom0 platform on top of which this DomU is set up is introduced also in this site. Please refer to
for the latest stable Xen Dom0 solution.
Create file-backed VBD:
The actual space of VBD will be the amount of disk the virtual machine used. And it will be convenient if the virtual machine will be duplicated since the work is just copying the VBD file and changing some configurations.
Create a 20GB sparse file-backed VBD:
# dd if=/dev/zero of=/lhome/xen/f11install/vmdisk0 bs=1k seek=20480k count=1
Make a ext4 file system in the disk file:
# mkfs -t ext4 vmdisk0
Install Fedora 11 Linux via Internet
First download the pxeboot kernel of Fedora 11 for installation via Internet. Download vmlinuz and initrd.img from here:
http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/x86_64/os/images/pxeboot/
We assume these two files are stored in /lhome/xen/f11install/.
Create an installation profile f11.install:
name="F11INSTALL" vcpus=2 memory=2048 disk = ['file:/lhome/xen/f11install/vmdisk0,xvda,w' ] vif = [ 'bridge=eth0' ] kernel = "/lhome/xen/f11install/vmlinuz" ramdisk = "/lhome/xen/f11install/initrd.img" on_reboot = 'restart' on_crash = 'restart'
The virtual machine’s name is “F11INSTALL”, memory is 2G, CPU number is 2, disk, kernel and ramdisk is prepared in the above steps.
Start this virtual machine and connect to this virtual machine’s console and complete the installation:
# xm create -c f11.install
The console can be released by “Ctrl+]”. And it can be reconnected by:
# xm console F11INSTALL
The installation of Fedora 11 will start. The gateway and DNS server should be set according to the network configuration.
The URL of installation source I used during installation is:
http://download.fedora.redhat.com/pub/fedora/linux/releases/11/Fedora/x86_64/os/
After successfully installation of this virtual machine. It can be shut down by:
# xm shutdown F11INSTALL
This virtual machine can be duplicated to get more VMs: How to duplicate Xen DomU virtual machines.
Start DomU
Remember to update your system after the first boot. The 2.6.30 kernel is more stable running as DomU than the default one.
Create a profile vm-10.0.0.123.run for loading the virtual machine:
name="10.0.0.123" vcpus=2 memory=2048 disk = ['file:/lhome/xen/vm-10.0.0.123/vmdisk0,xvda,w' ] vif = [ 'bridge=eth0' ] bootloader = "/usr/bin/pygrub" on_reboot = 'restart' on_crash = 'restart'
Here we use the PyGrub (“/usr/bin/pygrub”) as the bootloader. PyGrub starts Linux DomUs with the kernels that lie in the filesystem of the DomU instead of the kernels that lie in the filesystem of the Dom0. That makes the kernel update and management easier.
The blktap2 VBD driver has better performance than blkback backed VBD. The blkback backed driver is used here for safety writing to the disk. The disk driver can be changed to use blktap2 driver later after updating the system. A blktap2 driver can be configured like this:
disk = ['tap:aio:/lhome/xen/f11install/vmdisk0,xvda,w' ]
Then the DomU can be started using this profile:
# xm create vm-10.0.0.123.run
The console of this DomU can be connected to:
# xm console vm-10.0.0.123
The console can be released by “Ctrl+]”.
Tags: Client config, Command line, domu, Fedora, Tutorial, xen
I love reading these ariltecs because they’re short but informative.