Badges

gestaltitbadge

follow-me-twitter

Subscribe to me on FriendFeed

Comments / DISQUS
Feedjit.com

Increase the size of a virtual machine disk on VMware Server and Workstation

If you have a VM running on the free VMware Server or VMware Workstation that is running out of disk space then you can use the command line tool vmware-vdiskmanager to grow the virtual disk. Then use the Gparted LiveCD to grow the existing partition to the new disk size. Here are the steps:

  1. Download the Gparted LiveCD ISO. You will need to save it to a location you can use it to boot the VM.
  2. Shutdown the virtual machine you want to resize
  3. Open a command prompt or a terminal on the VMware Server.
  4. Browse to the folder containing the .vmdk you need to grow
  5. Use vmware-vdiskmanager to increase the size of the .vmdk.

    For example if you had a VM named “MyOS” with a virtual disk named “MyOS.vmdk” and you wanted to increase it from 20GB to 24GB you would type (it is case sensitive):

    vmware-vdiskmanager -x 24Gb MyOS.vmd

    On a Windows hosted VMware Server or Workstation you will have to specify the path to the tool
    c:\program files\vmware\vmware server\vmware-vdiskmanager -x 24Gb MyOS.vmdk

  6. Boot the VM to the Gparted ISO
  7. Once the Gparted partition editor loads, click your disk in the partition list
  8. Click the Resize/Move button
  9. Drag the arrow to extend the size of the partition. Be sure to work out the free space before and/or after the partition by sliding the whole partition either left or right.
  10. Next click the Apply button to start the resizing process.
  11. After it completes click the Close button
  12. Reboot the VM without the Gparted ISO to the VM’s OS.
  13. If your VM’s OS is Windows you will have to wait for a chkdsk on the reboot. Then Windows will reboot again.
  14. Check your new disk size in My Computer and Disk Manager!

For those who want to see all the functionality of the tool, the following is the output of “vmware-vdiskmanager –help” on my Linux VMware Server.

vmware-vdiskmanager –help
VMware Virtual Disk Manager – build 56528.

Usage: vmware-vdiskmanager OPTIONS diskName

Offline disk manipulation utility

Options:
-c : create disk; need to specify other create options
-d : defragment the specified virtual disk
-n <source-disk> : rename the specified virtual disk; need to
specify destination disk-name
-q : do not log messages
-r <source-disk> : convert the specified disk; need to specify
destination disk-type
-x <new-capacity> : expand the disk to the specified capacity

Additional options for create and convert:
-a <adapter> : (for use with -c only) adapter type (ide, buslogic or lsilogic)
-s <size> : capacity of the virtual disk
-t <disk-type> : disk type id

Disk types:
0 : single growable virtual disk
1 : growable virtual disk split in 2Gb files
2 : preallocated virtual disk
3 : preallocated virtual disk split in 2Gb files

The capacity can be specified in sectors, Kb, Mb or Gb.
The acceptable ranges:
ide adapter : [100.0Mb, 950.0Gb]
scsi adapter: [100.0Mb, 950.0Gb]
ex 1: vmware-vdiskmanager -c -s 850Mb -a ide -t 0 myIdeDisk.vmdk
ex 2: vmware-vdiskmanager -d myDisk.vmdk
ex 3: vmware-vdiskmanager -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
ex 4: vmware-vdiskmanager -x 36Gb myDisk.vmdk
ex 5: vmware-vdiskmanager -n sourceName.vmdk destinationName.vmdk

Related Posts

Get My Podcast On iTunes!
Support VM /ETC
Support VMETC.com

Support VMETC.com

Free Business and Tech Magazines and eBooks
@rbrambley tweets
VMTN Roundtable Podcasts
Subscribe



Add to Google Reader or Homepage
Subscribe in NewsGator Online
Add to netvibes
Add to Plusmo