This article is inspired and prepared on the forked Cloudmin Xen script updated for Debian 10. However, the following procedures to be followed as precuationary before executing the updated script, which is available in this post in below section.
PHASE-I Prepare Environment for XEN
INSTALLING THE XEN HYPERVISOR AND HOST/CONTROL DOMAIN (“DOM0”)
In this step we install the Xen Project hypervisor software package, and configure the Dom0 virtual machine by way of the Debian base operating system. Once all preliminary configuration is complete, we will reboot the computer and automatically boot into the Xen hypervisor/Dom0 virtual machine to explore the new system.
INSTALL XEN HYPERVISOR
If you need to add a non-root user, the sudo package, non-free firmware, a firewall, or other necessary packages, now is the time.
Use apt-get to update the Debian base operating system package index files, and upgrade all currently installed packages. As root (or using sudo) run the following command:
# apt-get update && apt-get upgrade
Next, use apt-get to install the Xen Project hypervisor meta-package. Run the following command as root, adjusting the architecture suffix to suit your hardware:
# apt-get install xen-system-amd64
BRIDGE THE NETWORK INTERFACE
We have found that the easiest way to provide DomU access to the computer’s Ethernet device is through a Linux Ethernet bridge to Dom0. In this tutorial, the Debian package bridge-utils is used to configure the bridge. The bridge-utils package should have been installed automatically when the xen-system-amd64 meta-package was installed.
Just to be safe, let’s backup our “interfaces” file before we do any editing. As root, make a copy of the file “/etc/network/interfaces”:
# cp /etc/network/interfaces /etc/network/interfaces.backup
Now edit the “interfaces” file using the nano file editor:
# nano /etc/network/interfaces
The original interfaces.backup file contains the following lines:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo iface lo inet loopback
Note that the primary network interface in your computer may have a different name than “eno1”. Always use the name found in your computer’s interfaces file. In other words, don’t use eno1 unless it’s the name found on your system.
Edit the “interfaces” file to include the following modifications and new lines making sure to substitute “eno1” with your system’s interface name:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). source /etc/network/interfaces.d/* # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eno1 iface eno1 inet manual # Setup Xen interface bridge auto xenbr0 iface xenbr0 inet dhcp bridge_ports eno1
It is important to set the primary network interface to “manual” and the bridge to “dhcp”, if you want to have your networking configured via DHCP. Also, note that “xenbr0” is the standard name used for the Linux Ethernet bridge in Xen Project installations.
If you need to immediately initiate the networking configuration changes, execute the following systemctl command. However, since we’re going to reboot the computer soon, we can also wait for the reboot to automatically initiate the networking changes.
Optional: Initiate the networking configuration changes:
# systemctl restart networking
AUTOBALLOON AND MEMORY ALLOCATION – XL.CONF
We will turn off the memory “autoballoon” feature for the Debian 10 Xen Project install, as we had good results doing the same with our prior install on Debian 9. Note that we have not tested the autoballoon feature, so we cannot speak positively or negatively about its use.
Concerning autoballoon, the manpage for xl.conf states the following:
You are strongly recommended to set this to “off” (or “auto”) if you use the “dom0_mem” hypervisor command line to reduce the amount of memory given to domain 0 by default.
Given the xl.conf recommendation, since we will restrict Dom0 memory through GRUB and the hypervisor command line below, we will set autoballoon to 0 [zero] or “off” to avoid any issues.
In the Debian 9 tutorial autoballoon configuration, we made changes to both the /etc/xen/xl.conf and /etc/xen/xend-config.sxp configuration files. However, in the Debian 10 Xen Project installation the xend-config.sxp file doesn’t exist, so we only need to modify the xl.conf file.
As root, create a backup copy of file “/etc/xen/xl.conf”:
# cp /etc/xen/xl.conf /etc/xen/xl.conf.backup
Then change the line in the xl.conf file that reads…
#autoballoon="auto"
to read…
autoballoon=0
AUTOBALLOON AND MEMORY ALLOCATION – /ETC/DEFAULT/GRUB.D/XEN.CFG
Since our plan is to restrict Dom0 memory to 8GB through GRUB and the hypervisor command line, we need to do a quick edit of the /etc/default/grub.d/xen.cfg configuration file.
As root, create a backup copy of file “/etc/default/grub.d/xen.cfg”:
# cp /etc/default/grub.d/xen.cfg /etc/default/grub.d/xen.cfg.backup
Then open the xen.cfg file in nano and add the line:
GRUB_CMDLINE_XEN_DEFAULT="dom0_mem=8G,max:8G"
As mentioned above, allocating 8GB ram to a Dom0 running Debian 10 with the MATE desktop environment provides more than enough memory. In fact, for the Debian 9 tutorial, which did not have a desktop environment installed, only 1GB of ram was allocated and the Dom0 performed flawlessly.
IMPORTANT: You must update GRUB or the changes will not take effect! Note that rebooting the computer does not update GRUB!
To update GRUB run the following command as root:
# update-grub
ALLOCATE DOM0 VIRTUAL CPUS
As the test computer has only four cores in its processor, no configuration was made to allocate CPUs to Dom0.
By default, Xen makes all processor cores available to Dom0, who then shares these cores with DomU when the virtual machines are created. This configuration is in line with the Xen Project guide Tuning Xen for Performance, which states that “In general you should not assigned less than 4 vCPUs to Dom0”.
REBOOT COMPUTER AND BOOT INTO XEN HYPERVISOR/DOM0 VIRTUAL MACHINE
All configuration in the Debian base operating system is now complete. Once you are ready, run the reboot command as root. The computer should automatically boot into the Xen Project hypervisor and Dom0 virtual machine.
# reboot
If you have a monitor plugged in, after the computer reboots, you will see the GRUB menu with “Debian GNU/Linux, with Xen hypervisor” set as default. This is your new Xen hypervisor/Dom0 installation, and our current destination.
PHASE-II Install Cloudmin
Download the updated Cloudmin package installer from here
chmod +x cloudmin-gpl-debian-install-HTER.sh
Run it-
./cloudmin-gpl-debian-install-HTER.sh
Follow the on screen prompts, Virtualmin will be installed in a while.
PHASE-III Login to Cloudmin Panel
Now login to Cloudmin Interface at-
https://<your_server_ip>:10000 with root or su priviledged user account.
Try any of the following xl commands as root user:
# xl list
# xl info
# xl top
Src:
#https://webmin.com/cloudmin/
#https://vidigest.com/2020/11/17/installing-xen-project-hypervisor-on-debian-10/
#https://archive.virtualmin.com/node/67958