XEN and the Art of Virtualization
Posted: March 28th, 2005 | Author: telcor | Filed under: Information Technology (IT) | No Comments »XEN is an excellent program that
surfaced about a year ago. In short, it enables a computer to run multiple
operating systems concurrently. Not multi-boot, but run two or more OS’s at
the same time. One Operating System is the main, or host, OS (known as domain-0
in XEN parlance). The other OS’s are “guests” or “client’s”
of the Host OS. Better and more thorough documentation exists on the subject,
I recommend reading it rather than relying upon my brief description.
This weekend I had the opportunity to experiment with XEN. Compiled here are
notes from this. First the specs of the test system:
- CPU: Pentium 2 400 MHz
- RAM: 480MB
- HDD: 40 GB 5400 RPM
- Host OS: Debian GNU/Linux Sarge
Not the mightiest of systems, but it does the job. My design goal is this: to
have dedicated OS’ for specific tasks. The tasks are:
- Mail hosting
- Web development
- Subversion hosting
Much of the Documentation
is easy to follow and answers most questions. However a few differences and
need clarifications arose from my testing.
1. Do I use the 0 or U kernel to boot my Host GNU/Linux system?
Similarly: Do I use the 0 or U kernel config when building my own kernel?
Remember: 0 == Hosting operating system, the first one XEN starts upon system boot.
U == User OS, the client or guest OS’s.
2. The XEN tarball includes a GNU/Linux kernel, can I use that or must
I build my own? That depends upon your system. For example, the default XEN kernel does not have XFS builtin.
3. What are the performance differences between running a client OS
in a file image opposed to installed in a hard drive partition? While
I don’t have hard numbers (yet) to show, if the client OS will have heavy
file IO, the performance is very noticible. My system dragged while performing
an OS installation into a file image. Anything that will have heavy file IO, consider
placing into a hard drive partition.
4. How do I install the client OS? With Debian,
use debootstrap.
Other GNU/Linux distros and NetBSD vary. The installation might necessitate placing the
installation medium in the CD-Drive, rebooting and installing to the target
location.
5. The device listed in the disk and root configuration
directives need to exist on GNU/Linux systems. In your domain configuration
file, you specify the location(s) of the OS and the root. For example:
disk = ['phy:/dev/hdb1,sda1,w'] The device node sda1 must exist.
Apparently this same step is not necessary for NetBSD.
6. How do I give my client OS a static IP address? In the
configuration file for the client OS, comment the dhcp variable
and add an IP variable. Uncomment and configure the
netmask and gateway variables. These are quoted strings.
7. The client OS cannot talk to the network Be certain the
iproute package is installed.