Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a VMware virtual machine that I made quite large. I am not really using most of it, so I would like to reduce it by 50% or so.

Is there a tool to do this?

share|improve this question

7 Answers 7

up vote 14 down vote accepted

Method 1: Using VMWare Converter:

  1. Turn off the virtual machine;
  2. Start the VMWare Converter application;
  3. Open the wizard;
  4. Select 'standalone virtual machine' as the source and destination system;
  5. Choose 'Select volumes and resize to save or add space';
  6. Enter a new size and voilá, you're done!

Some say that the expand process is slow and that VMWare Tools might need to be reinstalled.

Method 2: Using the VDiskManager:

  1. Turn off the virtual machine;
  2. Commit/remove all the snapshots first! (I forgot to mention this, thanks JimO)
  3. Open a Command Prompt and go to: C:\Program Files\VMWare\VMWare Server or C:\Program Files\VMware\VMware Workstation
  4. Run this command to expand the virtual disk: vmware- vdiskmanager -x 12GB "My harddisk.vmdk"
  5. Note: Because this only expands the disk and not the partition, you'll need to resize the partition table as well. This can be done by 3rd party tools like 'Partition Magic', but also with 'diskpart.exe', a tool of Windows. In my case, this disk is bootable, meaning that I can't run diskpart on the virtual machine itself. I used another virtual machine, running Windows XP. It also works with the Windows 7 beta 1, but it fails with Windows Server 2003.

    Add the increased hard disk to a second virtual machine;

  6. Power on this 2nd virtual machine;

  7. Open a Command Prompt and type: diskpart

  8. Type: list volume Remember the volume number (#) of your volume!

  9. Type: select volume (the number from step 8)

  10. Type: extend

  11. Turn off this 2nd virtual machine and remove the hard disk from the virtual machine configuration. This won't delete the hard disk from disk;

  12. Finished! (Windows automatically recognizes the new and correct disk and volume size)

Thanks for Leon Meijer.

share|improve this answer
    
where can I find this VMWare Converter program? Is it part of the standard install? –  Ben Laan Jun 2 '09 at 7:33
    
It's a free download from vmware. vmware.com/products/converter –  Zypher Jan 15 '10 at 7:17

This is too complex, I find a tutorial to resize vmware disk and partition size, very easy, see http://www.partition-tool.com/resource/resize-vmware-virtual-disk-tutorial.htm

share|improve this answer
    
Gordan, thanks for proving such an useful article to guide to increase partition space partition-tool.com/resource/… It told me how to do this workd with step-by-step workd. BTW, i used it on my windows seven VM, and does this work well with server operating system? –  user72588 Mar 1 '11 at 6:18

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/

share|improve this answer

There is an easy 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. a) It provides a simple, intuitive, interface and a reliable process that hides the technical complexity of extending a virtual disk. b) It is robust because it can extend virtual disks having snapshots and clones. c) It is safe because it preserves your original disk, which remains available to you for when the need ever arises.

share|improve this answer

Reboot the server with your "favourite" Live Linux ISO CD, for example Ubuntu LTS(1) or Knoppix. You can use tools like GParted to resize FAT and NTFS partitions. It's quite simple once you work out which drive is the right drive!

(1) I would recommend using an LTS version as it's going to be more stable than a fresh distro. Obviously test this first and take a backup.

share|improve this answer
    
-1 that would only resize the filesystem inside of the vmhd file. He needs to reduce the size of the vmhd to reclaim space. –  Zypher Jan 15 '10 at 7:16

As of the latest version of VMWare Workstations and Player (VMWare 7), you can resize disks from within the application.

You have to access the settings menu of the Virtual Machine, select the drive and click "Utilities". There you can choose to expand or to compact it.

A note: apparently you can't expand the disk if you have snapshots made to it. You'll have to delete them and retry before compacting it.

share|improve this answer
    
"Compacting" it this way only attempts to change the file size of the vmdks it does not change the apparent size of the virtual HDD. –  Octopus Aug 15 '13 at 20:37

I believe you can only resize the disk with VMWare Converter if the VM is running Windows. Maybe it works with Linux if you have VMWare tools installed.

If you are running a version of VMWare which supports thin provisioned disks then the VMDK size can be smaller than what the OS sees and the VMDK grows as you use more space in the VM. If your machine has a disk like this then all you have to do is start the shrink process. You start the shrink process inside the machine with a command (Linux) or in VMWare tools (Windows). It then moves the data to the beginning of the disk like some defrag apps do. After doing that it starts a process in VMWare to resize the VMDK file.

I'm using ESXi 3.5 which does not support thin-provisioned disks. What I have been doing recently is as follows: 1. Create a disk of the desired size in the VM. 2. Boot an Ubuntu CD. Could also be the gparted Live CD or any other partition boot CD. 3. Use gparted or partition app to resize the partition down and copy the partition to the small drive. 4. Remove the old disk from your VM. 5. Boot the install disc for the operating system and repair the MBR. 6. Delete the old disk VMDK file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.