Host is ubuntu16.04, installed KVM, and installed Windows 7 system, initially allocated hard disk space is too small, so consider adding hard disk, the specific operation record as follows.
1. Create a hard disk image with the QEMU HDD Image tool qemu-img
$CD/var/lib/libvirt/images/ $sudo qemu-img create-f qcow2 extendwin.img 10G |
Check the information for the newly created image
$ qemu-img Info extendwin.img |
2. Close the virtual machine
Can be turned off in the Windows operating system interface, or can be turned off with the Virsh shutdown tool
3, use in the Virsh edit the virtual machine with edit command
Find the following section
Add a new disk
<disk type= ' file ' device= ' disk ' > <driver name= ' qemu ' type= ' Qcow2 '/> <source file= '/var/lib/libvirt/images/extendwin.img '/> <target dev= 'hdc' bus= 'ide'/> </disk> |
May error when saving, select "I" to forcibly save.
4. Start Windows, add new hard disks with Disk Management
The following steps are omitted.
Combat: Add a hard drive to the Windows system installed on a KVM virtual machine