This is an abbreviated and simplified version of a more official document. Run these either as root or with the “sudo” command..
- apt-get install ubuntu-xen-desktop-amd64 to install a new Xen kernel and various other tools. Apparently we’re supposed to use the “server” version instead, but it didn’t show up in the repository. Oh well.
- apt-get install debootstrap to install the “debootstrap” system bootstraping tool for you.
- reboot into the new kernel.
- xm list to make sure Domain-0 shows up. Domain-0 represents the host system.
- Edit /etc/xen/xend-config.sxp and uncomment “(network-script network-bridge)”. Also comment out “(network-script network-dummy)”.
- xend restart to restart the xen daemon.
- mkdir -p /xen/slave1 to create a mountpoint for the slave system disk.
- dd if=/dev/zero of=/xen/slave1.ext3 bs=1M count=512 to create a 512MB “disk” as a normal file.
- mkfs.ext3 /xen/slave1.ext3 to create a file system in said empty file.
- mount -o loop -t ext3 /xen/slave1.ext3 /xen/slave1 to manually mount the new filesystem to its mount point.
- debootstrap –arch amd64 edgy /xen/slave1 to install a bare bones edgy system onto the new file system.
- cp -a /lib/modules/2.6.19-4-generic-amd64/ /xen/slave1/lib/modules/ to install the hosts kernel modules into the new system.
- Edit /xen/slave1/etc/network/interfaces. It should look similar to..auto lo
iface lo inet loopbackauto eth0
iface eth0 inet static
where “gateway” is the host machines IP address, and “address” is a unique IP address for the slave machine.
- Update /xen/slave1/etc/hostname with whatever you want its host name to be.
- Update /xen/slave1/etc/hosts with all your IP addresses.
- Update /xen/slave1/etc/fstab to mount stuff on boot, like so..proc /proc proc defaults 0 0
/dev/hda1 / ext3 defaults,errors=remount-ro 0 1
- umount /xen/slave1 to unmount the file system.
- Create /etc/xen/edgy-guest.cfg to configure the host to start the guest, like so..
kernel = “/boot/vmlinuz-2.6.19-4-generic-amd64”
ramdisk = “/boot/initrd.img-2.6.19-4-generic-amd64”
memory = 512
name = “edgy-slave1”
vcpus = 1
vif = [ ‘bridge=xenbr0’ ]
disk = [ ‘file:/xen/slave1.ext3,ioemu:hda1,w’ ]
root = “/dev/hda1 ro”
- xm create slave1-edgy.cfg to create and start the new domain.
- xm console slave1-edgy to establish a console to the new domain. (Hit CTRL+] to exit.)
You should now be able to log in via the xm console as root, and ping the guest on 192.168.1.111 (or whatever its IP address is). w00t!