There are many ways to expand a drive within a VMWare image and I have outlined two approaches below depending on your setup. I have used both these methods successfully on a Windows Server 2003 Vmware image (Vmware Workstation 5.0)
Method 1
Advantages: You get to keep your Vmware snapshots
Limitations: You can’t extend all volumes, I had trouble trying to extend the system/boot volume. According to a Microsoft Knowledge Base article you can’t extend a volume if the system page file is located on the partition. You could try to move the page file to a partition that you do not wish to extend.
My setup:
C: System Drive 10 GB
D: Data 4GB
Let’s say that we want to expand the D drive from 4GB to 10GB
- Shutdown the VMWare Image
- Add a new disk to the VMWare image (the size should be that which you want to allocate to another volume, in this example 6GB).
- Boot up the VMWare image into Windows and go to Disk Management (Administrative Tools -> Computer Management -> Disk Management)
- A wizard should be displayed to initialize and convert the new disk. If you are not prompted then you may need to Rescan. Do not assign a new volume at this stage.
- You need to convert the D drive and the new drive to both be dynamic disks.
- Once both the drives are dynamic, then right click on the D drive and select Extend Volume.
- Follow the wizard to allocate the new space to the D drive.
Once you complete the wizard, the D drive should now be 10GB. That’s method 1 complete. If this worked for you, great! If not then take a look at Method 2 below.
Method 2
Advantages: You can successfully expand a system/boot drive.
Limitations: You have to remove all your snapshots (the vmware-vdiskmanager utility requires this.)
My Setup:
C: System Drive 8GB
D: Data 4GB
E: Data 4GB

Let’s say that we want to expand the C volume from 8GB to 12GB. Assume that the C drive is full to capacity (that’s why we are expanding it right!)
- If the Vmware image is running, shut it down.
- You need to find the name of the Vmware (.vmdk) file that represents the virtual disk that you want to expand. Go to VM->Settings and locate the drive
that you want to expand. The disk file field on the right hand side will display the name of the .vmdk file.
- You need to remove any snapshots present in the Vmware image. Note: By deleting the snapshots the system still remains in its current state.
- Open up a command prompt and issue the following command: vmware-vdiskmanager -x 12GB “Windows Server 2003 Standard Edition.vmdk” where 12GB is the desired size of the expanded volume.

- This expansion may take a while but when it is complete, boot up into Windows and go to Disk Management (Administrative Tools -> Computer Management -> Disk Management)
You should see something similar to the following screenshot. The disk has been expanded but the new space is as yet unallocated. Now in theory you should be able to use the Windows diskpart utility to allocate this space but this would not work on a boot/system disk for me.
- So with diskpart not up to the task, what are your options?:
- Buy some Windows partition software (i.e. Partition Magic) at a cost of USD200- USD300 for a Server edition or
- You could use Knoppix (free) to allocate the new space to the C drive. Knoppix is a bootable Live Linux CD and it happens to have a utility called QTparted.
- Since everyone likes free stuff, I went with Knoppix in this case. Download Knoppix (the iso image) to the machine which hosts the VMware image.
- Now you need to point your CD/DVD drive in your VMWare image to the iso image. How do I do this?
- Reboot your VMware image and have it boot from the cd drive. You may need to modify the BIOS settings in order to change the boot order to have the system boot from the CD drive. The exact settings that you need to modify will depend on the exact BIOS that you have. It should be straightforward to change this.
- After Knoppix boots , start at the large letter K at bottom left. Select K | System | QTParted to launch the utility. You will see the list of disks within the VMware on the left hand side. Selecting one of these disks will provide you with more details about that disk. In the following screenshot you can see the C drive with the 8GB allocated and the 4GB unallocated.

- Right click on the drive that you want to expand and select Resize.

- A dialog will be displayed and you can expand the allocated space by dragging the partition to the right. You could also type in the values into the textboxes. After allocating all the new space you now see that the total size is approx. 12GB.
- Click OK to exit the dialog. At this stage you have not commited the changes yet. Go to the main menu of QTParted and select the Commit option. The following prompt will be displayed.

- Choose Yes to commit the changes. You will see the following two screenshots as it commits the changes.


- After the operation completes, you should see that the new volume now is 12GB in size with only 8GB in use (we now have 4GBs free :))

- Now, shutdown the Vmware image and boot back into Windows (you may need to change the boot order to accomplish this).
- Don’t be alarmed if CHKDSK wants to run some tests on your drive. It detected the changes you made in Knoppix and wants to verify that everything is ok.

- You may need to restart Windows again because it will have detected new hardware.

- Once Windows is back up, go to Disk Management (Administrative Tools -> Computer Management -> Disk Management) and you should now see that the C drive has the extra 4GB as promised.


- Also, in Windows Explorer, right click on the C drive and choose Properties. You will see now that there is over 4GB of free space. :))

Job Done!
Lessons for the future:
When you are creating future Vmware image make sure to allocate plenty of space to the drives.
You can set that they only grow as required so they only ever take up the space that you require at any point in time.
61 Responses to “Expanding a drive within a VMWare image”
- 1 Pingback on Jan 3rd, 2007 at 2:24 pm
- 2 Pingback on Jan 29th, 2007 at 10:43 am
- 3 Pingback on Jun 22nd, 2007 at 3:10 pm
- 4 Pingback on Apr 30th, 2008 at 1:32 am
Sean, you are the man! Your Knoppix solution just saved me a whole day of work and kept my project on track. I and my team thank you!
Sean - This GREAT information! Thank you taking time to explain and show examples. I have one additional question… You show examples for IDE types of drives. What about SCSI drives? How can I expand those virtual drives within VMWARE? I opted for SCSI drives in my Windows 2003 Server VMWare machines. Any suggestions? Thank you.
Thanks CrazyDownhiller, happy that the article helped.
Hi Steve,
I would be more familiar with IDE drives so that is was I used them in my VMWARE images. I don’t know if the solution will work for SCSI drives. Did you try it out? It may well work for SCSI drives as well, I just never needed to use it for those. Thanks for commenting.
Hi there
I’ve tried the above steps as well, but the most perculiar thing happens.
In the “Disk Management” as above, my drive remains the original size, whereas the “Disk with new space” appears to have changed.
Any idears or do I need to format my vitual drive C: ?
screenshot can be found here:
http://87.49.64.163/myManagement.jpg
Andreas
Same happened to me! first i thought it was because i made it 100GB, but reading your reply Andreas, i guess i have the same problem
(the properties on c drive also say it still is the old size)
i just tried to make change the disk to grow when full:
vmware-vdiskmanager.exe -r image.vmdk -t 0 newimage.vmdk
it went succesfull, but isnt working prob. cause the disk managment still says its not full at all
btw, thanks anyhow for your work in this!!!
(sorry for the 4 double post, keep thinking about it)
i tried using knoppix again to make the partition a bit smaller, but it gives an error that it cant change the ntfs anymore
and i also cant use vmware-vdiskmanager.exe -x image.vmdk anymore either: Failed to expand the disk ‘image.vmdk’: One of the parameters supplied is invalid (1) (while using the exact same syntax as before, just not 100GB but 20GB) (it prob. can only resize it to a bigger size though)
Just fixed it without fixing it
)


made a new image (200GB and this time i made it grow when become larger
backuped the actual image with acronis , partitioned the new image with knoppix, and restored the backup on the new image with acronis
costs alot of downtime, and only half an hour actual work…. and a chance you have to re-activate
i now have a 200GB image which only takes 10GB on my hard drive cause it will grow when more data inputted
Hi Elwin,
Good to hear that you eventually found a solution. I wasn’t too sure why the above solution didn’t work fully for you. I have used the procedure above many times and it worked fine for me.
Glad that this article helped in some way.
it helped alot in understanding vmware
thnx 4 your reply!
Thanks for the guide,
I also ran into the issue of parted appearing to resize the drive, but in fact not resizing it. The fix that I used is to first mount the drive in knoppix, then unmount it. Then do the resize. For some reason if I did not explicitly mount and unmount the drive, parted had an issue with determining the mount state of the drive.
I got the same probs as the previous posters. C: will show my resized space which was 40GB, but the properties still reflect my old space.
I tried to mount then unmount in knoppix but it didn’t work. I got an error which I forgot. will try it again so that I can post the error.
Hi Sean,
I like the article; it’s very useful as people often have the same problem. I also was pulling my hair out till i found an article on this topic here:
http://www.vmweekly.com/articles/expanding_the_virtual_disk_size_in_4_steps/1/
It made my life pretty easier. Think you might be interested.
Jeff
Thanks for the excellent HOWTO ! And for all friends that got the Failed to grow disk XXX : one of the parameters supplied is invalid. (1) error, please take note that in this case you have to convert first your VM disk into the most recent format using ‘vmware-vdiskmgr -r -t X new.vmdk’ - where X should be 0 if you want one big file as vmdk, and 1 if you want dozen of 2GB chunks (or 2/3 if you want preallocated and not growable disk).
Regards,
Luca
Sorry, it’s me again. Just to point out that I went through all the Qtparted issues & errors emphasized by other people, but at the end (maybe at the 2nd or 3rd attempt) Qtparted worked.
Regarding the problem with the disk looking expanded but not the partition…
I was getting an error when committing my resize changes in QTParted saying that it couldn’t read the device status (or something similar). I ignored this at first and rebooted because it looked like the changes had actually saved. When I got in Windows I noticed that the drive was expanded but not the partition. I rebooted to Knoppix, tried QTParted again (click resize but don’t actually expand it so that we can save again) and got the same error message. I tried one last time and it actually saved that time without the error message.
*shrug*
Seems to be ok in windows now
Great news for you vista guys, the disk management in vista lets you extend the boot volume with no extra steps. I followed the steps outlined, until the disk management step, then just extended the volume to include the new unallocated space. It was quick painless and within minutes I was finished with the resizing of the virtual disk file. Thanks for the help.
New information on vista, it appeared to work last night, I ran a vista defrag with my newly extended drive (10GB -> 18GB) then shutdown. This am I go to boot the vista VM and it gives me the “operating system not found” message. So I am trying all the mount and recover tools and have not been able to do anything with the disk file. I have built another vista vm and am going to do the extend and defrag on it to see if it blows up as well. I will update post when finished. If anyone has seen this or can recommend a solution please let me know. Nothing major on the corrupted disk file, just don’t want to have to reinstall all my apps again. THANKS.
Had the same problem as other above, where the drive size is recognized in the Disk Management MMC plugin, but not through windows explorer. Used the mount/umnount in Knoppix and it solved the problem.
Great info. Just wanted to point out that Windows Vista allows resizing boot disks without the need to use third party software on the guest.
Good info. I followed the steps and everything worked like a charm. THX
excellent instructions!
i ran into the same error with QParted, and Windows refused to recognize the expanded partition.
i tried GParted instead on its own livecd and fixed it
http://sourceforge.net/project/showfiles.php?group_id=115843&package_id=173828
since i already expanded it using QParted in Knoppix, i had to shrink it by 1K using GParted to get it to commit a change. after doing this, XP booted up, did a chkdksk, and now its all where it should be
Guys,,,,,,,,,, VMWare Converter does the whole thing,,, it’s a free download from their site. Just Import the machine in question,,, select a new desitination and select “select volumes and resize to save or add space”,,,, and you’re done. I changed an 8gb to 15gb in a few minutes!!!!!!!!! sweet. It also gives you a few custom options before it makes the resized clone. A dodle.
Thanks for the comment Alan. Vmware Convertor is a relatively new product, I wrote this post about 8 or 9 months when there weren’t many ways to expand a drive within a vmware image.
cool
Hi Thank you for this very useful information as this has solved lots of probs related to increase of hard disk space in VMWare Images.
Also pls could u tell me how to increase the mnory size of the image.
Thanks
uma
how to increse memory space of vm-ware-image ?
Hi Uma,
To increase the memory in a VmWare Image, you first need to shut down the vmware image. Then open it in VmWare Workstation and via the Properties dialog you can increase or decrease the memory allocated.
Hope that helps.
Sean,
To extend the boot volumes, what I have done is use vmware-diskmanager as above to make the disk larger, then mounted the disk as a second disk onto another VM. Then use diskpart, select the second disk, select the partiton then type extend. Diskpart will extend the partition to be the full size of the disk. shut down the second vm, remove the disk and then start up the first vm, you will now have a boot drive the full size of the extended disk.
I have found that it works best if you use XP to mount a server 2k3 disk and extend the volume, and the same in reverse, ie, use Win2k3 to extend an XP disk.
No extra utilities are required!
I’m getting the same error where windows disk management shows the right size, but windows explorer shows the old size after running qparted. Can someone please help by posting how to mount and unmount in knoppix since I’m a newbie to linux.
Thanks in advance
I am getting the same thing where disk management and windows explorer show different results.
Hi sc110786 & Mayur,
A few people have had this problem after they boot back into windows. Read the following comments from Josh above. “When I got in Windows I noticed that the drive was expanded but not the partition. I rebooted to Knoppix, tried QTParted again (click resize but don’t actually expand it so that we can save again) and got the same error message. I tried one last time and it actually saved that time without the error message.”
Thanks for the comments. - Sean
great article, sean! I had to download Knoppix 4.02 to get my VM to boot properly, and had to run QTParted twice (same issue as above). Great article!
Thanks for the comment Nathaniel, glad to hear that you got it sorted in the end.
i actually wrote about this too on my blog.
these are fantastic guides but you’ve forgotten to mention the in-build diskpart.exe in windows 2003 r2 that does the same thing, i have an article about it in my blog.
Ran into the issue of Windows Disk Manager saying the drive was 12GB (full size I adjusted it to) but explorer still said it was 5GB (original size).
Booted back into Knoppix, tried to mount it, informed me that the NTFS system needed to be repaired. Did a repair through Linuxntfs repair, went back to QTParted, opened up the resizer, clicked “ok” (disk was already resized) and clicked “commit”.
One reboot later it worked great, thanks for the guide!
The VMware Converter method worked beautifully! Too bad they only make it for windows, and there is not a Linux version, but oh well, still was faster then the other methods.
I found that a key component was to make sure that Windows had shutdown cleanly. If the windows virtual-machine did not shutdown cleanly, then QtParted would not be able to resize properly.
This was a problem for me, because at first I wasn’t fast enough to catch the boot option to use the CDROM to boot to Knoppix… and just did a “reset”.
If you try GParted, which is on the Knoppix CD. it worked for me the first time after qparted did not. QParted showed the disk in disk management as being expanded, but the disk in explorer didn’t change. GParted fixed all that.
Great article,
QParted could not get to work at all. With the latest release of Knoppix the Gparted utility did the trick for me. By the way the version I had wanted the root password to run it. Since none is set by default you need to run a command shell the
su - root
passwd
I got the same dialog popup as QParted which I ignored.
On reboot chkdsk did its thing and all was well.
Can confirm that it was the existing of the swap file on C: that was the problem.
To avoid the issue altogether in the future You can create a small separate disk and relocate the swap file there. Workstation 6 lets you resize as part of a machine import.
Knoppix rocks !! Have spent most of today setting up the VM env to realise I was running out of space on C:
I’ve got 16 gigs of space on my C drive. Should be able to install VS2008 now
Nothing incredible here, but for those who have or use Acronis. I had to extend my vm’s c: by 7GB, here is what I did and it only took 15 minutes without any snags.
1. turn off vm, on the host use vmware-vdiskmanager.exe x to extend the size of a disk, this should take several minutes, depending on size and performance of your hardware
2. power on vm, go into disk management, ensure you have the unallocated space available, power off your vm and put your acronis boot cd in the drive
3. be sure to use an acronis boot disk that includes disk director, use disk director to extend the c: on your vm, this should take less than 2 minutes, depending on size and performance of your hardware
4. when finished, remove the disk and power on your vm, you should be all done
http://www.acronis.com/
Heathhamm, Thanks for the comment. I was aware of Acronis and various other partitioning tools that could be used. The key to the above article is that you don’t need to purchase any software
Sean,
Great article, thank you! Everything worked for me exactly as you described.
I’d been limping along with
Sean,
(sorry, first post truncated)
Great article, thank you! Everything worked for me exactly as you described.
I’d been limping along with an image that had less than 50MB left. I was dreading the thought of having to create a new larger image and reload all my software onto it.
Your article saved me what I thought was going to take hours! Seriously the best thing I’ve found all year. YOU ROCK!!
Just wanted to tell everyone this is a great tutorial. Just one note make sure that you use a recent version of knoppix with qtparted. I used 5.1.1 and it worked great. Version 5.0.1 does not support NTFS properly and windows will not recognize the drive change.
Is the iso download really 600mb? It’s taking an age to download it!
Sean,
Thanks for sharing these instructions. I followed them with no problem using VMWare Workstation, Windows Enterprise Server 2003 SP2, Knoppix 5.1.1, and virtual SCSI disks.
Happy New Year!
VMWare Converter for tha win!
Dear Sean,
Great. We were stuck with Vmware Server 1.0.3 (on Suse Linux Ent 10.1) Virtual Machine. The C drive of the Windows 2003 was just 8G and it was almost full. Struggled so much with other options like vmkfstools, as it wasn’t available. Finally your solution worked like a charm. One thing I would like to add is that, instead of Knoppix, I used GPartEd Live CD ISO and connected it to the CD-ROM of this virtual machine.
Joseph
Thanks a mil for this post. It worked perfectly!
I also used GPartEd as it was quicker to download.
Thanks, Did this on a Windows 2008 Server Web Edition HDD and Acronis Partition Manager, when the resize was compelete Windows complained \Windows\System32\WinLoad.exe was missing or corrupt, and would not boot. A “Bootrec /rebuildbcd” using the repair command prompt fixed it and rebooted to a huge drive! Thanks again.
Thanks Sean for the time and effort to document this so clearly. It saved me tons of time and effort today (and in the future).
Thanks a lot Sean. Saved me a lot of time and efforts. Great details.
Best article ever!!
I went with Method 2 and the Knoppix v5.1.1 of 2007-01-04 ( http://mirror.netcologne.de/knoppix/knoppix-cd/ )…..worked like a charm.
Thanks a lot.
Thanks a lot Sean for the great article.
I followed Method 2 with Knoppix on Windows Server 2008 (Experimental) and it worked perfect. Although it failed first time when I tried to extend 100% of the newly created disk space. The second time I substracted 0.97 MB (seems like it was used for some administrative purpose) from the total size and it worked.