VPS class=”stripstr”> VPS and configure Xen">On the CentOS install VPS class=”stripstr”> VPS and configure Xen
And then check if Xen has been launched:On the CentOS install and configure Xen
# / Usr / sbin / xm list
Name ID Mem (MiB) VCPUs State Time (s)
Domain-0 0 1220 2 r 鈥斺 4691.3
vm01 9 255 1-b 鈥- 16.9
# Vi / etc / grub.conf
After a successful installation, you can see xen.gz-2.6.18-128.2.1.el5 good core already installed, modify the default values of the default start Xen kernel.
# / Sbin / mkswap ubuntu.9-04.swap
If the Xen kernel is running as a host operating system, then the operating system running on the host above can be seen as guest. First to build a directory used to store all of the guest operating system image, vm01.img, vm02.img, and so on, a guest corresponds to an image.
To see whether to activate the guest:
# Uname-r
2.6.18-128.2.1.el5xen
# / Usr / sbin / xm list
Name ID Mem (MiB) VCPUs State Time (s)
Domain-0 0 1220 2 r 鈥斺 3214.1On the CentOS install and configure Xen
Into the guest
# Virt-install-n vm01-r 256-f / vm/vm01.img-s 4 鈥 nographics-p
-l http://127.0.0.1/centos
Therefore, VPSee intends to own SUN server, using a platform made to donate the Xen server, to each sub-Honours, a virtual system, saving their own virtual machine loaded the time and resources, VPSee become a free Xen VPS provider: the ). SUN servers running 16 instances of Xen virtual system, each equipped with 256 MB RAM, 4GB hard drive, not open GUI. The following installation steps and configuration process is based on CentOS 5.3 version, Ubuntu version may refer to: In the Ubuntu install and configure Xen.
Install Xen
If it is from http://stacklet.com/ download operating system images, may not be set up swap, need to add the swap partition, you can be a swap image file as a swap partition to use. Xen and OpenVZ is that Xen has its advantages compared to can have their own swap partition, and even guest can set their own swap. First to build a 512MB (524288B, 1GB = 1048576B) the size of the file into a swap format:
# Cat / etc/xen/vm01
name = 鈥渧m01鈥
uuid = 鈥渂4910b6d-b205-6f86-c145-3c0895cb20c5鈥
maxmem = 256
memory = 256
vcpus = 1
bootloader = 鈥/ usr / bin / pygrub鈥
on_poweroff = 鈥渄estroy鈥
on_reboot = 鈥渞estart鈥
on_crash = 鈥渞estart鈥
vfb = []
disk = [ "tap: aio: / vm/vm01.img, xvda, w"]
vif = [ "mac = 00:16: d2: 0a: 66:6 d, bridge = xenbr0"]
# Shutdown-r now
If you want to start automatically every time you start host when guest鈥檚 words:
Or you can simplify the above into a command:
Common Xen command
# Vi / etc / fstab
/ dev/sda2 swap swap defaults, noatime 0 0
Now labs are equipped with a Taiwan Masters, and a laptop PC, but only to Honours with a Taiwan PC, 1 machine very easy to do the project, development is often used in multi-system, such as some people do is to VoIP phones related projects, mobile client interface to Windows platform to do, VoIP server to use to Linux, so use a Linux virtual machine virtual out, if they are running on a single physical machine will be very slow. Now configure the PC to the Honours only 1G of memory, if you are running Windows + mobile emulator + Elipse IDE (needs Java) + VMware (VMware on a rerun a Linux + Asterisk + MySQL), and then open a client of incoming mail, open a few a browser, viewing the information would be very difficult.
After the reboot the system to check whether the Xen kernel:
$ Yum install kernel-xen xen
CentOS installation process is completed in accordance with CentOS operating system (guest) of the installation, take a look at guest鈥檚 configuration file:
Note that the above if-p (paravirtualized), then can not be installed directly from the iso file must be iso file Xie came out into a http / ftp server to install, only the fully virtualized from the iso file can, CD 鈥 ROM, etc. to install. Should also be noted that, paravirtualized ever need to modify the operating system kernel, it can not install Windows, fully virtualized can be used to install Windows as long as the CPU supports Virtualization (Intel VT or AMD V). So here need to install and configure a web server, and then extract the iso file to a web server can access the directory (http://127.0.0.1/centos). If the speed fast enough, you can install from the Internet directly to http://127.0.0.1/centos replaced http://mirrors.kernel.org/centos/5.3/os/i386
Modify / etc/xen/ubuntu.9-04, modify the disk in this line:
# Dd if = / dev / zero of = ubuntu.9-04.swap bs = 1024 count = 524288
Creating and installing guest
default = 0
timeout = 2
splashimage = (hd0, 0) / grub / splash.xpm.gz
hiddenmenu
title CentOS (2.6.18-128.2.1.el5xen)
root (hd0, 0)
kernel / xen.gz-2.6.18-128.2.1.el5
module / vmlinuz-2.6.18-128.2.1.el5xen ro root = / dev/VolGroup00/LogVol00
module / initrd-2.6.18-128.2.1.el5xen.img
title CentOS (2.6.18-128.1.16.el5)
root (hd0, 0)
kernel / vmlinuz-2.6.18-128.1.16.el5 ro root = / dev/VolGroup00/LogVol00
initrd / initrd-2.6.18-128.1.16.el5.img
# Virt-install
A more lazy approach to
If you want to quit guest, then use Ctrl +], will return to host.
# / Usr / sbin / xm create-f ubuntu.9-04.cfg
# / Usr / sbin / xm list
# / Usr / sbin / xm console ubuntu.9-04
# Ln-s / etc/xen/vm01 / etc / xen / auto
Http://stacklet.com/ downloaded image file from the initial user name and password: root / password
Increase swap
Start the guest system, modify your / etc / fstab, reboot with the top to see Swap partitions have been activated:
Guest can log on after the installation is successful, and
# Wget http://stacklet.com/sites/default/files/ubuntu/
ubuntu.9-04.x86.20090514.img.tar.bz2
# Top
鈥
Mem: 262284k total, 46480k used, 215804k free, 3176k buffers
Swap: 524280k total, 0k used, 524280k free, 17196k cached
xm create-c / path / to / config 鈥 Start a virtual machine.
xm shutdown 鈥 Stop a virtual machine.
xm destroy 鈥 Stop a virtual machine immediately without shutting it down. It鈥檚 as if you switch off the power button.
xm list 鈥 List all running systems.
xm console 鈥 Log in on a virtual machine.
xm help 鈥 List of all commands.
# Vi / etc/xen/ubuntu.9-04.cfg
disk = [ 'file: / vm/ubuntu.9-04.img, sda1, w', 'file: / vm/ubuntu.9-04.swap, sda2, w']
# Tar jxvf ubuntu.9-04.x86.20090514.img.tar.bz2
# Mv ubuntu.9-04.x86.xen3.pygrub.cfg / etc/xen/ubuntu.9-04.cfg
# Mv ubuntu.9-04.x86.img / vm/ubuntu.9-04.img
What is the name of your virtual machine? <- Vm01
How much RAM should be allocated (in megabytes)? <- 256
What would you like to use as the disk (path)? <- / Vm/vm01.img
How large would you like the disk (/ vm/vm01.img) to be (in gigabytes)? <- 4
Would you like to enable graphics support? (Yes or no) <- no
What is the install location? <- Http://127.0.0.1/centos
Installing guest operating system if they feel too much trouble, can go to download an already packed http://stacklet.com/ image file, and then in the host to start the guest image on it. Download and start Ubuntu 9.04 mirror:
Installation support Xen Linux kernel and Xen:
# Mkdir / vm
# Cd / vm
# / Usr / sbin / xm console vm01
Article Source : On the CentOS install and configure Xen
On the CentOS install and configure XenOn the CentOS install VPS and configure Xen