Centos6.5 installation and deployment of KVM

1. Introduction to KVM

KVM is open source software, the full name is kernel-based virtualmachine (kernel-based virtual machine), is an open source system virtualization module, based on hardware full virtualization, but requires hardware support (such as Intel VT technology or AMD V technology). Since Linux 2.6.20, it has been integrated in all major Linux distributions. It uses Linux's own scheduler for management, so compared to Xen, its core source code is scarce. KVM has become one of the mainstream VMMs in academia.

Two, KVM installation configuration

1. CPU virtualization enabled

You need to enable virtualization in the BIOS, which is generally enabled by default

| cat /proc/cpuinfo | grep'vmx' //Intel CPU judgment method cat /proc/cpuinfo | grep'svm' //AMD CPU judgment method|
|--------|

2. Install KVM

yum install qemu-kvm qemu-kvm-tools virt-manager libvirt virt-viewer -y

Parameter explanation:

kvm: a module of the linux kernel, the module does not need to be installed, only needs to be loaded

qemu: virtualization software, which can virtualize different CPUs and supports heterogeneous

qemu-kvm: User mode management kvm, network cards, sound cards, PCI devices, etc. are all managed by qemu.

virt-viewer: A tool when using VNC client to connect to the server's graphical interface.

3. Load the kvm module

| modprobe kvm-intel //Load the kvm module lsmod | grep kvm //Check whether the kvm module is loaded|
|--------|

4. Modify the configuration file of the network card

**eth0 **

New br0

Don't worry about whether the IP addresses of the network cards are consistent or not, the role of eth0 now is similar to a switch. (No IP)

It is normal as shown below.

5. Modify the configuration file of the VNC server

Remove the # comment in front of vnc_listen = "0.0.0.0" // on line 12 of the file

vim /etc/libvirt/qemu.conf

6. Restart libvirtd and messagebus services

/etc/init.d/libvirtd restart //Restart libvirtd service /etc/init.d/messagebus restart //Restart messagebus service

7. Create virtual disk

Create a virtual disk, -f specifies the format, the path is /opt/CentOS-6.5-x86_64.raw, the size is 10G

qemu-img create -f raw /opt/CentOS-6.5-x86_64.raw 10G

8. Copy the image file to the directory and the virtual disk storage directory

Insert the server CD into cdrom1

dd if=/dev/cdrom1 of=/opt/Centos-6.5-x86_64.iso

9. Create a virtual machine

virt-install -n centos6.5 -r 512 -vcpus=1 -s 50 -c /opt/Centos6.5-x86_64.iso --hvm --os-type=linux -f /opt/CentOS-6.5-x86_64.raw --graphics vnc,listen=0.0.0.0,port=7789 --force --autostart

Parameter explanation:

Create a virtual machine called centos6.5, the memory size is 512 memory, 1 cpu, 50G hard disk, the installation image is /opt/Centos6.5-x86_64.iso designated as full virtualization, the system type is designated as linux virtual The hard disk of the machine is opt/CentOS-6.5-x86_64.raw, and the port of vnc is configured as 7789 to automatically start the installation.

Verification: virshlist

10. Set iptables security policy

iptables -I INPUT -p tcp --dport 7789 -j ACCEPTservice iptables save

11. Use VNC client to connect to KVM virtual machine

If your Xshell will automatically pop up this window, it is also possible. If not, you can close it and use VNC to connect.

Enter the IP address and port

start installation

12. Configure KVM virtual machine

For example, install an Apache web-server

Configure IP address

Use Xshell to connect (a simple example of yum method)

Start httpd service

**Browser access test ok! **

Recommended Posts

Centos6.5 installation and deployment of KVM
Centos-6.5 installation and deployment of LNMP environment
Centos7 installation and deployment of gitlab server
Centos7 installation and deployment of Airflow detailed
centos7 kvm installation and use
CentOS7 installation and maintenance of Gitlab
CentOs7 installation and deployment Zabbix3.4 original
Erlang 20.2 installation and deployment under CentOS 7
Centos8 minimal deployment and installation of OpenStack Ussuri detailed tutorial
ubuntu Docker installation and deployment of Rancher
MySQL 8.0 installation, deployment and configuration under CentOS 6/7
Installation and configuration of redis under centos7
Installation and deployment of Nginx in Ubuntu
Zabbix installation and deployment and localization under CentOS
Jenkins installation and deployment tutorial under CentOS 7
KVM installation and preliminary use under CentOS 7.2
Graphical installation of CentOS8
Installation and configuration of JDK in CentOS 7 system
Centos7 installation of PHP and Nginx tutorial detailed
Installation and configuration of rsync server under CentOS 6.5
Installation and configuration of CentOS 7 in VMware Workstation
MySQL 8.0 installation and deployment under CentOS, super detailed!
MySQL 8.0 installation, deployment and configuration tutorial on CentOS 8
Centos mysql installation and configuration
Centos7 installation and configuration prometheus
CentOS 7 installation and configuration PPTP
Deployment of graphite on centos7
CentOS installation and configuration cmake
Centos7.5 installation and configuration MongoDB4.0.4
CentOS 7 installation and configuration PPTP
Centos7 silent installation of Oracle11g
CentOS7 postgresql installation and use
CentOS environment installation of Docker
Centos7 elk7.1.1 installation and use
Installation and cracking of confluence6.3 operation records under Centos
Installation and cracking of Jira7 operation records under Centos
Analysis of Hyper-V installation CentOS 8 problem
Centos7 installation of Dameng database tutorial
CentOS 8 installation of MariaDB detailed tutorial
Installation under centos6.9 of jenkins learning
Detailed explanation of Spark installation and configuration tutorial under centOS7
CentOS6 minimal installation KVM detailed tutorial
Centos7 hadoop cluster installation and configuration
CentOS7 installation and maintenance of nginx from entry to master
Deployment of vulnerability scanning and analysis software Nessus under CentOS
CentOS 7.X system installation and optimization
Java-JDK installation and configuration under CentOS
CentOS 7 Tomcat service installation and configuration
001. Installation of enterprise-level CentOS7.6 operating system
Introduction to CentOS7 installation process of openjdk, tomcat and mysql
CentOS NTP server installation and configuration
2019-07-09 CentOS7 installation
centos7_1708 installation
CentOS deployment method of flask project
2-Kubernetes entry manual installation and deployment
JumpServer Bastion Host--CentOS 8 Installation and Deployment (4)
Centos7 mysql database installation and configuration
Using Elastic Stack on CentOS 8: Deployment and authentication configuration of Elasticsearch/Kibana 7.8
CentOS 7 system installation and configuration graphic tutorial
Ubuntu installation and deployment Redash operation notes (2020.08)
Concise summary of Ceph deployment on Centos7