How to install Xen hypervisor on ubuntu 20.4

How To Install Xen Hypervisor On Ubuntu 20.4

Here is the basic architecture:

Xen – this is the software that boots up when you boot the server.

domain-0 – this controls Xen and all the virtual machines added to the machine.

domain-u – these are the virtual machines.

paravirtual drivers – performance with Windows will be really slow unless you instill the opensource network,
storage, bus, and other paravirtual drivers.



You will need the ISO image of the operating system you want to use.

  • Install Ubuntu on an empty machine and use the LVM (logical volume manager) option when you do that. Leave space for a logical volume for VMs when you are asked to create partitions. Or use another drive for that when you set up the VMs later.

  • Install XEN:
    sudo apt-get install xen-hypervisor-amd64
    sudo reboot

  • Now you have a Xen hypervisor.  Run this to confirm:
    sudo xl list
    You will see domain-0:
    Name                     ID   Mem VCPUs      State    Time(s)
    Domain-0                 0 10789     1     r—–    2643.0

  • Configure bridged networking.  Do not use OpenvSwitch (You can but these instructions will not work for that.):cat /etc/network/interfaces auto lo eth0iface lo inet loopbackiface eth0 inet manualauto xenbr

  • iface xenbr inet dhcp

  • bridge_ports eth0

  • Assign memory to the domain-0 machine so that it does not run slow when you add VMs by adding this line:

  • GRUB_CMDLINE_XEN_DEFAULT=”dom0_mem=10794M,max:10794M”

  • to:

  • sudo vi /etc/default/grub.d/xen.cfg

  • sudo update-grub

  • sudo reboot

  • That gives domain-0 10GB.