Virtualization With Xen On CentOS 6.3 (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.3 DVD (the first one) into your DVD drive, or you download the CentOS 6.3 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.3-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.3-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.3 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.3 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.3-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 Host device eth0 (Bridge 'br0'); 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.3 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-12-01 06:06:56

I found some error:

 make[3]: *** [libvirt_driver_libxl_la-libxl_conf.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.ezXtRF (%build)


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

How can I fix that?

From: miguel at: 2013-01-26 02:44:46

I need help!!!!!

ccc1: warning: unrecognized command line option "-Wno-suggest-attribute=const"

ccc1: warning: unrecognized command line option "-Wno-suggest-attribute=pure"

 make[3]: *** [libvirt_driver_libxl_la-libxl_conf.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10'
make: *** [all] Error 2

 

I do not want to use windows, please!!!!

 

From: at: 2013-01-29 09:57:38

I found the solution. see: http://www.howtoforge.com/forums/showthread.php?t=58994&page=3 [3 Installing Xen] # yum install kernel-xen xen replace to this: # yum install xen-4.1.3-2.el6.x86_64 xen-devel-4.1.3-2.el6.x86_64 xen-libs-4.1.3-2.el6.x86_64 # yum install python-devel xen-devel libxml2-devel xhtml1-dtds readline-devel ncurses-devel libtasn1-devel gnutls-devel augeas libudev-devel libpciaccess-devel yajl-devel sanlock-devel libpcap-devel libnl-devel avahi-devel libselinux-devel cyrus-sasl-devel parted-devel device-mapper-devel numactl-devel libcap-ng-devel netcf-devel libcurl-devel audit-libs-devel systemtap-sdt-devel libblkid-devel scrub replace to this: (exclude xen-devel) # yum install python-devel libxml2-devel xhtml1-dtds readline-devel ncurses-devel libtasn1-devel gnutls-devel augeas libudev-devel libpciaccess-devel yajl-devel sanlock-devel libpcap-devel libnl-devel avahi-devel libselinux-devel cyrus-sasl-devel parted-devel device-mapper-devel numactl-devel libcap-ng-devel netcf-devel libcurl-devel audit-libs-devel systemtap-sdt-devel libblkid-devel scrub

From: Antenor Siles Cano at: 2012-12-04 21:44:47

Estimados  me salen estos errores al querer reconpilar una vez aplicada el patch
 
make[3]: *** [libvirt_driver_libxl_la-libxl_conf.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10'
make: *** [all] Error 2
error: Estado de salida erróneo de /var/tmp/rpm-tmp.X6DDrC (%build)
 
Errores de construcción RPM:
    Estado de salida erróneo de /var/tmp/rpm-tmp.X6DDrC (%build)
 
 
no se a que se debe este problema de espero sus comentarios gracias..!!!

From: Keys2IT at: 2013-01-12 08:23:16

Hello,

getting same problem as you !
Did you manage to find a solution ?

Kind Regards,

Laurent

 

From: Anonymous at: 2012-12-07 15:28:02

http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-3.noarch.rpm -- its 404 url nowadays, looks like http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-4.noarch.rpm is working

From: Ted at: 2013-01-17 05:29:55

I found the same rpmbuild error.

According to the last part of the next forum, we should use xen4.1.

  http://www.howtoforge.com/forums/archive/index.php/t-58994.html

 

When you install xen with yum, please use the next command line:

 yum install xen-4.1.3-2.el6.x86_64 xen-devel-4.1.3-2.el6.x86_64 xen-hypervisor-4.1.3-2.el6.x86_64 xen-libs-4.1.3-2.el6.x86_64 xen-licenses-4.1.3-2.el6.x86_64 lxen-runtime-4.1.3-2.el6.x86_64

From: Matt at: 2013-02-15 16:13:22

Hello,

I was following the outline in this how-to (plus some hints from the comments / peanut gallery, thanks!) and had at least a (successful) build that didn't give me errors except for at bootup when the scsi_wait_scan module was not found.

I've searched the web, and from what I understand it appears as if the scsi controllers with the LVM aren't being loaded in time during bootup and that the kernel doesn't recognize the drive and it's not mounted (or some such thing, not an expert here by any means).

I think I need to add a line somewhere in the kernel build to put in that module, but am unsure how to do it.  Ideas / thoughts / comments?

From: Ted at: 2013-05-31 05:21:55

When you install Xen4.2 on CentOS6.4, you could take another way.

Replace "[3 Installing Xen]" (of this page) to the following commands.


# egrep '(vmx|svm)' --color=always /proc/cpuinfo

# yum install http://au1.mirror.crc.id.au/repo/kernel-xen-release-6-5.noarch.rpm

# yum install kernel-xen xen

# vi /boot/grub/menu.lst

# shutdown -r now

# xm info

# yum install virt-install virt-viewer libvirt python-virtinst virt-manager qemu-kvm

# /etc/init.d/libvirtd start

# echo "/usr/sbin/libvirtd -d" >>/etc/rc.d/rc.local

# xm list
# virsh list

==

I referred to the nice instructions (http://f.dataguru.cn/thread-127204-1-1.html) written by ???.

 

Caution!

After you install Xen4.2, you may encounter a lot of errors. No warranty. You should take a full backup of your server.

From: Anonymous at: 2014-04-02 04:46:32

Thank You for the guide!On the xenproject website it states that the VM manager has to have a windows client installed to control the virtual machines. Clearly, this is not the case!

 I have several questions:

1.Are there any features in the enterprise XEN version with paid support that are not availible with the management tools in linux?

2. What are the advantages of installing XEN on top of a *NIX distrubution? Why wouldnt you just install the premade ISO?

3. Is this type of XEN configuration in this guide, suitable for enterprise deployment provided one is using enterprise grade hardware?

4. Out of all the virtual machine technology availible which do you prefer for enterprise type scnerios?