System Administration Guide: Virtualization Using the Solaris Operating System

Domain 0 Procedures

How to Set up OpenSolaris 2009.06 as a Sun xVM dom0

Use this procedure to set up the OpenSolaris 2008.11 or 2009.06 release as an xVM dom0.

  1. Create a separate boot environment, if needed.


    # pfexec beadm create -a -d xvm xvm
    
  2. If you're running a recent version of OpenSolaris, you can install the xvm-gui cluster instead of the individual packages.

    Otherwise, 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
  3. Run the following AWK script over the menu.1st file that controls the GRUB menu. This step is necessary for beadm to reboot into xVM. The menu.1st file is typically located in the /pool-name/boot/grub directory on systems with a ZFS root. The correct menu.1st file is shown in Step 4 of this procedure.


    $ 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
  4. 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 =============
  5. Create a new GRUB entry in /rpool/boot/grub/menu.1st.xvm and then reboot.

  6. Enable the xVM services.


    # svcadm enable -r xvm/virtd ; svcadm enable -r xvm/domains
    

You should now be able to install guest domains.

ProcedureHow to View Domains on the System

Run the virsh list, xm list or the xm top commands to view the domains on the system. These commands provide details of running domains. The display from any of these commands should show the single control domain, called Domain-0.

  1. Become superuser, or assume the appropriate role.

  2. Run virsh list.


    # virsh list Id Name                 State
    ----------------------------------
      0 Domain-0             running
See Also

See the xentop(1M) man page.