Resize or Enlarge a Virtual Hard Drive in VMware Server
Something normal in this world of virtualizations is that we are left with a small virtual HD and we need to expand it. So since it's the virtual world, it's easier than having to buy a bigger one, with a simple command we can expand our VMware virtual disks, VMDK.

First of all, with the VM powered off, From another computer we run the following command to convert the current disk into a simple but expandable disk:
VMware-vdiskManager -r DISCO_VMDK_ORIGINAL -t 0 DISCO_VMDK_EXPANDIBLE.

… We wait for him to create this new album… It will take depending on the original disc,

Ok, Now we will expand its size,

About the new album we just created, we have to expand the size that we are interested in having in total, In my case I want my new album to occupy 8 Gigas, So we run the following command:
VMware-vdiskManager -X TAMAÑO_GB DISCO_VMDK

… We wait while the disk expands…

GOOD, once this new disk has grown we must replace it in the VMware console. So we are opening it up…

Then, In the properties of the virtual server to which we have extended the disk we must remove the original hard disk and add the new one that we have just created.

GOOD, now what is needed is to tell the virtual machine, to your operating system that has been resized, in the case of a Windows (be XP, 2003, View or 2008) we can do it, Restarting the virtual machine in safe mode, by pressing F8. Once we are inside the VC, we must run a command from MSDOS: diskpart.
Within that command we must know which volume has changed, Inside 'Diskpart’ We'll run 'List Volume’ to see what volumes we have in our S.O., it will show us the logical disks/volumes, we select the one we have enlarged, in my case it will be the volume 2, which used to occupy 6Gb and now 8Gb, So we select it with the command 'Select Volume 2’ and extend it with the command: 'extend'. Once executed, we will be able to start the VM in the usual way.
VMware Server Commands:
vmware-vdiskmanager nombre_disco OPTIONS
Options:
-c : Create disc
-d : Defragment the disk
-n : Rename the disk
-r : converts the disc to characteristics that are indicated to it
-x : Expands disk capacity
-a : (Only with the -C Adapter Type operator (ide, buslogic or lsilogic)
-s : Capacity of the Virtual Disk
-t : Disc Type
Disc Types:
0 : Single disc, which expands when it needs space
1 : just like the 0, but it breaks every 2 GB
2 : disk, with reserved size,(it does not grow)
3 : just like the 2, but it breaks every 2 GB
The capacity can be specified in , Kb, Mb or Gb.
The accepted values are included among these:
IDE Adapter : [100.0MB, 950.0GB]
SCSI Adapter: [100.0MB, 950.0GB]
e.g 1: vmware-vdiskmanager -c -s 850Mb -a ide -t 0 mi_disco.vmdk
e.g 2: vmware-vdiskmanager -d mi_disco.vmdk
e.g 3: vmware-vdiskmanager -r disco_fuente.vmdk -t 0 disco_destino.vmdk
e.g 4: vmware-vdiskmanager -x 350Gb mi_disco.vmdk (by default is of type 0)
e.g 5: vmware-vdiskmanager -n disco_fuente.vmdk disco_destino.vmdk
Vmrun:
vmrun command [PARAMETERS]
options:
List lists the VMs, that are working
start Path of the vmx file starts to VM
stop Path del vmx file Para a VM
reset Path of the vmx file Restart a VM
suspend Path del vmx file Suspende a VM
vmx file Path installtools to install the vmware-tools on VM system
Example:
vmrun start "/var/lib/vmware/Virtual Machines/Windows 2000/ w2k.vmx"
Vmware-mount:
VMware-mount [options] [letter:] [Virtual PathDisk]
Options
/v:N Mount Virtual Disk Partition N. Default N Is Worth 1.
/p Shows virtual disk partitions
/d Disassembles the mapped drive
/f Force disassembling the mapped drive
Example: vmware-mount V: c:vmsistema.vmdk
www.bujarra.com – Héctor Herrero – Nh*****@*****ra.com – v 1.0








































