Thomas Vogt’s IT Blog

knowledge is power …

Xen Guest (DomU) Installation

OS: RedHat Enterprise Linux 5 (RHEL5), should also work on CentOS and Fedora.

There are a few methodes to install a Xen Guest (DomU). In my experience the easiest and smoothest way for such an installation is to use the virt-install script, which is installed by default on RedHat Linux systems.

Xen Packages

First of all, we have to install the Xen Virtualization packages (kernel-xen-devel is optional, but for example needed by HP ProLiant Supprt Pack (PSP)).

# yum install rhn-virtualization-common rhn-virtualization-host kernel-xen-devel virt-manager

On CentOS and Fedora:

# yum groupinstall Virtualization

After that a reboot for loading the Xen kernel is needed.

Guest Installation with virt-install

In the following example the Xen Guest installation is made with a kickstart config file. The kickstart file and the OS binaries are on a provisioning server (cobbler) and reachable over the http protocol.

# virt-install -x ks=http://lungo.pool/cblr/kickstarts/rhel51-x86_64_smbxen/ks.cfg

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? smbxen

 How much RAM should be allocated (in megabytes)? 1024

 What would you like to use as the disk (path)? /dev/vg_xen/lv_smbxen

 Would you like to enable graphics support? (yes or no) yes

 What is the install location? http://lungo.pool/cblr/links/rhel51-x86_64/   

Starting install...

Retrieving Server...                                            651 kB 00:00

Retrieving vmlinuz...     100% |=========================| 1.8 MB    00:00

Retrieving initrd.img...  100% |=========================| 5.2 MB    00:00

Creating domain...                                                 0 B 00:00

VNC Viewer Free Edition 4.1.2 for X - built Jan 15 2007 10:33:11

At this point a regular RedHat OS installation (graphical installer) starts.

To automatically run the guest after a system (Dom0) reboot, we have to create the following link:

# ln -s /etc/xen/[guest_name] /etc/xen/auto/


We can manage the Xen Guest with xm commands, virsh commands or virt-manager.

Virt-Manager

# virt-manager

virt-manager


xm commands

List Domains (Xen Guests)

# xm list

Start a Guest

# xm create [guest-config]

Connect to a guest console ( Back: ESC-] (US-keyboard), Ctrl-5 (German keyboard))

# xm console [guest_name]

Shutdown a guest

# xm shutdown [guest_name]

Destroy (Power off) a guest

# xm destroy [guest_name]

Monitor guests

# xm top


virsh commands

# virsh
virsh # help 

Commands:

    autostart       autostart a domain
    capabilities    capabilities
    connect         (re)connect to hypervisor
    console         connect to the guest console
    create          create a domain from an XML file
    start           start a (previously defined) inactive domain
    destroy         destroy a domain
    define          define (but don't start) a domain from an XML file
    domid           convert a domain name or UUID to domain id
    domuuid         convert a domain name or id to domain UUID
    dominfo         domain information
    domname         convert a domain id or UUID to domain name
    domstate        domain state
    dumpxml         domain information in XML
    help            print help
    list            list domains
    net-autostart   autostart a network
    net-create      create a network from an XML file
    net-define      define (but don't start) a network from an XML file
    net-destroy     destroy a network
    net-dumpxml     network information in XML
    net-list        list networks
    net-name        convert a network UUID to network name
    net-start       start a (previously defined) inactive network
    net-undefine    undefine an inactive network
    net-uuid        convert a network name to network UUID
    nodeinfo        node information
    quit            quit this interactive terminal
    reboot          reboot a domain
    restore         restore a domain from a saved state in a file
    resume          resume a domain
    save            save a domain state to a file
    schedinfo       show/set scheduler parameters
    dump            dump the core of a domain to a file for analysis
    shutdown        gracefully shutdown a domain
    setmem          change memory allocation
    setmaxmem       change maximum memory limit
    setvcpus        change number of virtual CPUs
    suspend         suspend a domain
    undefine        undefine an inactive domain
    vcpuinfo        domain vcpu information
    vcpupin         control domain vcpu affinity
    version         show version
    vncdisplay      vnc display
    attach-device   attach device from an XML file
    detach-device   detach device from an XML file
    attach-interface attach network interface
    detach-interface detach network interface
    attach-disk     attach disk device
    detach-disk     detach disk device

Exp.: Start a guest with virsh

# virsh start [guest_name]
About these ads

March 31, 2008 - Posted by | Linux, RedHat, Virtualization, Xen

10 Comments »

  1. Hi! I was surfing and found your blog post… nice! I love your blog. :) Cheers! Sandra. R.

    Comment by sandrar | September 10, 2009 | Reply

  2. Sir,
    this is good but I have the following problem:
    i want to create a guest domain in xen with centos using configuration file but installation files are dumped in a remote machine. How is it possibl? Using virt-install i have done this but not using configuration script.
    Please reply.

    Comment by Durga Prasad Sahoo | May 14, 2010 | Reply

  3. information technology is increasing these days, most jobs are also related to information technology ”:

    Comment by Track Jacket | December 2, 2010 | Reply

  4. The other day, while I was at work, my cousin stole my iphone and tested to see if it can
    survive a 40 foot drop, just so she can be a youtube sensation.

    My apple ipad is now broken and she has 83 views. I know this is completely off topic but I had to share
    it with someone!

    Comment by bed bug control | April 18, 2013 | Reply

  5. Nurses in the neonatal intensive care unit (NICU) are amongst
    the highly trained nurses you could ever find. Kate Middleton spent three
    nights at King Edward VII Hospital in London where she was
    treated for acute morning sickness. This 8 month fast track program is the quickest way to become a
    registered nurse.

    Comment by friendster | May 9, 2013 | Reply

  6. There’s certainly a lot to learn about this issue. I like all of the points you made.

    Comment by Russel | June 2, 2013 | Reply

  7. Hi to every body, it’s my first pay a visit of this blog; this weblog consists of amazing and really excellent material for readers.

    Comment by waldokqrv.soup.io | August 13, 2013 | Reply

  8. I’ve learn some good stuff here. Definitely price bookmarking for revisiting. I surprise how much attempt you put to create this kind of wonderful informative site.

    Comment by Hubert | August 14, 2013 | Reply

  9. hi!,I really like your writing very so much! percentage we be in contact more about your post on AOL?

    I need an expert on this house to unravel my problem.
    Maybe that is you! Having a look ahead to see you.

    Comment by Quincy | August 16, 2013 | Reply

  10. Ahaa, its good dialogue regarding this paragraph here at this website, I have read all that, so now me also
    commenting here.

    Comment by hosting company | August 25, 2013 | Reply


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: