LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 10-20-2012, 06:37 AM   #1
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS, Mageia, Debian, Fedora, openSUSE, Ubuntu
Posts: 238

Rep: Reputation: Disabled
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
 
Old 10-20-2012, 08:56 AM   #2
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS, Mageia, Debian, Fedora, openSUSE, Ubuntu
Posts: 238

Original Poster
Rep: Reputation: Disabled
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
 
Old 10-20-2012, 12:31 PM   #3
jefro
Guru
 
Registered: Mar 2008
Posts: 11,590

Rep: Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419Reputation: 1419
Thanks for the update.

I was going to suggest something more difficult that that.
 
Old 10-21-2012, 12:55 AM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 837

Rep: Reputation: 91
qemu-img is the basic way, however, virt-resize is the more modern and easy way to go
 
Old 10-21-2012, 07:07 AM   #5
Nick_C
Member
 
Registered: Jan 2012
Location: London, England, UK
Distribution: CentOS, Mageia, Debian, Fedora, openSUSE, Ubuntu
Posts: 238

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by dyasny View Post
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.
 
Old 10-22-2012, 12:40 AM   #6
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 837

Rep: Reputation: 91
Quote:
Originally Posted by Nick_C View Post
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
 
Old 10-24-2012, 05:28 PM   #7
zoltan1
LQ Newbie
 
Registered: Oct 2012
Posts: 9

Rep: Reputation: Disabled
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.

Last edited by zoltan1; 10-24-2012 at 05:32 PM.
 
  


Reply

Tags
kvm, qemu, virt-manager


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
Size of vm created by qemu-img convert Nick_C Linux - Virtualization and Cloud 14 03-30-2012 05:29 AM
Cant install Virtual machine in CentOS 6 Cannot find package qemu-kvm in yum install linux_rhca Linux - Newbie 4 10-19-2011 05:37 AM
kvm-qemu-img: qcow2 disk image format changes to raw format in RHEL-KVM 5.6 rajivdp Linux - Virtualization and Cloud 2 09-19-2011 11:23 AM
[Debian/Qemu/KVM] Why qemu --enable-kvm works but not kvm directly? gb2312 Linux - Virtualization and Cloud 2 03-21-2011 02:05 PM


All times are GMT -5. The time now is 05:38 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration