If you take a glance at the Qubes OS source code repositories you will be surprised to find out that most of the code is not written in C but in Python and Shell script. This is not without reason: many of its core features (PCI passthrough, virtual networks, VM templates with layering and snapshots...) were already available in Xen and the Linux kernel, and what Qubes really does is gluing all those together to create a beautiful seamless and effortless desktop experience that would otherwise be an cumbersome to configure by hand and actually be suitable for everyday use.
However, as most servers don't really need a seamless GUI experience and Libvirt does some of the heavy lifting, the task becomes much simpler and the amount of work needed is reduced to relatively tolerable levels for an experienced sysadmin (Nevertheless, I am also linking to native Xen docs for those who believe that real programmers don't use Pascal or who simply wants to know how thinks work underneath).
Note: Enterprise Linux distributions most likely have tools and utilities to manage virtual machines comfortably from fancy web control panels, and Openstack also has it. However, the former's licenses usually are more expensive than the used 1U servers you can find online and the latter simply deploys an entire cloud on a cluster...
Before you start you will need to know about the following subjects:
Now, to set up a server system similar to Qubes, on Dom0 one would have to install a minimal Fedora (latest kernel/packages) or CentOS (stability, make sure the kernel version isn't too old) witk LUKS system encryption, the /boot partition, a Logical Volume Manager partition with a thin provisioning pool and, at least, the root and swap logical volumes (don't make the swap thin). Once finished, install Xen and its dependencies.
When it comes to TemplateVMs, Qubes usually creates a root (/
) and private (/rw /home /usr/local
) logical volumes for each of them and creates a snapshot of both before starting the VM and mounting them. They are both readable and writable and, when the VM stops, the snapshots are removed.
AppVMs though, only have a private (/rw /home /usr/local /var/spool/cron
) logical volume and, right before the VM starts, Qubes makes a snapshot of the TemplateVM's root partition (or from another snapshot in case the TemplateVM is running) and mounts the new snapshot as root (/
). They are both readable and writable too. However, when the AppVM stops, the root snapshot is removed discarding thus all previous changes.
DispVMs create both a root and private snapshots of the TemplateVM and AppVM logical volumes respectively before starting, and discards both after stopping.