Changes

Jump to: navigation, search
m
Text replacement - "<htmlet>xen<htmlet>" to "<htmlet>xen</htmlet>"
<table border="0" cellspacing="0" width="100%"><tr><td width="20%">[[An Overview of Virtualization Techniques|Previous]]<td align="center">[[Xen hardware virtual machine (HVM) provides support for the virtualization Virtualization Essentials|Table of unmodified guest operating systems. Where ever possible it is better to run paravirtualized guests because Contents]]<td width="20%" align="right">[[Installing and Running Windows XP or Vista as a Xen HVM domainU guests run slightly slower than paravirtualized domainU guests Guest|Next]]</td><tr><td width="20%">An Overview of Virtualization Techniques<td align="center"><td width="20%" align="right">Installing and require that the host system contain a processor type with build in virtualization support. That said, if you need to virtualize an operating system which has not, Running Windows XP or cannot be modified to run Vista as a paravirtualized Xen guest (such as Microsoft Windows) then HVM virtualization is the only solution.domainU Guest</td></table><hr>
== Full Virtualization vs. Para-Virtualization ==
Xen provides two approaches to virtualization - full virtualization and paravirtualization. Full virtualization provides complete abstraction between the hardware and the guest operating system. In this scenario, the guest operating system is provided a complete virtual physical environment in which to run and, as such, is unaware that it is running inside a virtual machine. One advantage of full virtualization is that the operating system does not need to be modified in order to run in a Xen virtualized environment. This means that proprietary operating systems such as Microsoft Windows can be run on Linux systems.<htmlet>xen</htmlet>
Disadvantages of full virtualization are that performance is slightly reduced as compared to paravirtualization and Xen requires CPUs with special virtualization support built in (such as Intel-VT and AMD-V) in order to perform full virtualization.
Paravirtualization requires that a guest operating system be modified to Xen hardware virtual machine (HVM) virtualization provides support for the virtualization. This typically means that of unmodified guest operating systems without the loss of performance inherent in the use of full virtualization (the different types of virtualization are limited to open source systems such as Linux. The advantage to described in the [[An Overview of Virtualization Techniques]] chapter of this approach is that a paravirtualized guest system comes closer to native performance than a fully virtualized guest, and book). In the latest case of host systems containing CPUs with virtualization CPU support is not needed, the HVM approach provides superior levels of performance when compared to full virtualization.
== Checking Hardware Support for Xen Hardware Virtual Machines (HVM) ==
As mentioned previously, in In order to support full hardware virtualization, the CPU must include Intel-VT or AMD-V support. This can be verified using the following commands:
For Intel CPUs:
== Preparing to Install a Xen HVM domainU Guest ==
In order to install a fully virtualized Xen guest some from form of disk storage is needed to contain the installed operating system. This can take the form of a physical disk (such as /dev/sdb) or a disk image file. A suitable disk image file can be created using the ''dd'' command. For example:
<pre>
dd if=/dev/zero of=XenGuest1xenguest.img bs=1024k seek=6144 count=0
</pre>
The above command creates a 6Gb disk image file for use by the Xen HVM domainU guest.
In addition, suitable installation media (such as a DVD or ISO image) will be required from which to install the guest operating system onto the disk image or disk drive.
== Creating a Xen HVM Configuration File ==
The example HVM guest configuration file provided wtih with Xen is as follows:
<pre>
This file provides an excellent template to use as the basis for an HVM domainU guest configuration file. Many of these values can be left unchanged. Some key values which will need to be changed will be discussed in the remainder of this section.
The Firstly, the domainU system needs to be given a suitable name. The ''name = '' filed field should, therefore, be changed accordingly. For example:
<pre>
</pre>
The ''disk = '' line needs to be modified to reflect the required disk and CD/DVDN DVD drive configuration. For example, if you have decided to use a physical disk accessible on the host system as /dev/sdb:
<pre>
</pre>
where ''/dev/cdrom'' is replaced by the device name for the CDROm CDROM/DVD drive on your chosen linux Linux distribution.
Alternatively, if you have chosen to use a disk image instead of a physical disk drive:
<pre>
disk = [ 'file:/home/xen/XenGuestxenguest.img,hda,w', 'phy:/dev/cdrom,hdc:cdrom,r' ]
</pre>
The above examples assume that you will be installing the guest operating system from a CD or DVD drive. It is also possible to perform the installation from an ISO image residing on the filesystem of the host. For example:
<pre>
</pre>
In general Both SDL and VNC work well in terms of displaying a graphical console, although VNC has some distinct advantages over SDL. Firstly, VNC provides greater flexibility than SDL in terms of remote access to the domainU graphical console. With VNC it is possible to connect to the graphical console from other systems, either on the local network or even over the internet. Secondly, when you close a VNC viewer window the guest domain continues to run allowing you to simply reconnect to carry on where you left off. Closing an SDL window, however, immediately terminates the guest domainU system resulting in possible data loss.
By default Xen does not automatically start the VNC console when the domainU guest starts up. In order to have the graphical console spawned automatically, change the ''vncconsole ='' value to 1: <pre>vncconsole=1</pre> Finally, the boot search sequence needs to be defined. Since we have to install the operating system before we canboot can boot from the hard disk drive we need to place the CDROM/DVD first in the boor order:
<pre>
== Booting the HVM Guest ==
The guest system can now be started using the ''xm create'' commandscommand, for example:
<pre>
</pre>
All being well the domainU guest will start and the installation process from the chosen media will begin. Once the installation of the guest operating system has completed be sure with output to reverse the boot order in the configuration file if you no longer wish Xen text console similar to have the CD/DVD drive first in the boot orderfollowing:
<pre>
Using config file "./XenHVMGuest.cfg".
Started domain XenHVMGuest
</pre>
== Connecting to and the HVM dominU Guest Graphical Console ==installation process from the designated media will begin.
== Connecting to the HVM domainU Guest Graphical Console == If SDL was chosen for the graphical console then the console should appear when the guest starts up. if If, on the other hand, VNC was selected it is necessary and the HVM domainU was not configured to connect using automatically start ''vncviewer''it is now necessary to connect manually. By default the VNC port is 5900 + the ID of the domain to which you wish to connect (which can be obtained using the ''xm list'' command). For example, to connect to domain ID 10:
<pre>
vncviewer localhost:5910
</pre>
 
In my experience this is not always the case and the best way to find out which port is being used is to run the following command:
 
<pre>
ps -ef | grep vnc
root 2992 2441 13 14:51 ? 00:00:00 /usr/lib/xen/bin/qemu-dm -d 11 -vcpus 1 -boot cd
-serial pty -acpi -domain-name XenHVMGuest -net nic,vlan=1,macaddr=00:16:3e:2e:10:b0,model=rtl8139
-net tap,vlan=1,bridge=xenbr0 -vnc 127.0.0.1:0 -vncviewer
</pre>
 
As we can see from the above output, the Xen guest named ''XenHVMGuest'' is accessible using 127.0.0.1:0. Using this information we would, therefore, connect as follows:
 
<pre>
vncviewer 127.0.0.1:0
</pre>
 
Once the installation of the guest operating system has completed be sure to reverse the boot order in the configuration file if you no longer wish to have the CD/DVD drive first:
 
<pre>
#-----------------------------------------------------------------------------
# boot on floppy (a), hard disk (c), Network (n) or CD-ROM (d)
# default: hard disk, cd-rom, floppy
boot="cd"
</pre>
 
 
<htmlet>xen</htmlet>
 
 
<hr>
<table border="0" cellspacing="0" width="100%">
<tr>
<td width="20%">[[An Overview of Virtualization Techniques|Previous]]<td align="center">[[Xen Virtualization Essentials|Table of Contents]]<td width="20%" align="right">[[Installing and Running Windows XP or Vista as a Xen HVM domainU Guest|Next]]</td>
<tr>
<td width="20%">An Overview of Virtualization Techniques<td align="center"><td width="20%" align="right">Installing and Running Windows XP or Vista as a Xen HVM domainU Guest</td>
</table>

Navigation menu