» Do it. Now.

Howto add a new Xen vm

First create /etc/xen-tools/partitions.d/hostname containing something like the following: [root] size=6G type=ext3 mountpoint=/ options=defaults,errors=remount-ro

[swap] size=2G type=swap

[home] size=4G type=ext3 mountpoint=/home options=errors=remount-ro

[tmp] size=4G type=ext3 mountpoint=/tmp options=nodev

[var] size=4G type=ext3 mountpoint=/var options=defaults,errors=remount-ro

After that run xen-create-image –hostname hostname –dist lenny –memory 512Mb –partitions hostname –ip designated IP –gateway gateway IP (usually XenServer IP) –netmask netmask –broadcast broadcast IP

Few things to do before starting the vm:

Mount the created volumes and start a chroot:

mount /dev/mapper/xxx /mnt chroot /mnt

You now want to install udev (into the chroot): apt-get install udev

Perhaps set a root password you know:

passwd root

next few tasks should be done in the chroot as well:

modify /etc/inittab:

#1:2345:respawn:/sbin/getty 38400 tty1 # comment all /sbin/getty lines

add: 1:2345:respawn:/sbin/getty 38400 hvc0

edit /etc/sysctl.conf


followed by the command:

sysctl -p

this should already be done so check: xen-tools.conf:x slower than LVM partitions, then specify a directory here and uncomment xen-tools.conf:x LVM volume group here instead xen-tools.conf:lvm = vg0

when you are done start the vm: xm create /etc/xen/$host.cfg xm list shows running vms

howto/howto-add-a-new-xen-vm.txt · Last modified: 2010/04/18 18:56 by basti