I have been a VMware Workstation fan-boy since 2002. I’ve used the product since almost the beginning, using version 3.1. The latest version is 7.1.
One of the things I most enjoy about using virtualization is the recoverability and time-savings it provides. Having spent a number of hours and days/months rebuilding servers and desktops and tweaking my settings to the way I like them, I have been burned more times than I know of due to OS level errors or just some funky thing happens where the only option is to re-install Windows.
Since bad things always happen and having all my eggs in one basket creates additional risk, about five years ago I started creating virtual machine images for specific application functions/roles. For example, I have a virtual machine image just for Office and e-mail. I have another virtual machine image just for development; where Visual Studio, third party apps, my custom configuration settings, etc., reside. I even have another virtual image for testing/demoing software downloads. This one thing alone is what may cause any system to become unstable over time…
Today, I need to expand my .vmdk file for my development virtual machine so that I can install IBM’s DB2. My .vmdk file size is was 65GB and I need to increase it to 73GB. Now, if this was a physical PC, this typically isn’t an easy task – especially a HDD that is full. Replacing the drive typically requires re-installing Windows, all your apps, settings, etc., the thing I was saying is a waste-of-time earlier…
Since I have 2TB drives for both internal and external storage on my system, there is plenty of room for growth. However, I still try and be conservative with my storage, because I still need to backup my .vmdk across drives and/or network; which adds addition time for file copies.
The way I increase my virtual machine’s .vmdk image file size is two-fold.
- Use VMware Workstation console to expand the .vmdk to desired size. I’m using VMware Workstation version 7.1.
- Use the open-source Gparted ISO to change your drive’s partition information. GParted is a free partition manage that enables you to resize, copy, and move partitions without data loss. As of this writing, version 0.11.0-7 is the latest. I just so happen to be using 0.5.2-9; since it works and I have not had a need yet to upgrade.
Before you do continue, you should first back up your virtual machine’s image files – especially the .vmdk file. Just in case something bad happens! Because you know Murphy is always waiting for you!!!
The first thing you need to do is go to your virtual machine settings and under Hard Disk, click the “Utilities” button, and select “Expand…”. From here, you can change your .vmdk’s file size.
Here I changed my size to 73.0GB. Hit “Expand” and prepare to wait, depending on how much you’re expanding. This i
When done, you should get a friendly message as shown below. Click “OK”:
Next, under your virtual machine settings, select your CD/DVD drive, then under “Use ISO image file”, click “Browse…” and select your downloaded GParted .iso file. Click “OK” when done to save:
Start your virtual machine and the GParted O/S should come up:
Accept all the defaults by pressing enter a few times…
After exiting GParted, it will shutdown and unmount the filesystem. You may see something like:
Finally, the main screen will appear. Shown below:
From here, you want to select your drive. For example, /dev/sda1, which is my C: drive and then click the “Resize/Move” toolbar button. A Resize/Move dialogue window will appear as shown below:
Click the right-arrow and drag the arrow to expand the partition to use the remaining space. This will be the free space that you added to your .vmdk file from VMware Workstation.
Before:
After:
Finally, click the “Resize/Move” button. You will then see the main GParted window again. You must click the “Apply” toolbar button to make your changes stick.
Sometimes it’s a little bit tricky, but hit the “Exit” toolbar button and an Exit dialogue window should appear. Select “Reboot” and GParted will be gracefully shutdown. Sometimes this can take a while, depending on how big of a partition you have.
Here is the shutdown screen:
When GParted is shutdown, your system should reboot and you should see your Windows splash screen as shown below.
Then followed by a CHKDSK, since your partition table has been change. Windows will now run a repair on the filesystem. Let this run and don’t interrupt.
Once complete, you should be presented with your Windows logon screen.
At this point we are done. From Windows, I will see the extra drive space. When things begin to get tight again, I will simply follow the same steps I presented to expand the .vmdk file again.
Hope you found this tip useful!