Instant Windows—Recipe for Running Windows as a Guest on Solaris xVM
Requirements
Use this guide to quickly set up a Windows domU on Solaris xVM.Note that Windows HVM domains are susceptible to viruses and worms, so make sure you comply with your site's security policies, keep the firewall enabled, install virus software, and do all that is necessary to keep your network secure.
To run Windows as a guest on Solaris xVM, you will need:
-
An HVM-capable machine running Solaris xVM dom0.
A machine is HVM-capable if it is has an AMD Opteron Rev F or later, or an Intel CPU with VT extensions.
-
A Windows install disk .iso image.
-
qemu-img.
qemu-img is needed to create the file-based disk for the domain. It's part of qemu, or can be downloaded here.
Currently, Windows 2000 is known not to install very well (it sometimes will finish, but takes a very long time).
Supported install method
NOTE: you should use virt-install in almost all cases to install HVM domains - virt-install is the supported method. However, if for some reason this doesn't do what you need, you can follow the legacy instructions below.
NOTE: virt-install currently has a bug with installing Windows, whereby after the first reboot, the continuation of the Windows install cannot find the CD to install from ( 6648448 virt-install needs to leave DVD present for Windows). See the bug for the simple workaround to this problem.
Legacy install method
-
Create the domain's disk:
qemu-img create -f raw winxp-disk.raw 15G
-
Update the text in Configuration File, below, with the correct paths to
the .iso image and the disk image you just created, and put it in a
file called, for example, winxp.hvm.
-
Create the guest domain:
xm create winxp.hvm
-
Connect to the console:
vncviewer :0
Assuming you have $DISPLAY set up properly, the VNC viewer will appear with the contents of the virtual machine's console. Mouse tracking will improve once Windows is booted and installs its driver for qemu's emulated graphics tablet-style mouse.
NOTE: To use a CD instead of a .iso image, change the file:/ link to be a phy:/ link that points to the CD-ROM drive, for example, phy:/dev/dsk/c0t1d0s2,hda:cdrom,r.
Configuration File
disk = [ 'file:/export/winxp/winxp-disk.raw,hdc,w',
'file:/export/winxp/winxp.iso,hda:cdrom,r' ]
memory = 512
name = "winxp"
kernel = "/usr/lib/xen/boot/hvmloader"
builder='hvm'
vif = [ 'type=ioemu' ]
on_poweroff = 'destroy'
on_reboot = 'restart'
on_crash = 'preserve'
boot='d'
vnc=1
vnclisten="0.0.0.0"
vncpasswd=''
serial='null'
apic=0
usb=1
usbdevice="tablet"
device_model = '/usr/lib/xen/bin/qemu-dm'