Virtualization With Xen On CentOS 6.2 (x86_64) (Paravirtualization & Hardware Virtualization) - Page 4

5 Full Virtualization (Hardware Virtualization)

The process for creating a fully virtualized guest is not that much different from that for creating a paravirtualized guest, except that for full virtualization, you need virt-manager (installation cannot be completed on the command line) and installation media (CD/DVD or an .iso image).

 

5.1 Creating A Fully Virtualized Guest On The Command Line

Because we need installation media, you can now either put your CentOS 6.2 DVD (the first one) into your DVD drive, or you download the CentOS 6.2 iso file and put it in the /var/lib/libvirt/images/ directory (it must be in the /var/lib/libvirt/images/ directory because later on I will show how to create virtual machines through virt-manager from your Fedora desktop, and virt-manager will look for ISO images in the /var/lib/libvirt/images/ directory). IT is also possible to create an iso file from the DVD as follows:

dd if=/dev/cdrom of=/var/lib/libvirt/images/CentOS-6.2-x86_64-bin-DVD1.iso

The guest installation can be started as follows:

virt-install --prompt --network bridge=br0 --virt-type=xen --vnc --noautoconsole

[root@server1 ~]# virt-install --prompt --network bridge=br0 --virt-type=xen --vnc --noautoconsole
Would you like a fully virtualized guest (yes or no)? This will allow you to run unmodified operating systems.

<-- yes
What is the name of your virtual machine?
<-- vm03
How much RAM should be allocated (in megabytes)?
<-- 1024
What would you like to use as the disk (file path)?
<-- /var/lib/libvirt/images/vm03.img (you can as well specify a logical volume here, see chapter 4.2)
How large would you like the disk (/var/lib/libvirt/images/vm03.img) to be (in gigabytes)?
<-- 10
What is the install CD-ROM/ISO or URL?
<-- /dev/cdrom (you can also specify an iso file here, e.g. /var/lib/libvirt/images/CentOS-6.2-x86_64-bin-DVD1.iso)

Starting install...
Creating domain... | 0 B 00:01
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
[root@server1 ~]#

That's it! Now you must open virt-manager and complete the guest installation, as shown in chapter 4.3.

 

5.2 Creating A CentOS 6.2 Guest (Image-Based) From The Desktop With virt-manager

Instead of creating a virtual machine from the command line, you can as well create it from the Fedora desktop using virt-manager (of course, the virtual machine will be created on the CentOS 6.2 Xen host - in case you ask yourself if virt-manager is able to create virtual machines on remote systems).

(I have tried this for a paravirtualized guest as well, but got an error after initrd.img got loaded - therefore this chapter is only for fully-virtualized guests.)

To do this, click on the following button:

The New VM dialogue comes up. Fill in a name for the VM (e.g. vm07), select Local install media (ISO image or CDROM), and click on Forward:

Next check Use ISO image and click on the Browse... button:

Select the CentOS-6.2-x86_64-bin-DVD1.iso image and click on Choose Volume:

Now select Linux in the OS type drop-down menu and RedHat Enterprise Linux 6 in the Version drop-down menu, then click on Forward:

Assign memory and the number of CPUs to the virtual machine and click on Forward:

Now we come to the storage. Check Enable storage for this virtual machine, select Create a disk image on the computer's hard drive, specify the size of the hard drive (e.g. 10GB), and check Allocate entire disk now. Then click on Forward:

Now we come to the last step of the New VM dialogue. Go to the Advanced options section. Select Specify shared device name and then specify br0 in the Bridge name field; that is the name of the bridge which we created in chapter 2. Click on Finish afterwards:

The disk image for the VM is now being created:

Afterwards, the VM will start. Type in the root password of the CentOS 6.2 Xen host:

You should now be connected to the graphical console of the guest and see the CentOS installer:

Now install CentOS as you would normally do on a physical system.

Share this page:

10 Comment(s)

Add comment

Comments

From: Anonymous at: 2012-04-11 04:44:49

Fantastic write up! Thanks.

From: Anonymous at: 2013-01-14 15:30:20

Hey I am trying to get libvirt to install on CentOS 6.3 ... but when I am building I get the following errors ....

 checking for LIBXML... no
checking libxml2 xml2-config >= 2.6.0 ... configure: error: Could not find libxml2 anywhere (see config.log for details).
error: Bad exit status from /var/tmp/rpm-tmp.BotBuI (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.BotBuI (%build)

 

From: Anonymous at: 2014-06-29 18:45:05

Transaction Check Error:
  file /lib/firmware/amd-ucode/microcode_amd.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package microcode_ctl-1:1.17-17.el6.x86_64
  file /lib/firmware/amd-ucode/microcode_amd_fam15h.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package microcode_ctl-1:1.17-17.el6.x86_64
  file /lib/firmware/radeon/ARUBA_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/BTC_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/CAYMAN_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/CEDAR_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/CYPRESS_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/JUNIPER_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/PITCAIRN_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/R700_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/REDWOOD_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/SUMO_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/TAHITI_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/VERDE_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch

Error Summary
Lot of errors ... :(
 

From: Cutup at: 2014-07-14 09:17:32

hi

i have problem to this..

my machine installed CENTOS 6.5(Final)

I want to install xen on kernel 2.6.32-431.el6

but insert in to terminal that command

yum -y install xen kernel-xen

it is not installed with this error.  

Transaction Check Error:
  file /lib/firmware/amd-ucode/microcode_amd.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package microcode_ctl-1:1.17-17.el6.x86_64
  file /lib/firmware/amd-ucode/microcode_amd_fam15h.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package microcode_ctl-1:1.17-17.el6.x86_64
  file /lib/firmware/radeon/ARUBA_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/BTC_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/CAYMAN_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/CEDAR_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/CYPRESS_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/JUNIPER_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/PITCAIRN_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/R700_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/REDWOOD_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/SUMO_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/TAHITI_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch
  file /lib/firmware/radeon/VERDE_rlc.bin from install of kernel-xen-firmware-3.14.9-1.el6xen.x86_64 conflicts with file from package xorg-x11-drv-ati-firmware-7.1.0-3.el6.noarch

Error Summary
 
=
 
please anyone tell me how to solve this problem
 

From: Niall Gowanlock at: 2014-07-29 09:46:15

I found removing the conflicting packages got me passed this e.g.  

yum remove xorg-x11-drv-ati-firmware.noarch

to find the conflicting packages do 

yum list installed | more

Reboot to ensure nothings broken, then re-run the installer.  

This got me installed on Cent os 6.5 but I had problem's on boot after installation but that appears to be a separate issue.

From: Anonymous at: 2012-04-19 04:51:38

This actually worked wonderfully! Now running CentOS 6.2 64-bit with Xend!!! Sweet!

From: at: 2012-05-03 19:59:54

First, at yum install kernel-xen xen I've found the error:

GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY


As pointed by Jordan, the solution is, before installing the xen-kernel, run:

cd /etc/pki/rpm-gpg/ wget http://www.crc.id.au/repo/RPM-GPG-KEY-kernel-xen


that done, you may resume with yum install kernel-xen xen.


Second, at my install, rpmbuild -bb libvirt.spec exploded with something like:

======================================= 1 of 59 tests failed (2 tests were not run) Please report to libvir-list@redhat.com ======================================= make[1]: *** [check-TESTS] Error 1 make[1]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.4/tests' make: *** [check-am] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.3Yorik (%check) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.3Yorik (%check)


scrolling back, I've found the problem at:

TEST: xencapstest ..!.!.!.!. 10 FAIL FAIL: xencapstest


after some googling and discarting possible causes like this, I decide to adopt a daredevilish path... ;-)
(if someone could point another way to deal with it, I'll like to hear)

cd /root/rpmbuild/SOURCES tar xzvf libvirt-0.9.4.tar.gz vim libvirt-0.9.4/tests/xencapstest.c


and change, starting from line 182, the return values of the four tests for 'Capabilities for ia64'. So, the lines change from something like:

    if (virtTestRun("Capabilities for ia64 ... NULL) != 0)        ret = -1;

to

    if (virtTestRun("Capabilities for ia64 ... NULL) != 0)        ret = 0;


that done, write, quit, repackage the modified source code...

tar czvf libvirt-0.9.4.tar.gz libvirt-0.9.4 rm -rf libvirt-0.9.4


... and run the libvirt rebuild again.

cd /root/rpmbuild/SPECS rpmbuild -bb libvirt.spec

From: Yavor Marinov at: 2012-05-06 23:05:25

Thanks for the great article! 

I think we must download the latest src.rpm from 'updates' directory: 

 wget http://vault.centos.org/6.2/updates/Source/SPackages/libvirt-0.9.4-23.el6_2.8.src.rpm

later, this action fails: 

rpm -Uvh --force libvirt-0.9.4-23.el6.x86_64.rpm libvirt-client-0.9.4-23.el6.x86_64.rpm libvirt-python-0.9.4-23.el6.x86_64.rpm

'cuz we have dependency witch can't be resolved. must add '--nodeps' 

From: libaoyin at: 2012-05-15 08:28:17

There is some errors while I complete all steps and reboot. 1. start xend and xendstored service while reboot. 2.There is some message like below wile run "xm list": Error: Unable to connect to xend: No such file or directory. Is xend running? What's wrong with that?

From: Sunny at: 2012-07-01 03:19:44

You should install qemu-kvm package.