Jump to: navigation, search


PXE Install Server for XenServer

Why do I need this?

If you choose to use XenServer as the hypervisor for your OpenStack deployment, you probably want the install to be automatic. At Citrix, we find it useful to have a PXE server around, even in a simple development environment. It makes it much easier to start automating tests later on.


This guide was written using:

# Xenserver 6.0.2
# Ubuntu 11.10 virtual machine as the PXE server, although this could also be a physical machine.

However, it should be equally applicable to modern versions of both XenServer and Ubuntu.

On your Ubuntu 11.10 machine

Install the following packages

sudo apt-get install apache2 isc-dhcp-server tftpd-hpa

Edit /etc/network/interfaces

The interface eth1 on my machine is on a network called "Network 1". Please change the instructions below to match your network setup.

Caution: Ensure that your "Network 1" is isolated from any corporate network, to avoid any interference from our DHCP, PXE server.

auto eth1
iface eth1 inet static

Edit /etc/dhcp/dhcpd.conf and add the following

allow bootp;

use-host-decl-names true;
option domain-name "Network 1";
option domain-name-servers;
subnet netmask {
        filename "pxelinux.0";


Mount the iso you downloaded and copy over the following to your /var/lib/tftpboot folder:

cd <path to XenServer CD>
cp ./boot/pxelinux/mboot.c32 /var/lib/tftpboot
cp ./boot/pxelinux/pxelinux.0 /var/lib/tftpboot
mkdir -p /var/lib/tftpboot/xenserver
cp ./boot/vmlinuz /var/lib/tftpboot/xenserver
cp ./boot/xen.gz /var/lib/tftpboot/xenserver
cp ./install.img /var/lib/tftpboot/xenserver


First you need to add the menu UI file handler.

cp /usr/lib/syslinux/menu.c32 /var/lib/tftpboot/

And then :

mkdir /var/lib/tftpboot/pxelinux.cfg

Edit /var/lib/tftpboot/pxelinux.cfg/default and paste the following

UI menu.c32

LABEL local
        localboot 0

LABEL Install-XenServer
        kernel mboot.c32
        append xenserver/xen.gz dom0_max_vcpus=2 dom0_mem=752M com1=115200,8n1 console=com1,vga --- xenserver/vmlinuz xencons=hvc console=hvc0 console=tty0 answerfile= install --- xenserver/install.img

The Answer File

You may use the sample answerfile below. This must be placed in /var/www/answerfile.

<?xml version="1.0"?>
<installation srtype="ext">
<root-password>mypass</root-password>                      <=== fill this
<source type="url"></source>
<ntp-server>IP address of my ntp server</ntp-server>       <=== fill this
<admin-interface name="eth0" proto="dhcp" />

Copy packages* and XS-REPOSITORY-LIST to your webserver

cd <path to XenServer CD>
mkdir /var/www/xenserver      # path you gave in the answerfile
cp -r packages* /var/www/xenserver
cp XS-REPOSITORY-LIST /var/www/xenserver

Start services

sudo /etc/init.d/networking restart  #if you changed /network/interfaces
sudo /etc/init.d/isc-dhcp-server start
sudo /etc/init.d/tftpd-hpa start

Ready to run

On your target machine, ensure that boot sequence is set to boot from network. Reboot your machine. Ensure it acquires a DHCP address from your PXE server. At the boot prompt, enter install-xenserver and take a deep breath.

Further Reading

For more details see: