Document 6510212

Transcription

Document 6510212
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
1z8
Home
About
Forum
Howtos & FAQs
Shell Scripts
Tutorials
RSS Subscribe
nixcraft - insight into linux admin work
How to: Install and Setup XEN Virtualization
Software on CentOS Linux 5
by Vivek Gite · 10 comments
One of our regular reader asks:
I'm using CentOS Linux 5 server. How do I set up Xen on Linux ? How do I install
guest VPS oses such as Fedora or Windows 2000 or Debian Linux inside XEN?
Xen is a free open source software virtual machine monitor for Intel / PowerPC architectures. It is software
that runs on a host operating system and allows several guest operating systems to be run on top of the host
on the same computer hardware at the same time (just like VM Ware software). Luckily Installing and
managing XEN is quite easy under CentOS 5 Linux.
Login as the root and type the following commands:
# yum install xen virt-manager kernel-xen
# chkconfig xend on
# reboot
M ake sure you boot CentOS server using XEN kernel.
How do I install NetBSD / any Linux distro / Windows 2000 inside
XEN?
Simply use gui tool called virt-manager:
# virt-manager &
2009-12-03 11:26
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
2z8
Now just follow on screen instructions to setup new guest operating systems (VPS oses). virt-manager is Xen
M anagement Consoles software. It can perform the common tasks of administering a Xen host such as
configuring, starting, monitoring and stopping of Xen guests oses. Please note that above instructions also
works on
RHEL 5
Fedora Linux 7
Installing CentOS 5.3 guest using the Internet
virt-install is a command line tool for provisioning new virtual machines using the "libvirt" hypervisor
management library. Type the following command to install CentOS v5.3 64 bit as guest operating system in
/vm:
# mkdir /vm
If you are using SELinux, enter:
# semanage fcontext -a -t xen_image_t "/vm(/.*)?"
# restorecon -R /vm
# ls -dZ /vm
Above will provide security context of Xen images. Finally, install CentOS 5.3 using the Internet mirror:
# virt-install \
--paravirt \
--name webserver01 \
--ram 512 \
--file /vm/webserver.nixcraft.com.img \
--file-size 10 \
--nographics \
--location http://mirrors.kernel.org/centos/5.3/os/x86_64/
Above will CentOS as a paravirtualized Xen guest, with 512 M B of RAM , a 10 GB of disk, and from a web
server, in text-only mode. You need to just follow on screen instructions.
2009-12-03 11:26
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
3z8
(CentOS XEN Guest Installation in a text mode over ssh session)
Once installed you can use xm command to list, start, stop and manage xen vps:
# xen list
Attach console to domain / guest called webserver01:
# xm console webserver01
See xm command cheat sheet.
Installing CentOS 5.3 guest using DVD
Install a CentOS guest, using LVM partition, virtual networking, booting from the host CDROM , using VNC
server/viewer (insert DVD into drive):
# virt-install \
--connect qemu:///system \
--name mailserver
--ram 500 \
--file /dev/HostVG/mailserver.cyberciti.biz \
--network network:default \
--accelerate \
--vnc \
--cdrom /dev/cdrom
Note you need qemu and virt-viewer installed on the host system.
Installing Fedora guest using DVD iso image stored on hard disk
2009-12-03 11:26
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
4z8
Install a Fedora Linux, with a real partition (/dev/sdc), using a local DVD ISO image:
# virt-install \
--name www2 \
--ram 1000 \
--file /dev/sdc \
--network bridge:eth1 \
--cdrom /tmp/fedorabootdvd.iso
Further readings:
man page virt-install and xm
XEN project
Virtual M achine M anager project
Enomalism project
ConVirt project
Featured Articles:
20 Linux System M onitoring Tools Every SysAdmin Should Know
20 Linux Server Hardening Security Tips
M y 10 UNIX Command Line M istakes
Top 5 Email Client For Linux, M ac OS X, and Windows Users
Top 20 OpenSSH Server Best Security Practices
Top 10 Open Source Web-Based Project M anagement Software
Top 5 Linux Video Editor Software
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily
email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!
[email protected]
Subscribe
Email this to a friend
Download PDF version
Printable version
Comment RSS feed
Last Updated: M ay/15/2009
{ 10 comments… read them below or add one }
1 Artem Nosulchik 10.18.07 at 8:14 pm
Nice one! Is it necessary to enable any additional yum repositories in CentOS 5 in order to install xen,
virt-manager and kernel-xen packages?
2009-12-03 11:26
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
5z8
2 vivek 10.18.07 at 8:38 pm
Noop, you can install from DVD or just download and install using yum.
3 raj 10.23.07 at 1:27 pm
Really easy, thanks for all info :)
4 Scott 01.09.08 at 8:38 pm
“Now just follow on screen instructions to setup new guest operating systems (VPS oses). ”
You’re kidding, right? How unfortunate this topic got indexed in Google, because here’s what gets
glossed over:
Try installing a VM from a regular DVD. Go ahead. Please.
Under Install M edia URL, I’ve tried
/media/Fedora 8 x86_64 DVD
/media/Fedora8 (which I ln -s to ‘Fredora 8 x86_64 DVD’)
file:///media/Fedora8
/dev/scd0 (the DVD device)
/dev/scd0 does spin the drive, but then vaguely complains it can not find what it needs…
It appears you
OK, pop in a Fedora 8 DVD
5 vivek 01.10.08 at 4:11 am
Scott,
I’m sorry to hear it didn’t work out for you. These instructions are only tested on CentOS 5.0 and
Fedora 7. I’ve already mentioned the fact.
6 nevyn 01.20.08 at 4:02 am
What would have been helpful is if you had:
a) included more information than “follow on screen instructions” such as a idea what sort of
information we should be putting in a particular field. For example, if I wanted to install ubuntu-server,
2009-12-03 11:26
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
6z8
what would the URL be?
b) Included the instructions for installing off local media – as far as I know, you can’t install directly off
dvd or cd but can off nfs so if you export the cd/dvd via nfs and then use the url for the nfs share you’d
be sweet.
7 quequotion 11.14.08 at 11:54 am
this is a really poor and incomplete guide.
first of all, it only works for those lucky few who get to use a graphical interface. professionals in the
field, who must conserve resources and minimize infrastructure, have absolutely no use for
virt-manager.
second… there simply has to be more to it.
8 Piyush 12.24.08 at 12:31 pm
Vivek, Can you please add stuff like:
Installation of XEN on non GUI system (with virt-console may be….)
How to create a VM and change resources .. etc…
Would be helpful ……….
Thanks in Adv!
- Piyush
9 Avalon 05.20.09 at 3:25 pm
Nice howto. M aybe not very thorough but gives an idea what to look for ( for noobs like me :)
wrt professionals with no gui… go read the source hackers ;p
10 Avalon 05.20.09 at 3:35 pm
(sorry for double posting)
Let me give you a hint though – vnc
Leave a Comment
Name *
2009-12-03 11:26
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
7z8
E-mail *
You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b>
<blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Notify me of followup comments via e-mail.
Submit
Tagged as: centos 5.3 xen gui, centos linux, centos virtualization howto, centos xen, centos xen howto, Debian Linux, guest
operating systems, how to configure xen on fedora, install centos virtualization, install xen on centos, open source software,
powerpc architectures, virtual machine, virtual machine manager, virtualization, VPS, xen, xen centos, xen centos howto, yum
install xen
Previous post: Ubuntu Linux: Turn on 3D Compiz Eye Candy Effects for the X Window System
Next post: Install PHP Pear M ail / SM TP package on CentOS / Red Hat Enterprise Linux
Sign up for our daily email newsletter:
[email protected]
Sign up
Search
Related Posts
How to: Upgrade Red Hat Enterprise Linux (RHEL) to latest Releases 5.1
nixCraft FAQ Roundup
Lighttpd / Apache : Run Xcache in Chrooted Jail
Select category
Take Our Software Asset Poll
2009-12-03 11:26
How to: Install and Setup XEN Virtualization Software on CentOS Linux 5 http://www.cyberciti.biz/tips/rhel-centos-xen-virtualization-installation-h...
8z8
Sponsored Links
Unified Communications:
Thoughts, Strategies and Predictions Join the discussion.
www.seamlessenterprise.com
IP Convergence
Integrate your wireless and wireline networks.
Learn how from the experts at Sprint.
www.seamlessenterprise.com
Wireless & Wireline Integration
Thoughts, strategies and solutions: join the discussion
www.seamlessenterprise.com
Unified Communications 2009
Join the Discussion. Now.
www.seamlessenterprise.com
See your text ad here
Follow us on
©2004-2009 nixCraft. All rights reserved | Privacy Policy | Terms of Service
Advertise | Questions or Comments | Sitemap
2009-12-03 11:26