Creating DomUs
xen-tools provides a simple way to create Xen DomUs (or guest virtual
machines in other words). This page walks through all the steps involved with
creating and setting up a new user.
Creating a DomU
From a root Dom0 terminal type:
xen-create-image
--hostname=EXAMPLE \
--lvm=vg0 \
--ip=123.456.789.ABC
--pygrub \
--memory=16G \
--dist=focal
--passwd
Going through these lines one by one:
hostnameis the hostname associated with the virtual machine. This should be USERNAME_vm for consistency.lvmselects the LVM (Logical Volume Manager) volume group. Each DomU is created with 2 logical volumes (1 for storage and 1 for swap). There is only one system group,vg0.ipsets the IP address of the DomU.pygrubsets up a bootloader for the DomU.memorysets the amount of RAM that the VM can access. 16 GB is a reasonable amount for most users.distsets the Linux distro installed on the DomU.focalcorresponds to Ubuntu 20.04 a.k.a Focal Fossa.passwdwill prompt you for a root password after the installation. For now you can make it something simple like “root”, it will be changed later.
This will create a DomU with a 100 GB root partition, 4 GB swap partition, 16 GB of memory, and Ubuntu 20.04 onboard.
Installing Software
Start the DomU with
xl create /etc/xen/USER.cfg
and enter the command line with
xl console USER.cfg
where USER is the name of the DomU you’ve created.
Run apt update and then install git:
apt install git
Now we can download the HPC scripts with
git clone https://github.com/Morehouse-HPC/scripts
Head into the scripts/ directory and run this command to install the rest of the necessary packages.
apt install $(cat software-list.txt)
This will install some common applications including the GCC compiler, Python, MySQL, and the the XFCE desktop environment.
Creating a User Within the DomU
Still inside the scripts/ directory run
./create_user.sh
This script does the hard parts of user creation while prompting for a username. The script will also generate a secure password, though you will have to type it in manually.