Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the preparation of the KVM experimental environment?

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article shows you what the KVM experimental environment is prepared for. The content is concise and easy to understand. It will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

KVM is the most widely used Hypervisor in OpenStack. The editor introduces how to build a KVM experimental environment.

Install KVM

KVM is a type 2 virtualization that runs on the operating system, so we need to install a Linux first. Ubuntu, Redhat, CentOS are all fine. Here we take Ubuntu14.04 as an example.

After the basic Ubuntu operating system is installed, install the packages required by KVM

$sudo apt-get install qemu-kvm qemu-system libvirt-bin virt-manager bridge-utils vlan

Through these installation packages, we will review the knowledge of KVM introduced in the previous section.

Qemu-kvm and qemu-system are the core packages of KVM and QEMU, providing CPU, memory, and IO virtualization capabilities

Libvirt-bin is libvirt, which is used to manage Hypervisor such as KVM

Virt-manager is a graphical management tool for KVM

Bridge-utils and vlan, mainly for network virtualization, KVM network virtualization is based on linux-bridge and VLAN, which we will discuss later.

Ubuntu does not install the graphical interface by default. Install it manually.

Sudo apt-get install xinitsudo apt-get install gdmsudo apt-get install kubuntu-desktop

Apt downloads the installation package from the official website by default, and the speed is very slow. We can use domestic mirror sites.

Configuration / 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

Redhat and CentOS installation is relatively simple, and you can choose virtualization and graphical components during the installation process.

Tip: Ubuntu does not allow root to log in directly through ssh by default. You can modify / etc/ssh/sshd_config and set

PermitRootLogin yes

Then restart the ssh service

# service ssh restartssh stop/waitingssh start/running, process 27639

Do experiments on a virtual machine

KVM, as a type 2 virtualization, supports virtual nesting, which allows us to experiment with KVM in virtual machines. For example, I installed a virtual machine for Ubuntu14.04 in VMWare Workstation. In order to enable KVM to create nested virtual machines, I need to turn on the virtualization function of CPU. The following figure sets the mode of the following CPU in VMWare

After Ubuntu starts, confirm that CPU supports virtualization with the following command

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

Confirm that the Libvirtd service has been started

# service libvirt-bin statuslibvirt-bin start/running, process 1478 the above is what the preparation of the KVM experimental environment is like. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report