Ubuntu virtualization technology OpenVZ

Source: Internet
Author: User
Install OpenVZ. Note: Ubuntu Versions later than 8.04 do not support openvz. Version 11.10 is 3.0, whereas openvz only supports version 2.6, therefore, if you want to re-compile the kernel to install openvz, the kernel cannot exceed 2.6. The following is an installation of the 10.04server version. The 10.04 kernel is another virtualization technology of Linux 2.6: Kvm, VMware, Virtualbox, Xen, and Qemu.

Install OpenVZ

Note: Ubuntu Versions later than 8.04 do not support openvz. Because the kernel version 11.10 is 3.0 and openvz only supports version 2.6, you need to re-compile the kernel to install openvz, the kernel cannot exceed 2.6. The following is an installation of version 10.04server. The 10.04 kernel is 2.6.

Other Linux Virtualization Technologies: Kvm, VMware, Virtualbox, Xen, Qemu

Installation document:

Install openvz in Ubuntu 8.04 or earlier versions:

1) Change the default ubuntu Shell from Dash to Bash.

$ Ln-sf/bin/bash/bin/sh

2) Disable AppArmor

$/Etc/init. d/apparmor stop

$ Update-rc.d-f apparmor remove

$ Apt-get remove apparmor-utils

3) install OpenVZ

$ Apt-getinstall linux-openvz vzctl vzquota

Install openvz in version 10.04 (you need to re-compile the Linux kernel with the openvz patch ):

1) install openvz

2) create a VM

A. Download the ubuntu 10.04 system template:

$ Wget http://download.openvz.org/template/precreated/ubuntu-10.04-x86.tar.gz

$ Music ubuntu-10.04-x86.tar.gz/var/lib/vz/template/cache/

B. Create a VM:

$ Vzctl create101-ostemplate ubuntu-10.04-x86

101 is the virtual machine number, and the id below 100 is used internally in openvz.

By default, virtual machines are created under/var/lib/vz/private/101 /.

The configuration file is in/etc/vz/conf/101. conf.

C. Modify the VM Configuration:

Method 1: directly modify the configuration files in the/etc/vz/conf/directory.

Method 2: Use the vzctl command to modify the modification (which can take effect in real time ).

Set the host name to test.mytest.com and the IP address to 192.168.2.100:

$ Vzctl set 101 -hostnametest.mytest.com-save

$ Vzctl set 101-ipadd192.168.2.100-save

Set the number of sockets allowed to 480

$ Vzctl set 101-numothersock‑save

Set DNS server address

$ Vzctl set 101 -- nameserver192.168.1.101 -- nameserver 8.8.8.8 -- save

D. Use a virtual machine

Enable Virtual Machine: vzctl start 101

Restart the VM: vzctl restart 101

Enter Virtual Machine: vzctl enter 101

Exit VM: exit

Stop Virtual Machine: vzctl stop 101

Delete Virtual Machine: vzctl destroy 101

Related Article

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.