Virtualization With Xen On CentOS 6.3 (x86_64) (Paravirtualization & Hardware Virtualization) - Page 3

4.3 Using virt-manager To Create & Manage Virtual Machines

Instead of using VNC or a text-based installer, we can use virt-manager on a Linux desktop to create and manage virtual machines. In this example, I'm using a Fedora 17 desktop.

Initialize a new VM on the CentOS 6.3 host (in this example, it's vm06):

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

The --vnc --noautoconsole parameters are important - they allow us to connect to the installer with virt-manager.

[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.

<-- no
What is the name of your virtual machine?
<-- vm06
How much RAM should be allocated (in megabytes)?
<-- 1024
What would you like to use as the disk (file path)?
<-- /var/lib/libvirt/images/vm06.img
How large would you like the disk (/var/lib/libvirt/images/vm06.img) to be (in gigabytes)?
<-- 10
What is the install URL?
<-- http://ftp.tu-chemnitz.de/pub/linux/centos/6.3/os/x86_64

Starting install...
Retrieving file .treeinfo... | 798 B 00:00 ...
Retrieving file vmlinuz... | 7.5 MB 00:01 ...
Retrieving file initrd.img... | 59 MB 00:10 ...
Allocating 'vm06.img' | 10 GB 00:00
Creating domain... | 0 B 00:01
Domain installation still in progress. You can reconnect to
the console to complete the installation process.
[root@server1 ~]#

As you see the command returns to the prompt, so we must use virt-manager now to complete the VM installation.

You can install virt-manager as follows on a Fedora 17 desktop - open a terminal and become root:

su

Then install virt-manager:

yum install virt-manager openssh-askpass

Go to Applications > System Tools > Virtual Machine Manager to start virt-manager:

Type in your password:

When you start virt-manager for the first time, you will most likely see the message Packages required for KVM usage. You can ignore this because we don't want to connect to the local libvirt daemon, but to the one on our CentOS 6.3 Xen host. Click on No... and go to File > Add Connection... to connect to our CentOS 6.3 Xen host:

Select Xen as Hypervisor, then check Connect to remote host, select SSH in the Method drop-down menu, type in root as the Username and the hostname (server1.example.com) or IP address (192.168.0.100) of the CentOS 6.3 Xen host in the Hostname field. Then click on Connect:

If this is the first connection to the remote Xen server, you must type in yes and click on OK:

Afterwards type in the root password of the CentOS 6.3 Xen host:

You should see vm06 as running. Mark that guest and click on the Open button to open the graphical console of the guest:

Type in the root password of the Xen host again:

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. Please note that at the end of the installation, the CentOS guest needs a reboot. The guest will then stop, so you need to start it again, either with virt-manager or like this on our CentOS 6.3 Xen host command line:

CentOS 6.3 Xen Host:

virsh start vm06

Afterwards, you can connect to the guest again with virt-manager and configure the guest. If you install OpenSSH in the guest, you can connect to it with an SSH client (such as PuTTY).

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?