Prepare a KVM lab environment-5 minutes a day to play OpenStack (3)

Source: Internet
Author: User


650) this.width=650; "style=" Border:0px;vertical-align:middle;color: #3f3f3f; font-family: ' Microsoft Yahei '; Font-size:15px;line-height:21.75px;text-align:justify;white-space:normal;background-color: #f6f6f6; "title=" "src = "Http://7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160304-1457044908090007656.png"/>

KVM is the most widely used Hypervisor in OpenStack, and this section describes how to build a KVM lab environment

installing KVM

The previous section said that KVM is type 2 virtualization, which runs on top of the operating system, so we need to install a Linux first. Ubuntu, Redhat, CentOS can be, here we take Ubuntu14.04 as an example.

after the basic Ubuntu operating system is installed, install the required packages for KVM  

$ sudo apt-get install QEMU-KVM qemu-system libvirt-bin virt-manager bridge-utils VLAN

with these installation packages we'll review the KVM knowledge described in the previous section by the way.

    1. QEMU-KVM and Qemu-system are core packages of KVM and QEMU, providing CPU, Memory and IO Virtualization features

    2. libvirt-bin is Libvirt, for managing KVM, etc. Hypervisor

Ubuntu does not install the graphical interface by default, manually install  

sudo apt-get install xinitsudo apt-get install gdmsudo apt-get Install Kubuntu-desktop

apt defaults to the official website to download the installation package, the speed is very slow, we can use the domestic mirror site.

config/etc/apt/sources.list  

Deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiversedeb  http://mirrors.163.com/ubuntu/ trusty-security main restricted universe  Multiversedeb http://mirrors.163.com/ubuntu/ trusty-updates main restricted universe  multiversedeb http://mirrors.163.com/ubuntu/ trusty-proposed main restricted  universe multiversedeb http://mirrors.163.com/ubuntu/ trusty-backports main  Restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ trusty main  restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ trusty-security  main restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/  trusty-updates main restricted universe multiversedeb-src http://mirrors.163.com/ ubuntu/ trusty-proposed main  restricted universe multiversedeb-src http://mirrors.163.com/ubuntu/ trusty-backports  main restricted universe multiverse

then execute the following command to update the installation package index

# APT Update

The Redhat and CentOS installations are relatively straightforward, and the virtualization and graphics components are selected during installation.

tip: Ubuntu default is not allow root via SSH Direct login, you can modify the/etc/ssh/sshd_config, set  

Permitrootlogin Yes

Then restart the SSH service to

# service SSH restartssh stop/waitingssh start/running, Process 27639

  

Experiment on a virtual machine

As a KVM for type 2 virtualization, virtualization nesting is supported, which allows us to experiment with KVM in virtual machines. For example, I installed a Ubuntu14.04 virtual machine in VMWare Workstation, in order to enable KVM to create nested virtual machine, to the CPU virtualization function to open. For example, set the following CPU mode in VMWare


650) this.width=650; "style=" Border:0px;vertical-align:middle;color: #3f3f3f; font-family: ' Microsoft Yahei '; Font-size:15px;line-height:21.75px;text-align:justify;white-space:normal;background-color: #f6f6f6; "title=" "src = "Http://7xo6kd.com1.z0.glb.clouddn.com/upload-ueditor-image-20160304-1457044908340089757.jpg"/>

650) this.width=650; "Style=" Background:url ("Http://ipaiban.com/js/ueditor/lang/zh-cn/images/localimage.png") No-repeat center;border:1px solid #ddd; "src=" Http://ipaiban.com/js/ueditor/themes/default/images/spacer.gif "/> after Ubuntu starts, use the following command to confirm that the CPU supports virtualization

# egrep-o ' (VMX|SVM) '/proc/cpuinfo# vmx

Confirm that the LIBVIRTD service is started

# service Libvirt-bin Statuslibvirt-bin start/running, process 1478

KVM is ready, the next section we'll create the virtual machine

650) this.width=650; "style=" Border:none;color: #333333; font-family: ' Microsoft Yahei '; font-size:14px;line-height : 26px;white-space:normal;background-color: #ffffff; "title=" "src=" http://7xo6kd.com1.z0.glb.clouddn.com/ Upload-ueditor-image-20160304-1457044908505099383.jpg "/>


Prepare a KVM lab environment-5 minutes a day to play OpenStack (3)

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.