Assuming you just did a clean installation of Ubuntu 20.04 in your server, we are going to install xen hypervisor. To be noted, you need to use lvm to manage your server’s hard disks when you install ubuntu 20.04.

Configure the network

Ubuntu 20.04 uses netplan to manage the network. There are two things in particular needs to be considered. First, a server usually has more than one ethernet port (in this case, there are four), ubuntu 20.04 tries to wait all the ports to be configured using DHCP. Three ports are not connected to cables, so minutes of time were wasted on waiting. Make ethernet ports which are not used optional can speed up the start process. Second, we need to create a bridge to make the ip addresses in your physical local network assigned to virutal machines. So you can access to any virtual machine from other devices in your local network. For example, if your network uses ips range like, your virtual machine will get ip like

Edit /etc/netplan/00-installer-config.yaml

      dhcp4: true
      dhcp4: true
      optional: true
      dhcp4: true
      optional: true
      dhcp4: true
      optional: true
      dhcp4: true
        - eno1
  version: 2

Apply the configuration

netplan apply

Install xen-hypervisor-amd64

apt-get update && apt-get upgrade -y && apt-get install -y xen-hypervisor-amd64
# After the installation has been finished, reboot your server.

Increase host’s disk space

Ubuntu 18.04 by default allocated very small amount of disk space to the host (or host domain, Domain-0), you probably want to increase your host’s disk space by allocating more space using lvm.

lvresize -L 20G /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv


Take a snapshot of a lvm disk

lvcreate -L592M -s -n backup /dev/ubuntu-vg/xen-xxx-disk
mount /dev/ubuntu-vg/backup /data/backup

Backup and compress disk of virtual machine

dd if=/dev/ubuntu-vg/xen-xxx-disk | gzip --fast > /backup/disk.gz

Recover disk of virtual machine

zcat /backup/disks/disk.gz > /dev/ubuntu-vg/xen-xxx-disk