Translation(s): none

Installing Xen

CPU BIOS Requirements

Virtualization extensions need to be enabled in the BIOS. If not already enabled in BIOS, enable it.

CPU needs to have virtualization extensions.

To check in both Intel and AMD CPUs:

egrep '(vmx|svm)' /proc/cpuinfo

For XEN kernel, check output of the following for 'hvm':

xm dmesg | grep VMX

Debian Install Xen

For debian 7.0 (wheezy)

apt-get install xen-linux-system

For debian 6.0 (squeeze)

apt-get install xen-linux-system xen-qemu-dm xen-utils

Boot Xen kernel by default (both in wheezy and squeeze), without this change the kernel will boot not being dom0

dpkg-divert --divert /etc/grub.d/08_linux_xen --rename /etc/grub.d/20_linux_xen

Management tools

Until jessie :

apt-get install libvirt-bin

Since Jessie :

apt install libvirt-clients  libvirt-daemon-system 

You should update plokit policy if you don't use root connexion.

sudo usermod -a -G libvirt $USER
vi /etc/libvirt/libvirtd.conf

# This is restricted to 'root' by default.
#unix_sock_group = "libvirt"
unix_sock_group = "libvirt"

vi /etc/polkit-1/localauthority/50-local.d/50-org.libvirtd-group-access.pkla

[libvirtd group Management Access]

service libvirtd restart

Using lvm disks

If you want that the new domU are created using the space from a lvm pool, you have to configure libvirt to use it, to do so, you need to create the entry pointing to you pool (in this case lvmspace)

vi /etc/libvirt/storage/lvmspace.xml

<pool type='logical'>

To include this pool into libvirt

virsh pool-define /etc/libvirt/storage/lvmspace.xml 
virsh pool-start lvmspace
virsh pool-autostart lvmspace
virsh pool-info lvmspace

Using disk images

*Change the default location to /home/xen/images: Edit:

vi /etc/libvirt/storage/default.xml

And change the location. Reason I'm doing that is my home partition has 80Gb while / (root) partition has only 5gb.


Remote connection

apt-get install virt-manager

* If you want to connect over ssh tunnel you need:

aptitude install ssh-askpass

On debian wheezy/squeeze the default value for this parameter is “no” which means that communication and management tools
Such as “Virt Manager” can not access the Hypervisor.

1. You need to uncomment it and change the value to “yes” –
(xend-unix-server yes)

2. Restart xend to apply the new configuration:
xend restart

Start Networking

virsh net-start default
virsh net-autostart default

Installing new guest OS

Create iso from cdrom

dd if=/dev/cdrom of=~/cd_image.iso

Windows 7



Extending xen raw_storage_volume

Starting Networking

virsh net-start default
virsh net-autostart default

  <bridge name="virbr0" />
  <ip address="" netmask="">
      <range start="" end="" />

Disable virbr0


virsh net-list

virsh net-destroy default
virsh net-undefine default
service libvirtd restart


Error creating domain: device model '/usr/lib64/xen/bin/qemu-dm' not found

Unable to complete install '<class 'libvirt.libvirtError'> POST operation failed: xend_post: error from 
xen daemon: (xend.err "Error creating domain: device model '/usr/lib64/xen/bin
/qemu-dm' not found")


mkdir /usr/lib64/xen/
ln -s /usr/lib/xen-4.0/bin /usr/lib64/xen/bin

iptables bad rule

libvirtError: internal error '/sbin/iptables --table filter --delete INPUT --in-interface virbr0 --protocol udp --destination-port 69 --jump ACCEPT' exited with non-zero status 1 and signal 0: iptables: Bad rule (does a matching rule exist in that chain?).


This is trying to biund to interface virbr0. If for some reason you didn't start the network you will get this error. Start the network:

virsh net-start default
#or autostart it
virsh net-autostart default


virsh net-dumpxml default

**Notes (Looks like these steps are not needed):

**trying to test this. read: vi /usr/share/doc/libvirt-bin/README.Debian

aptitude install dnsmasq-base bridge-utils iptables
cat <<EOF >/etc/dnsmasq.d/00_libvirtd.conf
# only bind to loopback by default

can handle the virtual bridges.


CategoryVirtualization | CategorySoftware | CategorySystemAdministration