Extend the system partition in a Windows virtual machine running within kvm with file-based virtual disk

The post Extend the system partition in a Windows virtual machine running within kvm/lvm is applicable if the virtual disk is on a LVM volume.

If the virtual disk is file-based, these are the required steps:

  1. Find out what is the file the virtual machine disk is attached to; assuming disk images are in /var/lib/libvirt/images:
    sudo grep 'var.lib.libvirt.images' /etc/libvirt/qemu/name_of_virtual_machine.xml

    You might see something like:

    <source file='/var/lib/libvirt/images/w7_64_cdev15.dd'/>
  2. Shut down the virtual machine
  3. Resize the disk image file:
    sudo qemu-img resize /var/lib/libvirt/images/w7_64_cdev15.dd +10G
  4. Restart the VM
  5. Extend the disk using the guest operating system specific tool; with Windows 7 and later use the extend command from within disk manager (should require no reboot).
avatar

About paolog

homo technologicus cynicus
This entry was posted in Howtos, Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *