Sun xVM Hypervisor (Part II - Windows Vista DomU)

In Part I, we installed the xVM hypervisor and setup our OpenSolaris 2008.11 Dom0. Let's examine how to provision a fully virtualized DomU running Windows Vista with 1 command!
A fully virtualized DomU is also referred to as a Hardware-assisted Virtual Machine (HVM). HVM domains are capable of running an unmodified guest operating system that is not hypervisor aware. In order to support HVM domains, the hypervisor requires that the underlying hardware platform support either AMD's AMD-V or Intel's VT-x virtualization technology.
At the completion of this procedure, your system will be running the xVM hypervisor, an OpenSolaris 2008.11 Dom0, and a newly provisioned Windows Vista DomU.
Clone a new boot environment and update all installed packages using the pkg command. GRUB will boot the newly cloned boot environment by default.
$ pfexec pkg image-update
PHASE ACTIONS
Removal Phase 1/1
PHASE ITEMS
Reading Existing Index 9/9
Indexing Packages 1/1
A clone of xvm exists and has been updated and activated.
On the next boot the Boot Environment xvm-1 will be mounted on '/'.
Reboot when ready to switch to this updated BE.
---------------------------------------------------------------------------
NOTE: Please review release notes posted at:
http://opensolaris.org/os/project/indiana/resources/relnotes/200811/x86/
---------------------------------------------------------------------------
$
Reboot the system.
$ pfexec shutdown -y -g0 -i6
Shutdown started. Sun Apr 5 14:40:56 PDT 2009
Changing to init state 6 - please wait
Broadcast Message from root (pts/2) on discovery Sun Apr 5 14:40:56...
THE SYSTEM discovery IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged
$
Insert the Windows DVD. The disc will be automatically mounted by the removable volume manager rmvolmgr. Using the rmformat utility, determine the optical drive device path. Unmount the disc and create an ISO image.
$ rmformat
Looking for devices...
1. Logical Node: /dev/rdsk/c3t3d0p0
Physical Node: /pci@0,0/pci8086,5358@1f,2/cdrom@3,0
Connected Device: HL-DT-ST BD-RE GGW-H20L YL05
Device Type: CD Reader
Bus:
Size: 3.7 GB
Label:
Access permissions: Medium is not write protected.
$ pfexec umount /dev/dsk/c3t3d0s2
$ dd if=/dev/rdsk/c3t3d0p0 of=/export/home/ptelles/iso/vista.iso bs=2k
1919440+0 records in
1919440+0 records out
3931013120 bytes (3.9 GB) copied, 1160.88 s, 3.4 MB/s
$ eject cdrom
cdrom /dev/dsk/c3t3d0s2 ejected
$
We're now ready to provision our HVM domain with the virt-install program. If you prefer the use of a GUI, virt-manager (aka Virtual Machine Manager) is available, the use of which is outside the scope of this blog entry. Virtual Machine Manager and the virt-install program can also be used to provision, manage and monitor Logical Domains (aka LDoms) on Sun servers with CoolThreads technology.
Primary storage for DomUs can be provisioned in a multitude of different ways -- ZFS volumes, NFS shares, iSCSI LUNs, etc. In this example, we'll use a sparse file located in Dom0 as the primary storage for our HVM domain.
Create a HVM domain with 1 virtual CPU, 1GB of RAM, and a 20GB sparse file as primary storage.
$ pfexec virt-install -n vista --hvm --vcpus=1 -r 1024 --os-type=windows \
--os-variant=vista --vnc -f /export/home/ptelles/xvm/vista.img -s 20 \
-c /export/home/ptelles/iso/vista.iso
Starting install...
Creating storage file... 100% |=========================| 10 B 00:00
Creating domain... 0 B 00:03
VNC Viewer Free Edition 4.1.2 for X - built Oct 16 2008 12:13:46
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Sun Apr 5 15:35:15 2009
CConn: connected to host localhost port 5900
CConnection: Server supports RFB protocol version 3.3
CConnection: Using RFB protocol version 3.3
TXImage: Using default colormap and visual, TrueColor, depth 24.
CConn: Using pixel format depth 6 (8bpp) rgb222
CConn: Using ZRLE encoding
Windows Vista will automatically boot and begin its installation process while displayed within a RealVNC window. Complete the Windows Vista installation process.
The following image was scaled down from 1920x1200 to 931x582.
Shutdown Windows Vista.
Remove the virtual CD-ROM device that the virt-install program created during the initial provisioning process using the virsh command. This will prevent Windows Vista from constantly mounting the ISO image at start-up.
$ pfexec virsh detach-disk vista hdc
$
If your system has an optical device and you would like to share it with the Windows Vista HVM domain, add the appropriate block device with virsh.
$ rmformat
Looking for devices...
1. Logical Node: /dev/rdsk/c3t3d0p0
Physical Node: /pci@0,0/pci8086,5358@1f,2/cdrom@3,0
Connected Device: HL-DT-ST BD-RE GGW-H20L YL05
Device Type: CD Reader
Bus:
Size:
Label:
Access permissions:
$ pfexec virsh attach-disk vista /dev/dsk/c3t3d0s2 hdb --driver phy --type cdrom --mode readonly
$
Start the Windows Vista HVM domain with the virsh command. Always shutdown Windows from within the operating system itself. /usr/bin/pfexec virsh shutdown domain will not gracefully shutdown Windows Vista.
$ pfexec virsh list
Id Name State
----------------------------------
0 Domain-0 running
- vista shut off
$ pfexec virsh start vista
Domain vista started
$ pfexec virsh list
Id Name State
----------------------------------
0 Domain-0 running
7 vista running
$
Display the Windows Vista desktop using the vncviewer. Press F8 for a list of options within the viewer itself.
$ pfexec vncviewer :0
VNC Viewer Free Edition 4.1.2 for X - built Oct 16 2008 12:13:46
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Sun Apr 5 19:23:56 2009
CConn: connected to host localhost port 5900
CConnection: Server supports RFB protocol version 3.3
CConnection: Using RFB protocol version 3.3
TXImage: Using default colormap and visual, TrueColor, depth 24.
CConn: Using pixel format depth 6 (8bpp) rgb222
CConn: Using ZRLE encoding
CConn: Throughput 20001 kbit/s - changing to hextile encoding
CConn: Throughput 20001 kbit/s - changing to full colour
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using hextile encoding
CConn: Throughput 20000 kbit/s - changing to raw encoding
CConn: Using raw encoding
$
Congratulations! Windows Vista is now fully virtualized within a xVM hypervisor HVM domain.
Posted at 10:57PM Apr 05, 2009 by Paul Telles in Solaris |
Sun xVM Hypervisor (Part I - Basic Installation)

The Sun xVM hypervisor is based upon the open-source Xen virtual machine monitor developed at the University of Cambridge and work done by the OpenSolaris Xen community. It's a core component of our forthcoming xVM Server product and is readily available today from the OpenSolaris online network package repository.
Sun started in the academic community and has always fostered a close relationship with researchers in academia. The Texas Advanced Computing Center (TACC) at UT Austin collaborated with Sun, other universities, and the open-source community to build and support a High Performance Computing (HPC) system (called Ranger) comprised of 3,936 servers and 15,744 processors — the most capable HPC resource for scientific research in the nation runs the xVM hypervisor.
In a recent entry, I posted a screen shot of my workstation running Windows XP (32-bit) and Windows 7 (64-bit), both virtualized within unprivileged guest domains (aka DomUs). Let's examine how to install the hypervisor and bring up an OpenSolaris 2008.11 control domain (aka Dom0) in 4 easy steps!
At the completion of this procedure, your system will be running the xVM hypervisor and an OpenSolaris 2008.11 Dom0 for control and mangement of the virtualized environment. In future installments, we'll explore how to provision and deploy DomUs.
$ pfexec /usr/lib/vna nge0 fe:00:11:22:33:44
vnic0
$ dladm show-link
LINK CLASS MTU STATE OVER
nge0 phys 1500 down --
bge0 phys 1500 up --
vnic0 vnic 1500 unknown nge0
$ pfexec /usr/lib/vna vnic0
$ dladm show-link
LINK CLASS MTU STATE OVER
nge0 phys 1500 down --
bge0 phys 1500 up --
$
Clone a new boot environment, name it xvm, and mount it to /mnt/xvm with the beadm utility. The new boot environment will consume approximately 2.6 gigabytes of storage.
$ pfexec beadm create -a -d 'Sun xVM Hypervisor' xvm
$ pfexec beadm mount xvm /mnt/xvm
Install the xvm, xvm-gui, SUNWxvmhvm, SUNWvdisk, SUNWxdt, and SUNWvncviewer packages onto the new xvm boot environment using the pkg command.
$ pfexec pkg -R /mnt/xvm install xvm xvm-gui SUNWxvmhvm SUNWvdisk SUNWxdt SUNWvncviewer
PHASE ITEMS
Indexing Packages 554/554
DOWNLOAD PKGS FILES XFER (MB)
Completed 11/11 643/643 9.17/9.17
PHASE ACTIONS
Install Phase 905/905
Reading Existing Index 9/9
Indexing Packages 11/11
$ pfexec beadm umount xvm
$ beadm list
BE Active Mountpoint Space Policy Created
-- ------ ---------- ----- ------ -------
opensolaris N / 6.33M static 2009-03-28 08:30
xvm R - 2.56G static 2009-03-28 09:28
$
When beadm created the new boot environment, it also added a new default entry to the GRUB boot loader configuration file /rpool/boot/grub/menu.lst:
title Sun xVM Hypervisor
findroot (pool_rpool,0,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/xvm
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
Edit the new entry as appropriate for your system configuration. At a minimum, you must modify the highlighted line above and add an additional line for the hypervisor. It should resemble the following:
title Sun xVM Hypervisor
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
Reboot the system.
$ pfexec shutdown -y -g0 -i6
Shutdown started. Sun Mar 29 23:40:56 PDT 2009
Changing to init state 6 - please wait
Broadcast Message from root (pts/2) on discovery Sun Mar 29 23:40:56...
THE SYSTEM discovery IS BEING SHUT DOWN NOW ! ! !
Log off now or risk your files being damaged
$
Enable the virtd and domains services. Display a list of all defined domains with the virsh command.
$ pfexec svcadm enable -r xvm/virtd
$ pfexec svcadm enable -r xvm/domains
$ pfexec virsh list
Id Name State
----------------------------------
0 Domain-0 running
$
Posted at 12:32AM Mar 30, 2009 by Paul Telles in Solaris |
Multiboot Solaris on a MacBook Pro Redux
In my last entry, I used an early development build (build 63) of Solaris Express Community Edition (SXCE). SXCE is Sun's binary release for OpenSolaris developers (code named "Nevada"). The OpenSolaris 2008.11 release is based upon Nevada build 101b and is greatly improved. All of the issues that I previously identified have been resolved. Brian Leonard documented a simple, straightforward procedure to multiboot OpenSolaris and Mac OS X. I tested his procedure with the latest releases of OpenSolaris, Mac OS X, and rEFIt. It proved to be the simplest approach to date.
Posted at 03:05PM Mar 24, 2009 by Paul Telles in Solaris |
The OpenSolaris Enthusiast Pool
I just stumbled upon a very cool collection of pictures posted by OpenSolaris enthusiasts on Flickr.
The Songbird wallpaper is my favorite.
Posted at 03:02PM Mar 20, 2009 by Paul Telles in Solaris |
OpenSolaris Meet Skulltrail
I built a new "V8 rig" to run OpenSolaris based upon the Intel D5400XS "Skulltrail" motherboard. With dual Quad-Core processors, it's an excellent enthusiast platform. OpenSolaris 2008.11 installs cleanly and quickly with great support for the on-board devices -- it's a marriage made in heaven.

A screen shot of OpenSolaris 2008.11 running on Skulltrail while virtualizing Windows XP SP3 (32-bit) and Windows 7 Beta 64-bit within Sun xVM Hypervisor guest domains.
Posted at 09:22PM Mar 15, 2009 by Paul Telles in Solaris | Comments[2]
Missing BMC Driver in OpenSolaris
Perhaps you've noticed that your unable to issue IPMI commands to the local BMC interface under OpenSolaris?
# ipmitool chassis status
Could not open bmc device: No such file or directory
#
Apparently the BMC driver is an encumbered piece of code. See Bug ID 6799081.
I downloaded the latest Solaris Express Community Edition (SXCE) and copied over the driver.
# cp /media/SOL_11_X86/Solaris_11/Product/SUNWckr/reloc/kernel/drv/amd64/bmc /kernel/drv/amd64
# cp /media/SOL_11_X86/Solaris_11/Product/SUNWckr/reloc/kernel/drv/bmc /kernel/drv
# cp /media/SOL_11_X86/Solaris_11/Product/SUNWckr/reloc/kernel/drv/bmc.conf /kernel/drv
Rebooted the system and ran devfsadm...problem solved.
# devfsadm
# ipmitool chassis status
System Power : on
Power Overload : false
Power Interlock : inactive
Main Power Fault : false
Power Control Fault : false
Power Restore Policy : always-off
Last Power Event :
Chassis Intrusion : inactive
Front-Panel Lockout : inactive
Drive Fault : false
Cooling/Fan Fault : false
#
Posted at 10:01PM Feb 23, 2009 by Paul Telles in Solaris |
Sun Fire X2100 Service Processor Setup
The optional M3290 Service Management Daughter Card (SMDC) can be setup fairly easily. Ensure that your BIOS, SMDC firmware, and Broadcom Ethernet controller firmware are all up to date. Check the Sun Fire X2100 Server Supplemental CD for the latest revisions.
I'm sharing this information in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. Caveat emptor!
Enable Console Redirection in the BIOS.
Run the BMC utility from the Sun Fire X2100 Server Supplemental CD to configure the SMDC's LAN settings and set passwords for the NULL, Operator, Admin, and OEM user accounts.
Add serial and terminal entries to your GRUB configuration file and specify ttya as the OpenSolaris console:
Reboot and enjoy!
Posted at 10:58AM Feb 22, 2009 by Paul Telles in Solaris |
Multiboot Solaris on a MacBook Pro
This entry describes how to setup a 15" MacBook Pro to multiboot Solaris Express and Mac OS X without the use of Apple's Boot Camp technology. This is a refinement and expansion of work done by Christian Kelly, Paul Mitchell and Alan Perry. Their collective experiences contributed greatly to my success.
I have not been able to instantiate the AirPort under Solaris, nor have I attempted to configure the built-in iSight camera, Bluetooth, FireWire, audio or ExpressCard/34 slot. Upon cursory examination, the Time-of-Day clock does not appear to function correctly.
I am sharing this information in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. Caveat emptor!
Resize the existing Macintosh HD volume to 80GB and create a 31GB FAT32 partition. The FAT32 partition is a placeholder.
$ diskutil resizeVolume disk0s2 80G MS-DOS PC 31G
Started resizing on disk0s2 Macintosh HD
Verifying
Resizing Volume
Adjusting Partitions
Finished resizing on disk disk0s2 Macintosh HD
You will need to manually reformat your new partitions.
WARNING: You must now reboot!
$
Shut down the computer.
Boot OS X into single-user mode. Power on the system and hold down Command-S.
Display the current GUID Partition Table (aka the GPT).
# fdisk /dev/rdisk0
Disk: /dev/rdisk0 geometry: 14593/255/63 [234441648 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>
2: AF 1023 254 63 - 1023 254 63 [ 409640 - 167772160] HFS+
3: 0B 1023 254 63 - 1023 254 63 [ 168443944 - 65997664] Win95 FAT-32
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
#
Partition 1 is a fake partition which is designed to protect GPT-partitioned disks from tools that only understand the legacy MBR partitioning scheme. The partition ID of 0xEE denotes that partition 1 is a Protective MBR (PMBR) partition entry.
Change the partition ID of partition 1 to 0x63.
# printf "setpid 1\n63\nwrite\ny\nquit\n" | fdisk -e /dev/rdisk0
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1> Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: EE 1023 254 63 - 1023 254 63 [ 1 - 409639] <Unknown ID>
Partition id ('0' to disable) [0 - FF]: [EE] (? for help) fdisk:*1> Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] Writing MBR at offset 0.
fdisk: 1> #
Delete the FAT32 partition.
# printf "edit 3\n0\nwrite\ny\nquit\n" | fdisk -e /dev/rdisk0
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1> Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
3: 0B 1023 254 63 - 1023 254 63 [ 168443944 - 65997664] Win95 FAT-32
Partition id ('0' to disable) [0 - FF]: [B] (? for help) Partition 3 is disabled.
fdisk:*1> Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] Writing MBR at offset 0.
fdisk: 1> #
Create a Solaris partition.
# printf "edit 3\nBF\nn\n168443944\n65992601\nflag 3\nwrite\ny\nquit\n" | fdisk -e /dev/rdisk0
fdisk: could not open MBR file /usr/standalone/i386/boot0: No such file or directory
Enter 'help' for information
fdisk: 1> Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
3: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
Partition id ('0' to disable) [0 - FF]: [0] (? for help) Do you wish to edit in CHS mode? [n] Partition offset [0 - 234441648]: [168181800] Partition size [1 - 65997704]: [6599770
4] fdisk:*1> Partition 3 marked active.
fdisk:*1> Device could not be accessed exclusively.
A reboot will be needed for changes to take effect. OK? [n] Writing MBR at offset 0.
fdisk: 1> #
Display the new legacy MBR partition table.
# fdisk /dev/rdisk0
Disk: /dev/rdisk0 geometry: 14593/255/63 [234441648 sectors]
Signature: 0xAA55
Starting Ending
#: id cyl hd sec - cyl hd sec [ start - size]
------------------------------------------------------------------------
1: 63 1023 254 63 - 1023 254 63 [ 1 - 409639] ISC, HURD, *
2: AF 1023 254 63 - 1023 254 63 [ 409640 - 167772160] HFS+
*3: BF 1023 254 63 - 1023 254 63 [ 168443944 - 65992601] <Unknown ID>
4: 00 0 0 0 - 0 0 0 [ 0 - 0] unused
Shut down the computer.
# shutdown -h now
More often than not, GRUB will not recognize the built-in MacBook Pro USB keyboard. That being said, it is best if you attach an external USB keyboard in order to control the stage 2 boot selection. Once the Solaris kernel boots, the built-in keyboard will function correctly.
Power on the system, insert the DVD and hold down C.
From the GRUB menu, select "Solaris Express" and press enter.
Enter single-user mode and write a new label to the disk.
# format -e /dev/rdsk/c1d1p0
selecting /dev/rdsk/c1d1p0
NO Alt slice
No defect list found
[disk formatted, no defect list found]
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
fdisk - run the fdisk program
repair - repair a defective sector
show - translate a disk address
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
volname - set 8-character volume name
!<cmd> - execute <cmd>, then return
quit
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[1]: 0
Warning: This disk has an EFI label. Changing to SMI label will erase all
current partitions.
Continue? y
Warning: no backup labels
format> quit
# reboot
Hold down C to boot the Solaris DVD.
From the GRUB menu, select "Solaris Express" and press enter.
Perform a "Solaris Interactive Text (Console session)" installation as Solaris will not automatically recognize the ATI graphics adapter.
Once the Solaris installation is complete, the system will reboot into OS X.
Download the rEFIt Mac disk image from the rEFIt Project home page and follow their installation instructions.
Posted at 10:46PM May 28, 2007 by Paul Telles in Solaris | Comments[1]