How to Set up OpenSolaris as a xVM dom0
If you are running build 126 or later of OpenSolaris, enabling xVM is as simple as:
$ pfexec pkg install xvm-gui $ pfexec svcadm enable milestone/xvm $ pfexec reboot
If you're on an older release, follow the instructions below.
Enabling xVM on an older OpenSolaris release
Create a separate build environment, if needed
$ pfexec beadm create -a -d xvm xvm
Install the required packages
$ pfexec beadm mount xvm /tmp/xvm-be $ pfexec pkg -R /tmp/xvm-be install SUNWvirt-manager SUNWxvm SUNWvdisk SUNWvncviewer $ pfexec beadm umount xvm
If you're running a recent version of OpenSolaris, you can install the xvm-gui cluster instead of the individual packages.
Add the menu.lst entry
Run the AWK script over the menu.lst file that controls the GRUB menu. This step is necessary for beadm to reboot into Xen.
$ awk '
/^title/ { xvm=0; }
/^title.xvm$/ { xvm=1; }
/^(splashimage|foreground|background)/ {
if (xvm == 1) next
}
/^kernel\$/ {
if (xvm == 1) {
print("kernel\$ /boot/\$ISADIR/xen.gz")
sub("^kernel\\$", "module$")
gsub("console=graphics", "console=text")
gsub("i86pc", "i86xpv")
$2=$2 " " $2
}
}
{ print }' /rpool/boot/grub/menu.lst >/var/tmp/menu.lst.xvm
Verify that the AWK script worked properly.
$ tail /var/tmp/menu.lst.xvm #============ End of LIBBE entry ============= title xvm findroot (pool_rpool,0,a) bootfs rpool/ROOT/xvm kernel$ /boot/$ISADIR/xen.gz module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=text module$ /platform/i86pc/$ISADIR/boot_archive #============ End of LIBBE entry =============
Replace menu.lst and reboot
$ pfexec cp /rpool/boot/grub/menu.lst /rpool/boot/grub/menu.lst.saved $ pfexec mv /var/tmp/menu.lst.xvm /rpool/boot/grub/menu.lst $ pfexec reboot
Enable the services
Enable the xVM services (ignore any warnings about multiple instances).
$ svcadm enable -r xvm/virtd ; svcadm enable -r xvm/domains
You should be able to install guest domains now.
on 2009/10/28 23:53