当前位置:首页 > 虚拟机 > 正文

kvm虚拟机自启动(vm虚拟机开机自动启动)

How to modify the automatic startup of the virtual machine in pve
To modify the automatic startup of the virtual machine in pve, you can follow the following methods:
1. Log in to the PVE web management interface.
2. Find and select the node to which the virtual machine belongs (for example, "pve") in the left navigation bar.
3. Select "Virtual Machine" in the node drop-down menu.
4. Find the virtual machine where you want to modify the auto-start settings, right-click the virtual machine name, and select "Settings" in the pop-up menu.
5. In the left navigation bar of the virtual machine settings page, select "Startup/Shutdown Sequence".
6. In the "Startup Order" list, you can adjust the priority of virtual machine startup. Just drag and drop the virtual machine you want to start automatically to a higher location.
7. To disable automatic startup, you can select the virtual machine name and click the "Disable Automatic Start" button on the right.
8. After the modification is completed, remember to click the "Apply Changes" button in the upper right corner of the page to save the modification. PVE stands for ProxmoxVirtualEnvironment (PVE for short), which is an open source virtualization platform and management system. PVE combines KVM (kernel virtual machine) and container virtualization technologies, while providing management tools for virtual machines and containers, as well as functions for building and managing virtualization infrastructure.
Install kvm virtual machine and import and export
1. Ensure that cpu virtualization is supported
cat/proc/cpuinfo|egrep'svm|vmx'

2. Install qemu-kvm, libvirt, virt-install package
yum-yinstallqemu-kvmlibvirtvirt-install
3. Enable the libvirtd service and it will start automatically at boot

systemctlstartlibvirtd&&systemctlenablelibvirtd
4. Create a disk file
qemu-imgcreate-fqcow2./210G
5. Create a virtual machine. The type is kvm, the name is arbitrary, the memory is 1G, the image file specifies the location, the disk file is the one in step 4, the network defaults, and the graphic selects vnc
virt-install--virt-typekvm--namecentos7-2020 --ram1024--cdrom=/home/kvm/CentOS-7-x86_--diskpath=/home/kvm/2--networknetwork=default--graphicvnc,listen=0.0. 0.0--noautoconsole
6. Host installation vncserver
yum-yinstalltigervnc-servertigervncvncvnc-server
systemctl daemon-reload
< br/>7. Execute the following command to set the password
vncserver
8. Start the service (the service is not started in my own environment, but it can still be used)
/>
systemctlstartvncserver@gao:1
9. Turn off the firewall and selinux
10. The vnc client connects to the host 5901, and then installs the virtual machine normally
/>
Export virtual machine
——This experiment is to export the qcow2 format to qcow2
1. Just one command
-From means compression, -O means export format, 2-bit exported file
2
Import virtual Machine
——Use the virt-manager tool to import
1. Install virt-manager
yum-yinstallvirt-manager

2. Open
virt-manager
3. Create a new virtual machine and select the image to import
Select the corresponding 2 file

Configure cpu, memory, network and other information
Complete the creation of a new virtual machine
ok

kvm virtual machine boot

1. Use the virsh command
virshautostart virtual machine name to boot
virshautostart--disable virtual machine name to cancel boot

Script

Open kvm in Android
Create KVM virtual machine_Android kvm virtual machine can be created in two ways, one is to create it with the virt-manager management tool, and the other is to use the command line. 1. Create a kvm virtual machine using the command line. First create an image file in qcow2 format, with a size of 20G. qemu-imgcreate-fqcow2/data/kvm/images/centos7.6×20G Enter the command to install the virtual machine: virt-install–name=centos7.6×86–vcpus=2–ram=2048–diskpath=/ data/kvm/imag