How to Create Fedora 20 Domain-U on Fedora 20 Domain-0

In this post, creating a file-backed virtual block device (VBD) and installing Fedora 20 in the Xen DomU via internet will be introduced. This domain is created on a Fedora 20 Dom0 as introduced in For better performance, you may consider using LVM backed VM.

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.

Assume that we are working in /home/xen/f20install/

Create a 20GB sparse file-backed VBD:

# dd if=/dev/zero of=./vmdisk0 bs=1k seek=20480k count=1

Install Fedora 20 Linux via Internet

First download the pxeboot kernel of Fedora 20 for installation via Internet:

(Note: if the URL expired, try to find it on )


Create an installation profile

disk = ['file:/home/xen/f20install/vmdisk0,xvda,w']
vif = [ 'bridge=xenbr0' ]
on_reboot = 'restart'
on_crash = 'restart'

The virtual machine’s name is “f20install”, memory is 2G, VCPU count is 2, and the disk is the VBD created above.

Here, DHCP is used for the VM to get IP, DNS and gateway information. If gateway and DNS server should be set according to the network configuration in format like:

extra="root=live:http://.../to/squashfs.img ip= nameserver="

The full grammar explanation and supported protocols can be found in Anaconda documents.

Start this virtual machine and connect to this virtual machine’s console and complete the installation:

# xl create -c

The console can be released by “Ctrl+]”. And it can be reconnected by:

# xl console f20install

The installation of Fedora 20 will start. You can choose the “Text mode” and configure the installer interactively.

After successful installation of Fedora 20, it will reboot automatically. However, as the VM configuration is using the old one, it will boot from the external kernel and go the the installation interface again. As the installation is already done, you can shut down it by:

# xl shutdown f20install

This virtual machine can be duplicated to get more VMs:

Start DomU

Assume the VM vmdisk0 is duplicated to /home/xen/vm- and we are working in this directory.

Create a profile for loading the virtual machine:

disk = ['file:/home/xen/vm-,xvda,w' ]
vif = [ 'bridge=xenbr0' ]
bootloader = "pygrub"
on_reboot = 'restart'
on_crash = 'restart'

Here we use the PyGrub as the bootloader. PyGrub starts Linux DomUs with the kernels that lie in the file system of the DomU instead of the kernels that lie in the file system of the Dom0. That makes the kernel update and management easier.

Then the DomU can be started using the profile:

# xm create

The console of this DomU can be connected to:

# xm console

Eric Ma

Eric is a systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.


Leave a Reply

Your email address will not be published. Required fields are marked *