Sunday Apr 05, 2009

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.

Contents

Assumptions

  • Reader has completed the Basic Installation procedure as outlined in Part I.
  • Reader possesses basic UNIX and Windows system administration skills.
  • This procedure is intended to work with all versions of Windows Vista -- Business, Home Basic, etc., inclusive of 64-bit editions.
    • Windows Vista Home Premium SP1 (64-bit) was used for testing purposes.

Update The Boot Environment

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

$

Create A DVD ISO Image

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
$ 

Provision A HVM Domain

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

$

Domain Start-up

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.

Other Resources

  • [1] Sun BluePrints Online: Solaris Operating System Hardware Virtualization Product Architecture

Sunday Mar 29, 2009

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.

Contents

Assumptions

  • Reader has a basic understanding of virtualization on the x86 architecture.
  • Reader possesses basic UNIX system administration skills.
  • The target system has a freshly installed copy of OpenSolaris 2008.11 and a NIC driver capable of supporting Virtual NICs (VNICs).
    • You can quickly test to see if your NIC driver supports VNICs using the undocumented vna utility:
      • /usr/lib/vna interface [ MAC_address ]
        
        $ 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       --
        $
        

Create A New Boot Environment

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 Packages

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
$

Modify The GRUB Configuration File

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

$

Start The xVM Services

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

$ 

Other Resources

  • [1] BigAdmin System Administration Portal: Sun xVM Hypervisor Overview
  • [2] System Administration Guide: Virtualization Using the Solaris Operating System (Chapter 37, Sun xVM Hypervisor System Requirements)
  • [3] Sun BluePrints Online: Understanding the Sun xVM Hypervisor Architecture
  • [4] OpenSolaris xVM Documentation
  • [5] What's New in OpenSolaris 2008.11
  • [6] Getting Started With OpenSolaris 2008.11

Tuesday Mar 24, 2009

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.

Tested Configuration

Sunday Mar 15, 2009

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.

Sunday Feb 22, 2009

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!

Contents

Tested Configuration

  • Sun Fire X2100 BIOS V1.1.8
  • SMDC Firmware V4.13
  • Broadcom 5721 Firmware V3.65
  • OpenSolaris 2008.11

Known Caveats

  • Per Appendix C of the Sun Fire X2100 Server User Guide, repeatedly sending escape sequences can hang the LAN on the SMDC card. If this occurs, you must manually reboot the system using the system reset button.

Update BIOS Settings

Enable Console Redirection in the BIOS.

Configure the SMDC

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.

Update GRUB Configuration

Add serial and terminal entries to your GRUB configuration file and specify ttya as the OpenSolaris console:

Reboot and enjoy!

Other Resources

  • [1] My Sun Fire X2100 Wiki Page
  • [2] Sun Fire X2100 Server Supplemental CD Download
  • [3] GNU GRUB Manual
  • [4] Tyan M3290 Specifications

Monday May 28, 2007

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!

Contents

Tested Configuration

  • 15" MacBook Pro (Intel Core 2 Duo 2.16GHz, 120GB HDD)
  • Boot ROM Version MBP22.00A5.B01
  • Mac OS X v10.4.9 (all available updates applied)
  • Solaris Express build 63
  • rEFIt 0.9

Known Caveats

  • Should you elect to reinstall OS X at a later date, the Installer will consider the Macintosh HD volume to be unusable. Launch Disk Utility from the Installer and erase the entire disk.
  • The maximum resolution attainable using the Xorg VESA driver is 1152x864.
  • rEFIt may interfere with the use of standard boot key sequences, however, in most cases it provides equivalent functionality.
  • Parallels Desktop for Mac does not support use of the Solaris partition within a virtual machine.

Resize the Existing Macintosh HD Volume

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.

Change the OS X Partition Scheme

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

Install Solaris

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.

Install the rEFIt Boot Manager

Download the rEFIt Mac disk image from the rEFIt Project home page and follow their installation instructions.

Other Resources

  • [1] Christian Kelly's Web site - MacBook and post Solaris install information.
  • [2] Paul Mitchell's Blog - MacBook Pro multiboot w/rEFIt.
  • [3] Alan Perry's Blog - Mac Mini multiboot.
  • [4] Secrets of the GPT - Apple Technical Note TN2166
  • [5] Intel - Extensible Firmware Interface (EFI) Specification
  • [6] Unified EFI Forum - Unified Extensible Firmware Interface (UEFI) Specification
  • [7] Partition table information.
  • [8] How It Works - CHS Translation
About

ptelles

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today