This post is intended for people who are trying to set up a private network with Xen virtual machines. As such, it assumes that you know what Xen is, what dom0 and domU are, and how to configure domU and xend. Particularly, you should have read
the XenNetworking wiki page.
This part only describes installation of Xen on Kubuntu and the problems I had with that in particular. The networking stuff which was (briefly) here is
moved to Part II.
Setup
For the most part, I followed the
Installing Xen on Ubuntu 7.04 (Feisty Fawn) guide over at howtoforge. Running on a Kubuntu desktop, I actually installed
ubuntu-xen-desktop. At this point, I'm not sure what the dependencies of that were, but these packages are now installed:
- libc6-xen
- libxen3.0
- python-xen3.0
- ubuntu-xen-desktop
- xen-docs-3.0
- xen-hypervisor-3.0-i386
- xen-image-2.6.19-4-generic
- xen-ioemu-3.0
- xen-tools
- xen-utils-3.0
- xenman
A couple of notes: I have the non-PAE version of the hypervisor, because I have less than 4 GB of RAM. Also, note carefully the version of xen-image: you will get to add this one to your bootloader configuration later, so you'd better know what it is. Since the howto skips that part, this is my configuration for Xen with GRUB:
title Xen 3.0 and Linux 2.6 (Kubuntu Fiesty host)
root (hd0,4)
kernel /boot/xen-3.0-i386.gz
module /boot/vmlinuz-2.6.19-4-generic root=UUID=[long string] ro quiet
module /boot/initrd.img-2.6.19-4-generic
That is, the Xen hypervisor is the kernel, with the Xen-enabled kernel (since I don't have a CPU with VT support) for dom0 and its initrd loaded as modules. The UUID for the root device was simply copied from the existing entry for the non-virtual Kubuntu system.
I chose to install Debian Etch as my first VM to play with. My dom0 system is called "kubikal", and this new virtual machine is "xen1".
SSH Troubles
I couldn't SSH into my shiny new xen1. Error messages related to openpty and "session 0 alloc" appeared in auth.log:
xen1$ sudo tail /var/log/auth.log | grep error
Aug 18 21:30:39 xen1 sshd[1940]: error: openpty: No such file or directory
Aug 18 21:30:39 xen1 sshd[1942]: error: session_pty_req: session 0 alloc failed
This is caused by the lack of the devpts filesystem, which is in turn caused by the (rather mysterious) lack of udev. Simply create
/dev/pts, install udev, and everything should work.
xen1$ sudo mkdir /dev/pts
xen1$ sudo apt-get install udev
Now, you should be able to SSH into the box by IP address, but the connection will be rather slow because DNS doesn't recognize this virtual machine yet. Setting
UseDNS no in xen1's
/etc/ssh/sshd_config may help, but the SSH client appears to do its own DNS lookups unconditionally. I'll cover getting DHCP+DNS working for the virtual machines
in part II.