Rapid deployment of Xen on Ubuntu

Source: Internet
Author: User
The promise given by the previous CentOS rapid deployment of Xen (see http://www.linuxidc.com/Linux/2012-07/66080.htm) is now fulfilled. Note that the instance in this article uses the Ubuntu 8.04server LTS version. Using this version instead of the latest version of Ubuntu mainly takes into account several factors: At least after Ubuntu 9.04, ubuntu removes the Ker from the supported libraries

The promise given by the previous CentOS rapid deployment of Xen (see http://www.linuxidc.com/Linux/2012-07/66080.htm) is now fulfilled.

Note that the instance in this article uses the LTS version of Ubuntu 8.04 Server. Using this version, instead of using the latest version, Ubuntu mainly takes into account the following factors:

  1. At least after Ubuntu 9.04, Ubuntu removes the Kernel-xen package from the support library and retains only the xen-server support package. This means that Xen has no official support, and 8.04 is currently the only version that provides official support. Of course, you can manually compile your own kernel or use the corresponding debian package to forcibly install Xen, but the probability of an error is relatively high (I tried it several times in Ubuntu 10.04 before it started successfully ).
  2. The grub settings of 1004 have changed a lot and there is no correct way to manually modify the startup sequence. Setting errors can directly damage grub and cause startup failure.

This host is better than the previous one. At least hardware virtualization is supported, which is much more convenient.

Install Xen support

Ubuntu's iconic commands are very easy.
# Sudo apt-get install ubuntu-xen-server xen

If you are using a version later than 804 and then use the debian package, download the xen package for linux-modules linux-headers, use the sudo dpkg-I Method for installation.
Directly compile the kernel, you can directly load/boot/config-xxxx-xxx file and manually add xen support (make menuconfig)

Restart with the xen kernel.

# Sudo nano/etc/xen/xend-config.sxp
Change # (vnc-listen '192. 0.0.1 ') to (vnc-listen '0. 0.0.0 ′)

Install the guest operating system: method 1

The premise of this method is that your cpu supports hardware virtualization.

Create a virtual hard disk. skip this step if you use the actual raw partition.
# Sudo mkdir/xen
# Sudo dd if =/dev/zero of =/xen/2003_disk bs = 1 count = 0 seek = 5G
Edit the configuration file/etc/xen/2003

Kernel = '/usr/lib64/xen/boot/hvmloader' #64-bit kernel, replace the 32-bit value with '/usr/lib/xen/boot/hvmloader' builder = 'hvm 'memory = 512 # memory shadow_memory = 8 name = "2003" vif = [' type = ioemu, bridge = eth0 '] disk = ['Tap: aio:/xen/2003_disk, hda, W', # 'phy:/dev/sda5, hda, W ', # mount the raw partition method 'phy:/dev/cdrom, hdc: cdrom, r'] boot = "dc" device_model = '/usr/lib64/xen/bin/qemu-dm' vnc = 1 vncpasswd = ''serial = 'PTY' sdl = 1

Start a VM
Sudo xm create/etc/xen/2003

You can use a vnc client to directly connect to the host to start a typical graphical installation process.

Install guest operating system: method 2, xen-create-image

Sudo xen-create-image-hostname = xen-ubuntu-size = 5 gb-memory = 256 mb-partitions = with-data-dist = lucid-ip = 192.168.103.101-gateway = 192.168.103.254 -netmask = 255.255.254.0-mirror = http://cn.archive.ubuntu.com/ubuntu-boot-passwd-role udev-dir =/etc/xen-force

The system automatically completes the xen configuration and downloads and installs the operating system from the specified source.

Some operations (as posted)

Xm console Connect to the VM Console
Xm create Create a host based on the configuration file. If you have followed previous operations and completed the installation of the virtual host, this command is actually equivalent to starting a virtual machine.
Xm shutdown Shutdown
Xm reboot Restart
Xm destroy Delete host
Resource usage of xentop hosts

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.