Skip to content

Instantly share code, notes, and snippets.

@samtingleff
Created December 23, 2009 21:37
Show Gist options
  • Save samtingleff/262827 to your computer and use it in GitHub Desktop.
Save samtingleff/262827 to your computer and use it in GitHub Desktop.
Running debian lenny as a pv domu guest on OpenSolaris 2009.06 and later XVM host.
1. Build an HVM lenny guest and install debootstrap.
2. Create zfs vols for the pv guest.
3. Attach the destination vol to the HVM guest (then reboot to take effect):
osol $ pfexec virsh attach-disk lenny-hvm /dev/zvol/dsk/rpool/xvm/lenny-01-xvba hdb
4. In the HVM guest, partition the disk and format a root partition. Mount it at /mnt.
hvm # deboostrap lenny /mnt
5. Prepare /mnt for boot:
hvm # cp /etc/apt/sources.list /mnt/etc/apt/
hvm # chroot /mnt
hvm # export LANG=C
hvm # apt-get update
hvm # mkdir -p /boot/grub
hvm # apt-get install grub linux-image-xen-amd64
hvm # cat > /etc/fstab <<> /dev/xvda1 / ext3 defaults,noatime 0 1
/dev/xvda2 none swap default 0 0
proc /proc proc default 0 1
EOF
hvm # update-rc.d -f hwclockfirst remove
hvm # update-rc.d -f hwclock remove
hvm # cat >/etc/network/interfaces <<> auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
EOF
hvm # echo "127.0.0.1 localhost" > /etc/hosts
hvm # echo "lenny-01" > /etc/hostname
6. Edit /etc/inittab to include ONLY these two getty lines (thanks http://wiki.debian.org/Xen)
1:2345:respawn:/sbin/getty 38400 hvc0
2:23:respawn:/sbin/getty 38400 tty1
7. Edit /etc/default/rcS to set UTC=no
8. Copy the kernel and initrd onto the dom0 host.
9. Shutdown the hvm guest.
10. Remove the zfs vol
osol $ pfexec virsh detach-disk lenny-hvm hdb
11. Create an xml conf file config.xml like http://gist.github.com/262825
12. Input into the xen db
osol $ pfexec virsh define etch-01
Resources
http://blog.adventuresinopensolaris.com/2008/07/xvm-pv-of-debian-distros.html
http://opensolaris.org/jive/thread.jspa?threadID=62436&tstart=60
http://wiki.debian.org/Xen
http://hub.opensolaris.org/bin/view/Community+Group+xen/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment