251
edits
Changes
m
This chapter of [[Xen Virtualization Essentials]] will cover in detail the steps necessary to install and run Microsoft Windows Vista as a virtualized Xen guest.
Since Windows Vista falls into the Xen category of an unmodified operating system (in other words an operating system that has not been altered specifically to run on the Xen hypervisor) paravirtualization is not an option. The best way, therefore, to virtualize Windows Vista is to configure it as a Xen Hardware Virtual Machine (HVM) guest. For information about the primary differences between paravirtualization, hardware virtualization and full virtualization read the chapter of this book entitled [[An Overview of Virtualization Techniques]].<htmlet>xen</htmlet>
[[Image:xen_windows_vista_running.jpg|Windows Vista running as a Xen HVM guest]]<htmlet>xen</htmlet>
Text replacement - "<htmlet>xen<htmlet>" to "<htmlet>xen</htmlet>"
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[Installing and Running Virtualizing Windows XP or Vista as a Server 2008 with Xen HVM domainU Guest|Previous]]<td align="center">[[Xen Virtualization Essentials|Table of Contents]]<td width="20%" align="right">[[Adding USB Devices to a Xen HVM domainU Guest|Next]]</td>
<tr>
<td width="20%">Installing and Running Virtualizing Windows XP or Vista as a Server 2008 with Xen HVM domainU Guest<td align="center"><td width="20%" align="right">Adding USB Devices to a Xen HVM domainU Guest</td>
</table>
<hr>
This chapter of [[Xen Virtualization Essentials]] will cover in detail the steps necessary to install and run Microsoft Windows 7 as a virtualized Xen guest. Since Windows 7 falls into the Xen category of an unmodified operating system (in other words an operating system that has not been altered specifically to run on the Xen hypervisor) paravirtualization is not an option. The best way, therefore, to virtualize Windows 7 is to configure it as a Xen Hardware Virtual Machine (HVM) guest. For information about the primary differences between paravirtualization, hardware virtualization and full virtualization read the chapter of this book entitled [[An Overview of Virtualization Techniques]]. == Requirements for Xen Windows Server 2008 7 Virtualization ==
This chapter assumes that the Xen host system is running a Xen enabled kernel and that the standard Xen tools (specifically ''xm'') are also installed. In addition, hardware virtualization requires that the host system hardware include either Intel-VT or AMD-V virtualization support. In order to verify this run the following commands on the host system:
If neither of the above command produce output then it is likely these features are unavailable and that your hardware is unable to run Xen HVM guests.
== Windows Vista 7 Installation Media ==
In order to install Windows Vista 7 as a Xen HVM guest the next requirement is the operating system installation media. This is likely to be in the form of a DVD. AlternativielyAlternatively, if the media was downloaded from the Microsoft web site, it will be in the form of an ISO image file. Installation may be performed directly from the DVD, from an ISO image, or the contents of the DVD may be copied to an ISO image file on the host system.
To create an ISO image simply insert the DVD into a drive, unmount it if it automounts and then run the following command (substituting ''/dev/cdrom'' for your DVD drive device):
<pre>
dd if=/dev/cdrom of=winvistawindows7.iso
</pre>
== Preparing Storage Space for Windows Vista 7 ==
Obviously, the Windows Vista 7 guest system will need disk space into which it can install itself and subsequently execute. This space can take the form of either a physical disk drive connected to the host system or a disk image file accessible to the host system. If a physical disk drive is available for the guest, make a note of the device name. This is typically a device beginning with /dev/sd or /dev/hd followed by a letter (for example /dev/sdc or /dev/hdb).
If a disk image is required one may be created using the ''dd'' command-line tool:
<pre>
dd if=/dev/zero of=xenwinvistaxenwin7.img bs=1024k seek=10000 count=0
</pre>
The above command creates a 10Gb image file named ''xenwinvistaxenwin7.img''.
== Creating the Xen Windows Vista 7 Configuration File ==
The next step involves the creation of a domainU configuration file suitable for installing Windows Vista 7 as a Xen guest.
The following file is an example configuration file with the minimal settings required for a Windows Vista 7 Xen guest:
<pre>
# Should be at least 2KB per MB of domain memory, plus a few MB per vcpu.
shadow_memory = 8
name = "xenwinvistaxenwin7"
vif = [ 'type=ioemu, bridge=xenbr0' ]
acpi = 1
apic = 1
disk = [ 'file:/home/xen/xenwinvistaxenwin7.img,hda,w', 'file:/home/xen/winvistawindows7.iso,hdc:cdrom,r' ]
device_model = '/usr/' + arch_libdir + '/xen/bin/qemu-dm'
</pre>
The above example assumes that Windows Vista 7 is going to be installed into a disk image and that the installation media is an ISO image file. If, on the other hand, a physical disk is to be used the disk directive might appear as follows (where ''/dev/sdb'' is replaced with the appropriate physcial device name):
<pre>
disk = [ 'phy:/dev/sdb,hda,w', 'file:/home/xen/winvistawindows7.iso,hdc:cdrom,r' ]
</pre>
Similarly, the ''disk = '' directive can be modified to perform the installation from a physical DVD drive as in the following example (where ''/dev/hdccdrom'' is modified to reflect the physical device on your host system):
<pre>disk = [ 'phy:/dev/sdb,hda,w', 'phy:/dev/cdrom,hdc:cdrom.r' ]</pre> The above line maps physical disk drive ''/dev/sdb'' on the host to ''/dev/hda'' on the guest and ''/dev/hdccdrom'' on the host as the CD/DVD device on the guest (note that the CD/DVD device name on your host may be different depending on your Linux distribution).
Alternatively, if a disk image file is to be used as the disk drive the line might instead read:
<pre>
disk = [ 'phyfile:/devhome/xen/sdbxenwin2008.img,hda,w', 'phy:/dev/hdbcdrom,hdc:cdrom,r' ]
</pre>
A number of the configuration settings shown in the above example are to enable a graphical console for our Windows Vista 7 guest operating system. Xen provides a choice of VNC or SDL for supporting a graphical console when the guest is running. For example the following settings select VNC:
<pre>
</pre>
A number of other configuration options are available to modify the guest environment but the above settings are the minimal settings recommended to run a Windows 7 guest with Xen. Once the configuration file is complete save it as xenwinvistaxenwin7.cfg.
== Starting the Xen Windows Vista 7 HVM Guest ==
With the configuration complete the next step is to start up the Xen guest environment:
<pre>
xm create xenwinvistaxenwin7.cfgUsing config file "./xenwinvistaxenwin7.cfg".Started domain xenwinvistaxenwin7
</pre>
After a few seconds the VNC or SDL console (depending on the configuration settings) will appear and the Windows Vista 7 installation process will begin. The following figure shows the Windows Vista 7 instance running as a Xen HVM guest displaying in a VNC window: [[Image:xen_windows_7_running.jpg|Windows 7 running as a Xen HVM guest]]
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[Installing and Running Virtualizing Windows XP or Vista as a Server 2008 with Xen HVM domainU Guest|Previous]]<td align="center">[[Xen Virtualization Essentials|Table of Contents]]<td width="20%" align="right">[[Adding USB Devices to a Xen HVM domainU Guest|Next]]</td>
<tr>
<td width="20%">Installing and Running Virtualizing Windows XP or Vista as a Server 2008 with Xen HVM domainU Guest<td align="center"><td width="20%" align="right">Adding USB Devices to a Xen HVM domainU Guest</td>
</table>