There are multiple ways to perform this task. Paul wrote me a comment saying that there is an easy way that I didn't know before: VMWare Converter. So I added this info to my post.
AS ALWAYS, BEFORE YOU BEGIN, MAKE SURE YOU HAVE A GOOD BACKUP!
Method 1: Using VMWare Converter (tested with v3):
- Turn off the virtual machine;
- Start the VMWare Converter application;
- Open the Convert Machine wizard;
- Select 'standalone virtual machine' as the source and destination system;
- Choose 'Select volumes and resize to save or add space';
- 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. A disadvantage is that Converter will create a new (many GB) copy of your VM.
Method 2: Using the VDiskManager:
- Turn off the virtual machine;
- Commit/remove all the snapshots first! (I forgot to mention this, thanks JimO). Or make a Full Clone if you use Link Clones.
- Open a Command Prompt and go to:
C:\Program Files\VMWare\VMWare Server or C:\Program Files\VMware\VMware Workstation
or for 64-bit
C:\Program Files (x86)\VMWare\VMWare Server or C:\Program Files (x86)\VMware\VMware Workstation
4. Run this command to expand the virtual disk:
vmware-vdiskmanager -x 12GB "My harddisk.vmdk" (in this case, 12 GB will be the new size). The file name can contain spaces because of the double quotes.
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 built-in tool of Windows. VMWare provides a list of tools on their web site: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1004071
I prefer to use Microsoft diskpart.exe and that’s where this post is about (more info).
Instructions for Windows Vista, 7 and 2008R2 are below!
If your VM runs Windows 2000, XP, Server 2003 or Server 2003 R2
If your resized virtual disk is bootable, you cannot use diskpart from the virtual machine itself. Use a 3rd party tool or use another virtual machine. Here I describe how to use diskpart.exe with a 2nd virtual machine.
- Add the increased virtual hard disk to a second virtual machine;
2. Power on this 2nd virtual machine;
3. Open a Command Prompt and type:
diskpart
4. Type:
list volume
Remember the volume number (#) of your volume!
5. Type:
select volume <volume number> (the number from step 8)
6. Type:
extend
7. Turn off this 2nd virtual machine and remove the virtual hard disk from the virtual machine configuration. This won't delete the hard disk file from disk;
8. Your now finished! You can boot your VM with the resized disk. Windows automatically recognizes the new and correct disk and volume size.
If your VM runs Windows Vista, Windows 7, Windows Server 2008 or Windows Server 2008 R2
These versions of Windows ship with a more enhanced version of diskpart.exe that supports partition extension for bootable disks.
- Power on your virtual machine;
2. Open a Command Prompt and type:
diskpart
3. Type:
list volume
Remember the volume number (#) of your volume!
4. Type:
select volume <volume number> (the number from step 8)
5. Type:
extend
6. Your now finished! You do not have to reboot.
Example:
C:\Program Files\VMware>cd "VMware Server"
C:\Program Files\VMware\VMware Server>vmware-vdiskmanager -x 12GB "F:\My Virtual
Machines\WIN_2003_ENT_VSTS\Windows Server 2003 Enterprise Edition.vmdk"
Using log file C:\DOCUME~1\_DIGIT~1\LOCALS~1\Temp\vmware-_digite_admin\vdiskmana
ger.log
The old geometry C/H/S of the disk is: 1044/255/63
The new geometry C/H/S of the disk is: 1566/255/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
C:\Program Files\VMware\VMware Server>
No comments:
Post a Comment