(I'm still setting up my system.)
I installed Xen with the xcp-xapi package, as outlined in Installing XCP-XAPI on Ubuntu Server 12.04 LTS at the Scott Lowe blog. I also used instructions from Xen on Ubuntu 12.04 Notes article. This is melding of the two techniques, so go read both those carefully, and also follow the links out, to understand what's happening.
(Please note that all commands are run as root.)
The current version of Ubuntu 12.04 includex xcp-xapi, so installing it is
apt-get install xcp-xapi
This installs Xen's xend daemon; you want to use xcp-xapi instead. So run this command to disable xend:
update-rc.d xend disable
That command will alter the symlinks in /etc/rc.d* so that the ones pointing to xend are disabled.
I set the XAPI toolstack as the default by editing /etc/default/xen and changing the line TOOLSTACK="" to TOOLSTACK="xapi".
Networking was kind of hard. I ended up creating the xenbr0 bridge, adding eth0 to id, giving xenbr0 an ip address, and removing the ip address for eth0. I suspect this is all backwards, and I should give eth0 the address, and give xenbr0 no address.... but we'll see. Here's the config from /etc/network/intefaces:
# The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 #iface eth0 inet static # address 192.168.111.10/24 # gateway 192.168.111.1 # metric 1 # dns-nameservers 192.168.111.1 auto xenbr0 iface xenbr0 inet static bridge_ports eth0 address 192.168.111.12 netmask 255.255.255.0 gateway 192.168.111.1 dns-nameservers 192.168.111.1
Note that all the config info for eth0 is commented out. Also, note that I had dns-nameservers set in the last line. When this wasn't set, I had problems pinging to the gateway... which made no sense to me, but that's what happened.
I originally installed openvswitch, but ended up switching to bridged, and doing the bridge config in interfaces instead. Then, I set it back to openvswitch to practice with that. (tbd)
I then altered the grub boot order so Xen would run. This was copied from Clayton Shepard.
cd /etc/default/grub mv 20_linux_xen 06_linux_xen
I did this instead of the config file editing hack, to avoid problems with future kernels.
After that, I rebooted. (Well I actually rebooted before, and had problems, but eventually I got to this point, and the system booted okay.) Once it's running, you can run the following commands and get some info:
xe cd-list xe network-list xe sr-list xe vm-list
I then proceeded to the instructions at the Kronos site, Installing Linux on Kronos. Kronos is just xen with xpc tools. They said to make a symlink for /usr/share/qemu/keycodes.
mkdir /usr/share/qemu cd /usr/share/qemu ln -s ../qemu-linaro/keymaps/
From there, I need to make a storage repository, getting some advice from this article. The Dom0 I made was on a 25 Gig partition, leaving most of the rest of the disk for storage using LVM. When I was installing the system, I followed the rules and made an LVM volume of around 25 Gigs. LVM has a lot of features, like volume snapshots, that Xen can use. Here's my fdisk -l before I do anything:
Disk /dev/sda: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x0001f7c4 Device Boot Start End Blocks Id System /dev/sda1 * 2048 499711 248832 83 Linux /dev/sda2 501758 976771071 488134657 5 Extended /dev/sda5 501760 976771071 488134656 8e Linux LVM Disk /dev/sdb: 500.1 GB, 500107862016 bytes 255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/sdb doesn't contain a valid partition table Disk /dev/mapper/hammond-root: 21.4 GB, 21411921920 bytes 255 heads, 63 sectors/track, 2603 cylinders, total 41820160 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/hammond-root doesn't contain a valid partition table Disk /dev/mapper/hammond-swap_1: 8585 MB, 8585740288 bytes 255 heads, 63 sectors/track, 1043 cylinders, total 16769024 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Disk /dev/mapper/hammond-swap_1 doesn't contain a valid partition table