How To Expand An Exisiting Virtual Disk In VMWare Server

38

vmwarelogo.jpgJust like physical servers, Virtual Machines created with VMWare Virtual Server, may eventually run out of available disk space. With physical servers, the solution is to add more hard disks and move data or use third party tools to resize the partition. With Virtual Machines, you could also add virtual disks, but if you need to resize the partition, one solution is to use VMWare Server built-in command line utility called vmware-vdiskmanager, that can create, rename, defragment, shrink and expand virtual disks.

To expand an existing partition, the Virtual Machine must be shutdown and powered off. The vmware-vdiskmanager utility resides in the directory that VMWare server was installed. On my install, it is located at C:\Program Files\VMware\VMware Server.

Open a command prompt and navigate to the directory of the virtual disk you want to expand, and execute a directory listing by typing dir at the command prompt.

C:\OTHER\Virtual Machines\WTN1>dir
Volume in drive C is System
Volume Serial Number is E40F-D10A

Directory of C:\OTHER\Virtual Machines\WTN1

05/18/2007Â 05:30 PMÂ Â Â <DIR>Â Â Â Â Â Â Â Â Â .
05/18/2007Â 05:30 PMÂ Â Â <DIR>Â Â Â Â Â Â Â Â Â ..
05/18/2007Â 04:24 PMÂ Â Â Â Â Â Â Â Â Â Â Â 8,664 nvram
05/14/2007Â 11:57 AMÂ Â Â Â Â Â Â Â Â Â Â 21,751 vmware-0.log
05/14/2007Â 08:37 AMÂ Â Â Â Â Â Â Â Â Â Â 20,180 vmware-1.log
05/12/2007Â 09:52 PMÂ Â Â Â Â Â Â Â Â Â Â 22,807 vmware-2.log
05/18/2007Â 04:24 PMÂ Â Â Â Â Â Â Â Â Â Â 19,519 vmware.log
04/02/2007Â 12:41 PMÂ Â Â Â Â Â Â Â Â Â Â Â Â Â 850 Windows XP Professional.vmsd
05/18/2007Â 02:28 PMÂ Â Â Â Â Â Â Â Â Â Â Â Â Â 856 Windows XP Professional.vmx
05/18/2007Â 04:24 PMÂ Â Â Â 8,589,934,592 WTN1C.vmdk

On my Computer, the Virtual Machine is located at
C:\OTHER\Virtual Machines\WTN1 and the Operating System is Windows XP Professional named WTN1. The virtual disk that needs to be expanded is WTN1C.vmdk.

The command to expand a virtual disk follows:

vmware-vdiskmanager -x <new-capacity> diskname

Where:

-x is the option to expand
<new-capacity>
is the new size of the virtual disk you want to expand
diskname
is the virtual disk name

(NOTE: enter the full path to the vmware-vdiskmanager executable. Use quotes if the path includes spaces)

C:\OTHER\Virtual Machines\WTN1>"C:\Program Files\VMware\VMware Server\vmware-vdiskmanager" -x 10GB WTN1C.vmdk
Using log file C:\Users\Owner\AppData\Local\Temp\vmware-Owner\vdiskmanager.log
Grow: 100% done.
The old geometry C/H/S of the disk is: 16383/16/63
The new geometry C/H/S of the disk is: 16383/16/63
Disk expansion completed successfully.

WARNING: If the virtual disk is partitioned, you must use a third-party
utility in the virtual machine to expand the size of the
partitions. For more information, see:
http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647

Next, execute a directory listing to verify the virtual disk was expanded.

C:\OTHER\Virtual Machines\WTN1>dir
Volume in drive C is System
Volume Serial Number is E40F-D10A

Directory of C:\OTHER\Virtual Machines\WTN1

05/21/2007Â 11:31 AMÂ Â Â <DIR>Â Â Â Â Â Â Â Â Â .
05/21/2007Â 11:31 AMÂ Â Â <DIR>Â Â Â Â Â Â Â Â Â ..
05/21/2007Â 11:31 AMÂ Â Â Â Â Â Â Â Â Â Â Â 8,664 nvram
05/21/2007Â 11:29 AMÂ Â Â Â Â Â Â Â Â Â Â 19,549 vmware-0.log
05/18/2007Â 04:24 PMÂ Â Â Â Â Â Â Â Â Â Â 19,519 vmware-1.log
05/14/2007Â 11:57 AMÂ Â Â Â Â Â Â Â Â Â Â 21,751 vmware-2.log
05/21/2007Â 11:31 AMÂ Â Â Â Â Â Â Â Â Â Â 17,724 vmware.log
04/02/2007Â 12:41 PMÂ Â Â Â Â Â Â Â Â Â Â Â Â Â 850 Windows XP Professional.vmsd
05/21/2007Â 11:30 AMÂ Â Â Â Â Â Â Â Â Â Â Â Â Â 936 Windows XP Professional.vmx
05/21/2007Â 11:31 AMÂ Â Â 10,737,418,240 WTN1C.vmdk

You should now see the new size of the virtul disk. Also, notice the Warning message above. You will need to use a third party tool such as Partition Magic or Acronis Disk Director to resize the partition inside the Virtual Machine Operating System.

To list all available options for vmware-vdiskmanager, just enter the following at a command prompt:

vmware-vdiskmanager.exe /?

Filed under VMware Tips by  #

Comments on How To Expand An Exisiting Virtual Disk In VMWare Server Leave a Comment

May 28, 2008

Manos @ 2:48 am #

I do all the things you list above but i get the following error:
"There is not enough space on the File System for the specific operation (13)."
I have more than enough space on my hard disk (around 30Gb free) and i use the command in order to expand my vm disk from 4 gb to 10.

June 25, 2008

Rafal @ 6:47 am #

Hi guys,

why not using VMDiskSize? I have described it here:
http://rafal.drezek.info/2007/11/26/instalacja-sap-netweaver-04-demo-czesc-2/
(you can translate with http://translate.google.com. This entry is about netweaver, but part of it was about how to resize virtual disk)

regards
Rafal

November 6, 2008

Harrison Yorke @ 10:19 pm #

I have read all the articles about expanding disk, but none deals with expanding a VM machines that are homed on a datastore that is on a SAN, used for VMotion. Is the process the same.

November 8, 2008
November 13, 2008

a3cube @ 4:28 pm #

Whao!!!!!!!!

This really help. I've been on this for 2 weeks. God bless you. Actually, I've seen some stuff like this but this line

C:\OTHER\Virtual Machines\WTN1>"C:\Program Files\VMware\VMware Server\vmware-vdiskmanager" -x 10GB WTN1C.vmdk

spot a difference. I don't know know that I have to run the command from the disk location. I was running it from the program folder.

Now the size has increased. But, there is a problem. When I boot the Ubuntu, the Filesystem size didn't change and I can't hibernate because it's saying no enough space. What could be the problem @ this junction?

November 14, 2008

a3cube @ 3:13 am #

Thank you so much.Am just get use to Ubuntu. Never heard of that. I will try it now

November 15, 2008

a3cube @ 1:56 am #

Hi, am unable to expand with GParted because the partitions ext3,ext2 … are locked.I mean there is a little lock icon right before each.On right click, th expand/move is not available. how can I go about this?

a3cube @ 2:21 pm #

God bless you man! Everything went well, just the way I want it.

February 19, 2009

aquaa @ 2:23 am #

its a great tool by vmware and thanks to all of u guys. but as i expected, didnt happen. i mean i was going to expand my virtual disk to higher size. but wot happned is by virtual c: drive which was earlier 6 gb and i expanded it till 8 gb. it created another 2 gb unallocated partition in my virtual machine. now i am not able to merge two partitions. i dont have enough space left on c: drive of VM to install any third party partitioning tool.s

February 20, 2009

rays @ 3:26 am #

hi aquaa,

I have the same issue as yours..my C drive is having 6 GB and wanted to extend to 8GB, however, it just doesn't extended to C drive..

in ur statement, you mentioned "c: drive which was earlier 6 gb and i expanded it till 8 gb. " meaning that you have sucessfully extend it?

pls help,,many thanks.

rays @ 3:35 am #

to add on, after i perform:

diskpart.exe
list volume
select volume 1
extend

end up. it was extended the new drive to 8GB and appeared as another volume in My Computer, which now I have C drive (still with 6GB) and D drive (8GB)..this is not the result I wanted but to extended C drive to 8GB…..

March 23, 2009

vmware-dave @ 10:07 pm #

You can use Gparted and it works perfectly for Disks located on a SAN, ISCSI, or local. We have done all three. There are a couple parts to this whole thing. You must increase the size of the disk using ESX or using the command line. Then you mount the Gparted ISO as a boot device and then boot off that ISO for your VM. You use the Gparted utility to expand the size of whatever partition you want. There are some particulars that must be met before this can happen, but they are well documented when you find the Gparted resize tool. Start here: http://gparted.sourceforge.net/

All you windows guys, don't be scared… Linux is only a couple clicks away.

June 7, 2009

Dhominator @ 2:01 pm #

Resizing the boot disk is a bit of a pain. Yet another option I've used (for Windows) is to boot up another vm, add the resized disk, open a dos prompt, and use DISKPART to expand the partition.

/jhd

November 18, 2009

marc @ 9:47 pm #

works fine for me. winxp32 8G -> 16GB with PM8
thx !

January 15, 2010

Paul Evans @ 1:58 am #

Before you begin, create a backup copy of the virtual disk so that you can restore it in case of failures. Extending a virtual disk can be a complex operations for several reasons, e.g.,:

1) The virtual disk that is full happens to contain the boot/primary partition for Windows
2) There are snapshots
3) There is insufficient disk space available on the physical drive to permit growth
4) It is a multi step process and involves use of different tools and commands in a specific sequence. Creative individuals have devised workarounds to extend the primary partition for Windows by using Linux boot disks and disk partitioning tools such as GParted, and you have to get this right.

You’ll find several posts regarding this topic on Google. Essentially, they are all variations of the posts summarized in

http://blog.sharevm.com/2010/01/11/survey-extend-expand-vmware-virtual-disk/

February 4, 2010

Paul Evans @ 12:22 am #

here is an easier way! You should download and try fatVM http://www.gudgud.com/fatvm

fatVM is a reliable, robust, and safe, 1-click solution for extending the C drive of your VMware Fusion or Workstation virtual disk that is becoming full.
* It provides a simple, intuitive, interface and a reliable process that hides the technical complexity of extending a virtual disk.
* It is robust because it can extend virtual disks having snapshots and clones.
* It is safe because it preserves your original disk, which remains available to you for when the need ever arises.

March 2, 2010

chella @ 3:14 pm #

Many thanks for your instruction, I did this successfully, much appreciate it.

March 9, 2010

Aniket @ 3:03 am #

Hi While expanding the size does the existing data or the installed software get corrupt.

Aniket @ 3:06 am #

My VMware is windows server 2000.

March 18, 2010

Duggan @ 12:18 pm #

My vmdk file isn't just a single file name like yours ( WTN1C.vmdk). It SUSE Linux Enterprise Server.vmdk so I cd into the directory my vmdk is located and when I dir I can see it's there although when I run the vmware-vdiskmanager it just spits out the help menu for vmware-vdiskmanager. I tried renaming the vdk to suse.vmdk and it looked like it started to work but it referenced off a log file that still has the original name in it and failed. Any ideas?

Thanks,

Duggan

Sootie @ 10:59 pm #

@Duggan: Hey mate thats an easy one mine was the same just put quotes around the virtual disk name

This was the command I used

E:\Virtual Machines\Vista Image Test>"C:\Program Files\VMware\VMware Server\vmware-vdiskmanager" -x 50GB "Vista Image Test.vmdk"

And result of command:
Grow: 100% done.
Disk expansion completed successfully.

WARNING: If the virtual disk is partitioned, you must use a third-party
utility in the virtual machine to expand the size of the
partitions. For more information, see:
http://www.vmware.com/support/kb/enduser/std_adp.php?p_faqid=1647

Sootie @ 11:00 pm #

Also if you only have the one windows partition you can just expand the permission in disk management without having to worrk about 3rd party utilities.

March 19, 2010

Duggan @ 9:24 am #

@Sootie the "" worked perfectly thank you!

May 12, 2010

Jay Wheeler @ 6:54 pm #

Thanks for the tip. Just what I needed to get going

Note that when using Windows 7, you can use the operating system to expand the disk partition:

1. Go to the Control Panel and select Administrative Tools.
2. Select Computer Management
3. Select Disk Management under the Storage category
4. Move the mouse over the drive to be expanded in the right window and right click on it
5. Click on the Extend Volume entry on the pop up menu and fill in the form appropriately

May 13, 2010

Jay Wheeler @ 9:46 pm #

You are right about that. My comment was a bit obscure, although I did mention that the procedure could be used to expand the partition.

More to the point, the procedure that I gave should replace, or augment, your original section above for Windows 7 users:

"You will need to use a third party tool such as Partition Magic or Acronis Disk Director to resize the partition inside the Virtual Machine Operating System."

In other words, once the disk has been enlarged by following your procedure, there is no need for a third party product to expand the virtual disk partition for Windows 7 hosted servers. This ability was not available on Windows XP (nor Vista, I believe).

I was surprised to discover this for myself and wanted to share my discovery. Hope that this helps. Thanks for your input and the opportunity to clarify my original comment.

Sootie @ 10:34 pm #

Jay,

This feature is availible on windows vista (and is what I used to resize my disk after I posted my comment above). I had intended to post this finding when I discovered it but forgot all about it.

May 14, 2010
June 8, 2010

Sirire @ 11:35 pm #

I checked thru the previous posts and had a related question.

I use Vsphere4 and I have a Virtual Machine and I want to expand its D drive. However, I can't simply increase the provisioning size, because the datastore is already 95% used.

What is the best way to introduce another volume from another datastore and extend my D drive?

Thanks,
Sirrire

August 30, 2010

June @ 5:26 am #

I want to expand my ubuntu partitions. layout is ext3 followed by extended (linux-swap) then unallocated. I've already increased size with vdiskmanger to 20GB. When I use gparted the partition I want to resize isn't available to change. Also I can't move extended partition.

How should I continue?

Thanks

March 18, 2011

Nandish N M @ 1:52 am #

Hi,

I'm trying to run the below command to expand the disk, but it ends up the error.

Command and Error
C:\Exchange Server 2007- Nandish\Exchange 2008>"C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager.exe" -x 5GB "Windows Server 2008 x64 Edition.vmdk"Failed to expand the disk 'Windows Server 2008 x64 Edition.vmdk': One of the parameters supplied is invalid (0x100003e80).

Someone please help me to resolve this.

March 24, 2011

Sootie @ 1:02 am #

You will need to navigate dos to where the .vmdk file is first mate, unless your vm is under c:\exchange etc the command wont work.

Clear the command and browse with dos (cd \ then cd c:\wherever the .vmdk files are located) then try the command again.

December 15, 2011

syed @ 12:38 am #

Hi Freinds,

Please share the SOP of expand/increase the existing D drive space from 20 go 40 gb.

Thans,
Syed

syed @ 12:42 am #

OS type: Windows 2003
Virtual Machine

Leave a Comment

Fields marked by an asterisk (*) are required.

Subscribe without commenting