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

Source: Internet
Author: User


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

    3. virt-manager is a KVM graphical management tool

    4. bridge-utils and VLANs, primarily network virtualization needs, KVM The implementation of network virtualization is based on Linux-bridge and VLANs, which we will discuss later.

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




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

  


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.