Increasing Hard Disk Size on your Virtual Machine ( VMware )
Firs thing to do is locate the location of vmware.exe on your PC typically it will be in
C:\Program Files\VMware\VMware Server or VMware Workstation
Once you have located your vmware.exe file open up command prompt on Windows.
[Start -> Run -> type "cmd" in the window then press ENTER
Now navigate into the vmware.exe directory , in this case simply
C:\Program Files\VMware\VMware Server
From here type
vmware-vdiskmanager -x 25GB image.vmdk
- 25GB in this case we would like to make the NEW size 25GB , this method will not remove any exisiting files
- image.vmdk , Name of your Virtual Machine disk my example was Ubuntu.vmdk, if for some reason it doesn't work type the entire path of the vmdk file for example
vmware-vdiskmanager -x 25GB D:\Virtual Machines\Ubuntu\Ubuntu.vmdk
vmware-vdiskmanager -x 25GB "D:\Virtual Machines\Ubuntu\Ubuntu.vmdk"
Extending Partition / Hard Disk
Now that you have used the VMware diskmanager to increase size if the Virtual Disk Space , this will create a new parition that 10GB in this case
(original 15GB + 10GB increase).
This increased size will not automatically show up when we reboot our Virtual Machine.
We need to carry out a few extra steps to make use of this newly created space , this involves extending the partition or merging two partitions together.
Before trying to extend your harddrive to include the newly created partition, you will need to open vmdk file in a second virtual machine. The reason for this is that you cannot extend a partition on a drive that you are actually using system files on, It has to be set as the secondary drive.
So go through the steps of making a new virtual machine and give it 4-5GB or so it doesn't need to be huge. You wont actually need to load any Operating system on it if you use the LiveCD. Before you run your second virtual machine you will need to add the harddrive you wish to increase onto that system , see screenshot
Now that you have created your secondary virtual machine, Boot it up and in order to extend our virtual hard disk we will use a inbuilt linux tool called gparted , there are also many other partitioning programs out there including fdisk and many others.
Now we want to load up our ubuntu LiveCD instead of having to install an Operating System, To get your virtual machine to boot up from your LiveCD do the following.
- Use Daemon Tools or any other mounting program and mount your Ubuntu.iso image.
- Start your virtual machine and soon as it starts press ESC to enter the boot menu and from here select CD-ROM
- This will start your secondary virtual machine with the Ubuntu LiveCD
Running Gparted ( Partitioning Program )
To run gparted simply enter the terminal window and type "gparted" , and this will open the gparted gui window. ( Remember to issue this command with root privledges )
Once gparted has started you will see a window similar to below, We see two parition that we want to join together below circled in red, To extend the exisitng partition to the unallocated partition use the resize button to increase the size of the exisiting partition to increase the size.
( Ensure the harddrive is unmounted, and swapoff )