linuxpeter.de
  Batch, Scripts, Tools & Tips > Windows Batch and Tools  
 
Windows Batch and Tools
<< mass text changer for free: Notepad++ to replace text in files Übersicht Improved Win7 System-Settings Overview >>
Resize VMWare virtual disk Die Größe einer virtuellen Harddisk verändern / vergrößern.

Today, I needed to resize a virtual harddisk (vhd) of a Vmware Workstation machine.

Some background:
VMware offers you some tools to resize a virtual harddisk. That step will offer you more space on your virtual hd. No more - and no less.
That means you have some additional work to be done to give your vm access to the new extra dpace on the disk.

Things you have to know before you start:

VMWare Workstation Path: Should be something like "C:\Program Files\VMware\VMware Workstation\"
(or "C:\Programme\Vmware\VMware Workstation\")
Name of the virtual hd: A file, that ends with *.vmdk, example WinXP.vmdk
The size you need after resizing: a disksize, that you guess or calculate

Tools or software you will need:
The resizing does not all the magic for you. You will have to resize the partition(s) inside your virtual machine, too.
As I am a big fan of OpenSource and Freeware, I use the gparted LiveCD. You can use the tool of your choice to resize existing partitions (like Partition Magic, Acronis Disk Director or Knoppix Live CD/DVD which uses gparted, too).

Okay, lets go:

  1. Stop the virtual machine (absolutely necessary here).
  2. Create a backup (just copy the whole folder that contains your vm to a warm and dry place.
  3. Open a command prompt (Start -> Run or winows-key + r)
  4. cd to the VMware Workstation path:
    Example: cd "C:\Program Files\VMware\VMware Workstation\"
    or "C:\Programme\VMware\VMware Server"
  5. run the commandline-tool to resize the disk:
    vmware-vdiskmanager -x 10GB myDisk.vmdk
    Attention: You don't have to choose 10GB. You can use the size you want as long as you use GB or MB extension to let the tool know what to do here.
    The myDisk.vmdk should point to your disk and it should reflect your diskname.
    In my case, it was
    vmware-vdiskmanager -x 15GB "D:\vmwares\xpclient1\XPDisk.vmdk"
    That system isn't too complicated and I guess you find out what to do with it.
    You will find all parameters here: vmware vdiskmanager
  6. Mount the "gparted LiveCD" iso with your virtual machine and use it to boot from.
  7. Resize the existing partition(s) as you need them and let the tool do the rest.
  8. Get a cup of coffee ... it may take some time.
  9. Remove/unmount the gparted iso.
  10. Now you are ready to start your VM in a normal way.

Maybe WindowsNT based systems (like WinXP) come up with a filesystem check, but that is nothing to worry about. Just let windows do its checks and your machine will be fine after that.

Here are some messages you will receive after the resizing is done:

Grow: 100% done. <------ That grow info will show you the progress of resizing
The old geometry C/H/S of the disk is: 1827/255/63
The new geometry C/H/S of the disk is: 2610/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

If you see that message, everything worked fine and the job is done!


Another way is to use the VMware Converter Standalone. That will provide you a fully graphical way of resizing. You get the Converter here: Download VMware Converter Standalone
 

  1. Turn off the virtual machine - same as in the method above
  2. Start the VMWare Converter Standalone
  3. Open the Convert Machine wizard
  4. Select 'VMware Workstation or other VMware virtual machine as the source and destination system
  5. Choose 'Select volumes and resize to save or add space'

With the second method you will also be able to us a old Acronis True Image backup as a source for a new vmware.

Hope it helps!
 



Zuletzt geändert von Bikerpete (admin)  am Jan 14 2010  um 8:16 AM
<< mass text changer for free: Notepad++ to replace text in files Übersicht Improved Win7 System-Settings Overview >>


Info

Buy me a coffee ...


 
Top! Top!