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 VMWare 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
Make 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 &
Now just follow on screen instructions to setup new guest operating systems (VPS oses). virt-manager is Xen Management 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 \
--name webserver01 \
--ram 512 \
--file /vm/webserver.nixcraft.com.img \
--file-size 10 \
Above will CentOS as a paravirtualized Xen guest, with 512 MB of RAM, a 10 GB of disk, and from a web server, in text-only mode. You need to just follow on screen instructions.
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 \
--ram 500 \
--file /dev/HostVG/mailserver.cyberciti.biz \
--network network:default \
Note you need qemu and virt-viewer installed on the host system.
Installing Fedora guest using DVD iso image stored on hard disk
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 \
- man page virt-install and xm
- XEN project
- Virtual Machine Manager project
- Enomalism project
- ConVirt project
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop