A, kvm virtualization installation
Virtualized system installed in the group must be installed
Virtualization Client | Client virtualization |
---|---|
Virtualization Hypervisor | Virtualization of core components |
Virtualization Tools | Virtualization tools |
Second, the configuration of the network bridge interface kvm
In the configuration directory /etc/sysconfig/network-scripts/
Add bridged network
configuration is complete Network Service Restartsystemctl restart NetworkManager
Three, kvm virtualization-related information
Service Name: libvirtd
virtualized core: qemu / kvm
virtual storage directory: /var/lib/libvirt/images/wang.qcow2
virtualized hardware information: /etc/libvirt/qemu/wang.xml
Fourth, manually install the Virtual Machine
kvm client icon in the following figure
can double-click to enter the interface command can also vitr-manager
open the client, prior to installation to ensure kvm libvirtd service enabling
installation of a virtual machine There are four ways:
with network installation kvm example demonstrates, pay attention when installing memory and hard disk size is not too small or the installation process you have problems
starting the installation
during the installation I chose the minimum installation, with no graphical log
Fifth, the virtual machine management command
virt-viewer wang | Display of the virtual machine named wang |
---|---|
virt-manager | Open Virtual Machine Controller |
virsh list | Lists the virtual machines that are running |
virsh list --all | List all virtual machines |
virsh start wang | Open the virtual machine named wang |
virsh shutdown wang | Normally closed |
virsh destroy wang | Power outage |
virsh define wang.xml | Restore virtual machine hardware information |
virsh creat wang.xml | Open the virtual machine hardware information file |
Example 1: virt-viewer wang
Example 2: virt-manager
Example 3: virsh list
Example 4: virsh list --all
Example 5: virsh start wang
Example 6: virsh shutdown wang
Example 7: virsh destroy wang
Example 8: virsh creat wang.xml
When installed on a host virtual machine wants to run on another host, the need to store the virtual machine directory /var/lib/libvirt/images/wang.qcow2 and hardware information /etc/libvirt/qemu/wang.xml copied. Suppose / mnt u disk mount directory is executed after the two directory copies to
virsh create /etc/libvirt/qemu/wang.xml
The results show that the error
needs with / mnt wang.qcow2 files placed in the location specified by the virtual machine again and hardware information file
note, only the virtual machine with the create command hardware information file, when the virtual machine is powered off after the client still do not see the virtual machine
execution command
virsh define /etc/libvirt/qemu/wang.xml
It is to restore the virtual machine hardware information, after the virtual machine when the machine can also be seen in the client
Sixth, the virtual machine snapshot
6.1 virtual machine snapshot command
qemu-img create -f qcow2 -b /var/lib/libvirt/images/wang.qcow2 /var/lib/libvirt/images/node2.qcow2
6.2 graphically manner snapshot information into the client
Complete snapshot
6.3 with the way the command of the snapshot information into the client
6.4 complete virtual machine snapshot script way
Execute scripts complete snapshot