Getting started with Xen virtualization
Debootstrap
Again working as root, mount the formatted partition on the Dom 0 filesystem and cd to the parent directory. The message debootstrap etch mountpoint for Domain U partition ftp://ftp.de.debian.org/debian will now install a complete, basic Debian system from the ftp server. When Debootstrap is done, you should find a complete, basic Etch system in the directory you specified. chroot to this folder; then install the libc6-xen package and disable the libc TLA extensions.
Etch system configuration is slightly more complex than previously, because base-config no longer exists; this handled many tasks automatically in the past. Now, the root user has to install the locales and console-data packages manually and add the following line to the /etc/hosts file:
127.0.0.1 localhost
Next, add the hostname to /etc/hostname, making sure that you use the same name as in your Xen configuration file. You still need to add a matching network card configuration to /etc/network/interfaces for the Dom U.
After linking the correct time zone file to /etc/localtime, it's time to tackle the configuration of the virtual drives in the /etc/fstab file. Listing 2 contains a ready-made fstab that is based on the examples given previously.
Listing 2
Fstab Example for a Debian Dom U
Finally, you will want to set the root password using the passwd command; you might also want to install the OpenSSH server and get out of the chroot jail.
Starting Dom U …
After creating the configuration files for the Dom U and finishing the system setup, you can now start the virtual system. To do so, change directory to /etc/xen and give the following command: xm create -c name of configuration file. The -c parameter redirects the output from the Dom U's virtual screen to the current console. If everything worked out, the login prompt should be displayed after the Linux kernel boot messages. From now on, the init scripts included with the Xen package will automatically launch the new Dom U whenever you boot the system.
… and Stopping It
The xm list command gives an overview of the virtual domains running on your system (Listing 3). In our example, multiple Dom U's are running in the Dom 0, which has 64MB of RAM; one Dom U has 1GB of RAM, and one has 296MB. Entering the xm destroy name of VM command in Dom 0 terminates a virtual machine. The xm top tool displays an updated list of the virtual machines, including their RAM, CPU, and network load, in a similar fashion to the Bash top command (Figure 2).
Listing 3
Listing Virtual Machines
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Endless OS 6 has Arrived
After more than a year since the last update, the latest release of Endless OS is now available for general usage.
-
Fedora Asahi 40 Remix Available for Macs with Apple Silicon
If you've been anticipating KDE's Plasma 6 for your Apple Silicon-powered Mac, then you're in luck.
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.