003.KVM virtual machine deployment-CentOS6.8

An experiment description##

It is recommended to use the qcow2 disk format for the KVM virtual machine of CentOS 7. This experiment installs the CentOS 6.8 64 virtual machine in the KVM.

Second command deployment process##

2.1 Upload mirror

Use winscp to upload to /data/iso/

2.2 Format Disk###

1 virt-install --network bridge=br0,model=virtio --name=vm01-centos6.8--ram=1024--vcpus=2--disk path=/data/images/vm01-centos6.8.img,size=20,bus=virtio --cdrom /data/iso/CentOS-6.8-x86_64-bin-DVD1.iso --vnc --vncport=5902--vnclisten=0.0.0.0--noautoconsole --accelerate

Parameter Description:

win7:MicrosoftWindows7

vista:MicrosoftWindowsVista

winxp64:MicrosoftWindowsXP(x86_64)

winxp:MicrosoftWindowsXP

win2k8:MicrosoftWindowsServer2008

win2k3:MicrosoftWindowsServer2003

freebsd8:FreeBSD8.x

generic:Generic

debiansqueeze:DebianSqueeze

debianlenny:DebianLenny

fedora16:Fedora16

fedora15:Fedora15

fedora14:Fedora14

mes5.1:MandrivaEnterpriseServer5.1andlater

mandriva2010:MandrivaLinux2010andlater

rhel6:RedHatEnterpriseLinux6

rhel5.4:RedHatEnterpriseLinux5.4orlater

rhel4:RedHatEnterpriseLinux4

sles11:SuseLinuxEnterpriseServer11

sles10:SuseLinuxEnterpriseServer

ubuntuoneiric:Ubuntu11.10(OneiricOcelot)

ubuntunatty:Ubuntu11.04(NattyNarwhal)

ubuntumaverick:Ubuntu10.10(MaverickMeerkat)

ubuntulucid:Ubuntu10.04(LucidLynx)

ubuntuhardy:Ubuntu8.04LTS(HardyHeron)

2.3 kvm virtual machine installation###

1[ root@kvm-host qemu]# virt-manager

The installation process is slightly

Three login virtual machine##

3.1 Start the virtual machine###

1[ root@kvm-host ~]# virsh list --all
 2 Id    Name                           State
 3- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 4-  vm01-centos6.8                 shut off
 5[ root@kvm-host ~]# virsh start vm01-centos6.8

3.1 Virtual Machine Manager login###

In the graphical interface, use virt-manager to log in from the graphical interface.

3.2 Command line login###

1[ root@kvm-host ~]# virsh console vm01-centos6.8

Four other attention##

4.1 kvm virtual machine network###

It is possible that the kvm virtual machine has only the lo network card after logging in, but not eth0.

Need to be executed in the kvm virtual machine-

1 vi /etc/sysconfig/network-scripts/ifcfg-eth0
 2 DEVICE=eth0
 3 HWADDR=52:54:00:cd:4e:34		#It needs to be always in the xml configuration file of kvm and is globally unique.
 4 ONBOOT=yes				#boot
 5 NM_CONTROLLED=yes
 6 BOOTPROTO=dhcp
 7 Tip: If DHCP exists in the LAN, it can be turned on. If not, it can be configured with a static IP in the same network segment as the host.
 8 # ifconfig eth0 up
 9 # dhclient eth0			#Turn on the eth0 network card.

4.2 Cannot connect to kvm virtual machine via console###

If there is a stuck, you need to modify the relevant files in the kmv virtual machine. The kvm virtual machine of CentOS7 can be solved in the following ways——

1[ root@kvm-host ~]# grubby --update-kernel=ALL --args="console=ttyS0"2 CentOS6 can be solved in the following ways-
 3[ root@kvm-host ~]# echo ssyS0 >>/etc/securetty		#Host/etc/securetty add ttyS0
 4[ root@kvm-host ~]# echo "S0:12345:respawn:/sbin/agetty/ ttyS0 115200">>/etc/inittab
 5[ root@kvm-host ~]# vi /etc/grub.conf
 6 kernel /vmlinuz-2.6.32-431.el6.x86_64 ro root=/dev/mapper/VolGroup-lv_root …… rhgb quiet console=ttyS0    #Finally add console=ttyS0

Recommended Posts

003.KVM virtual machine deployment-CentOS6.8
CentOS 7 install KVM and create a virtual machine
Install KVM on CentOS 7 and create a virtual machine
Install ubuntu on virtual machine
Ubuntu14.04 creates Genymotion virtual machine
Linux CentOS 7 virtual machine clone
VMwareWorkstation10.0 install CentOS7.0 virtual machine
Virtual machine VirtualBox-5.1 install ubuntu16.0.1
CentOS 6.8 virtual machine installation details
Kali(Ubuntu) MySQL virtual machine remote connection
Virtual machine Linux Ubuntu installation tutorial
GitOps—Automatically build virtual machine templates through CI/CD
Install Ubuntu 18.04 in the virtual machine VMware
Install CentOS7 virtual machine, configure docker suite
Vagrant quickly builds Ubuntu virtual machine environment
Install R package on UBUNTU virtual machine