All for Joomla All for Webmasters

Xen Installation on Linux | Create Guest Operating Systems


Xen Installation

Xen lets you create guest operating systems, so called “virtual machines” or domUs, under a host operating system (dom0). Using Xen you can separate your applications into different virtual machines that are totally independent from each other e.g. a virtual machine for a mail server, a virtual machine for a high-traffic web site, another virtual machine that serves your customers’ web sites, a virtual machine for DNS, etc., but still use the same hardware. This saves money, and what is even more important, it’s more secure. If the virtual machine of your DNS server gets hacked, it has no effect on your other virtual machines. Plus, you can move virtual machines from one Xen server to the next one.

To install Xen, simply run,

# yum install kernel-xen xen virt-manager -y

Before rebooting the system with the Xen kernel, we must tell the boot loader GRUB about it.

# vim /boot/grub/menu.lst

Then change the value of default=1 to default=0.

Save and exit the file.

Now reboot your system,

# reboot

The system should now automatically boot the new Xen kernel. After the system has booted, we can check that by running

# uname -r

2.6.18-8.1.4.el5xen

Run xm list to check if Xen has started. It should list Domain-0 (dom0):

# xm list

Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 400 2 r—–
80.0
Don’t Miss to Read

SQUID – Installation on CentOS, Fedora and Red Hat

Run virt-manager and follow steps to install DomU on host OS. Before installation, it will ask few questions like:

  1. What is the name of your virtual machine? <– vm1
  2. How much RAM should be allocated (in megabytes)? <– 256
  3. What would you like to use as the disk (path)? <– /vm/vm1.img
  4. How large would you like the disk (/vm/vm1.img) to be (in gigabytes)? <– 5
  5. Would you like to enable graphics support? (yes or no) <– no
  6. What is the install location?

After the installation, we stay at the vm1 console. To leave it, type CTRL+]. virt-install has created the vm1 configuration file /etc/xen/vm1 for us (in dom0). It should look like this:

# cat /etc/xen/vm1

# Automatically generated xen config file
name = “vm1″
memory = “256″
disk = [ ‘tap:aio:/vm/vm1.img,xvda,w’, ]
vif = [ ‘mac=00:AA:3C:B3:e4:86, bridge=xenbr0’, ]
uuid = “5Bbfedf1-dc36-421e-68cc-147c1cb8nd9e”
bootloader=”/usr/bin/pygrub”
vcpus=1
on_reboot = ‘restart’
on_crash = ‘restart’

# xm list

Name ID Mem(MiB) VCPUs State Time(s)
Domain-0 0 259 2 r—– 1806.2
vm1 3 255 1 -b—- 137.9

To shut down vm01, do this:

# xm shutdown vm1

To start vm1 again, run

# xm create /etc/xen/vm1

If you want vm01 to start automatically at the next boot of the system, then do this:

# ln -s /etc/xen/vm1 /etc/xen/auto

Xen Installation on Linux | Create Guest Operating Systems

log in

Become a part of our community!

reset password

Back to
log in
Choose A Format
Personality quiz
Trivia quiz
Poll
Story
List
Meme
Video
Audio
Image