LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Increase size of KVM/QEMU .img virtual machine (http://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/increase-size-of-kvm-qemu-img-virtual-machine-4175433204/)

Nick_C 10-20-2012 06:37 AM

Increase size of KVM/QEMU .img virtual machine
 
Is there an easy way to increase the size of a KVM/QEMU .img virtual machine? VM host is CentOS 6.3 and virtual machine is Windows 8.

Thanks,
Nick

Nick_C 10-20-2012 08:56 AM

Found the answer myself, just putting it here for the benifit of others:

qemu-img resize myVM.img +5Gb
Stop/restart Storage Pool - else virt-manager still recognises the old size, refreshing volumes does not show new size
Boot VM and resize partition via Windows disk manager

jefro 10-20-2012 12:31 PM

Thanks for the update.

I was going to suggest something more difficult that that.

dyasny 10-21-2012 12:55 AM

qemu-img is the basic way, however, virt-resize is the more modern and easy way to go

Nick_C 10-21-2012 07:07 AM

Quote:

Originally Posted by dyasny (Post 4811176)
qemu-img is the basic way, however, virt-resize is the more modern and easy way to go

Yep, I had seen virt-resize but from the quick bit of reading that i did it seems an awfully complex way of achieving the same thing. Also seemed more suited to expanding Linux VMs, don't know if it can be used to expand NTFS ones.

dyasny 10-22-2012 12:40 AM

Quote:

Originally Posted by Nick_C (Post 4811302)
Yep, I had seen virt-resize but from the quick bit of reading that i did it seems an awfully complex way of achieving the same thing. Also seemed more suited to expanding Linux VMs, don't know if it can be used to expand NTFS ones.

doesn't seem complex to me. As for NTFS, I'd need to check that to be sure, but afaik all the virt-* tools cover NTFS. At least the ones I've used are fine with NTFS

zoltan1 10-24-2012 05:28 PM

I recently used gparted live cd to resize partitions inside some of my vm's. It works just fine. Download the gparted iso cd image, add it to your vm, reboot your vm into the gparted cd and do the resizing. Once done, in case of an NTFS partition, the next time you boot into Windows it will run checkdisk on the drive because gparted flags the partition it touches for that, this is normal.

* Before you use gparted for resizing partitions inside a vm, you have to do the image file resizing either with qemu-img resize or virt-resize as was already suggested above. The gparted live cd only helps resizing the partitions inside you VM.


All times are GMT -5. The time now is 09:27 AM.