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
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