Install KVM on CentOS 7 and create a virtual machine

[ root@kvm-centos7 ~]# yum -y install qemu-kvm libvirt virt-install bridge-utils

# Make sure the module is loaded

[ root@kvm-centos7 ~]# lsmod | grep kvm 
kvm_intel             1701810 
kvm                   5546091 kvm_intel
irqbypass              135031 kvm

[ root@kvm-centos7~]# systemctl start libvirtd 
[ root@kvm-centos7~]# systemctl enable libvirtd 

Reference: http://blog.csdn.net/wh211212/article/details/54135565
Environment: OS: CentOS Linux release 7.3.1611 (Core) Network: Dual network card bonding Hardware: DELL R420, 16G 1CPU 4 cores

# Network card configuration, new ifcfg-bro, and then modify the relevant configuration as follows:
[ root@kvm-centos7 ~]# cd /etc/sysconfig/network-scripts/[root@kvm-centos7 network-scripts]# cat ifcfg-br0 
DEVICE="br0"
ONBOOT="yes"
TYPE="Bridge"
BOOTPROTO=static
IPADDR=192.168.1.133   #customize
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
DEFROUTE=yes

# ifcfg-Bond0 configuration file modification
[ root@kvm-centos7 network-scripts]# cat ifcfg-bond0 
DEVICE=bond0
TYPE=Ethernet
NAME=bond0
BONDING_MASTER=yes
BOOTPROTO=none
BRIDGE=br0
ONBOOT=yes
BONDING_OPTS="mode=5 miimon=100"

After the bridged network configuration is complete, restart the network service, check ifconfig as follows:

[ root@kvm-centos7 network-scripts]# systemctl restart network

Check ifconfig to see if the network service is normal

Create a virtual machine##

Install GuestOS and create a virtual machine. This example shows installing CentOS 7

[ root@kvm-centos7~]# mkdir -p /var/kvm/images #Create a new storage pool

[ root@kvm-centos7 ~]# virt-install \
- - name elk \
- - ram 4096 \
- - disk path=/var/kvm/images/elk.img,size=30 \
- - vcpus 2 \
- - os-type linux \
- - os-variant rhel7 \
- - network bridge=br0 \
- - graphics none \
- - console pty,target_type=serial \
- - location 'http://mirrors.aliyun.com/centos/7/os/x86_64/' \
- - extra-args 'console=ttyS0,115200n8 serial'

The normal loading status is as follows:

The meanings of the relevant parameters specified above are as follows: For more reference man virt-install

- - name specifies the name of the virtual machine
- - ram specifies Virtual Machine
- - Disk memory path= xxx,size = xxx 
' path ='⇒Specify the virtual machine
size ='⇒Specify the number of disks of the virtual machine
- - vcpus specifies the virtual CPU
- - os-type specifies the type of GuestOS
- - os-variant specifies the type of GuestOS-It may be confirmed that the following command osinfo is used in the list-query os 
- - network specifies the network type of the virtual machine
- - graphics specifies the type of graphics. If set to "None", it means non-graphics.
- - console specifies the console type
- - location specifies the location of the installation, where from--extra-args specifies the parameters set in the kernel

https://blog.csdn.net/github_27924183/article/details/76914322?locationNum=5&fps=1

Recommended Posts

Install KVM on CentOS 7 and create a virtual machine
CentOS 7 install KVM and create a virtual machine
Download of VM virtual machine and install centos7
Install ubuntu on virtual machine
VMwareWorkstation10.0 install CentOS7.0 virtual machine
How to create a CentOS virtual machine in VMware
How to create a CentOS virtual machine in VMware
Install Ubuntu on VMware virtual machine and install using UltraISO
How to install Centos operating system on VMware virtual machine
Install CentOS7 virtual machine, configure docker suite
Centos6.3 install KVM
Install R package on UBUNTU virtual machine
Install VMware Fusion and CentOS-7 on Mac
Talk about | Install docker with a virtual machine on win10 home edition
How to install and configure Elasticsearch on CentOS 7
How to install and use Docker on CentOS 7
How to install and configure VNC on CentOS 8
How to install and use Composer on CentOS 8
How to install and configure Redis on CentOS 8
How to install Node.js and npm on CentOS 8
How to install jdk1.8.0_151 and mysql5.6.38 on centos7.2.1511
How to install and configure phpMyAdmin on CentOS 6
How to install and use Curl on CentOS 8
How to install and configure Owncloud on CentOS 8
How to install and uninstall tomcat on centos
How to install and configure Redmine on CentOS 8
Install centos7 and connect
Install Docker on Centos7
install LNMP on centos7.4
Install Java on Centos 7
Nodejs install on centos7
Install FFmpeg on CentOS 8
003.KVM virtual machine deployment-CentOS6.8
Install RabbitMQ on CentOS 7
Install Node.js on Centos
Maven install on centos7
Install MongoDB on CentOS 7
Install Surelog on CentOS8
Openjdk install on centos7
Install Jenkins on centos7
install RabbitMQ on centos
Install RabbitMQ on CentOS 7
install Docker on centos6.5
install oracle on centos
Install Elasticsearch 6 on centos7
Install RabbitMQ on CentOS7
Install OS X 10.15 virtual machine based on Ubuntu platform
The virtual machine centos and the host ping each other
How to install and configure NFS server on CentOS 8
How to install and use Cockpit on CentOS 8/RHEL 8
Install mysql online on centos
centos7 install python3 and ipython
Know Linux and install CentOS
Install ElasticSearch 7.x on CentOS 7
CentOS 7 install Mono and MonoDevelop
CentOS6.5 install Java 8 and Tomcat8
Centos compile and install Git
Install MySQL 8.0.16 on Linux Centos
Install docker transfer on Centos7
Linux CentOS 7 virtual machine clone
Centos6.5 install and configure mongodb