I've Windows Vista installed as a guest under Ubuntu Linux using VMWARE Workstation 6.0. This is done for testing purpose and browsing a few site that only works with Internet Explorer. Since I only use it for testing I made 16GB for Vista and 5GB for CentOS and 5GB in size for FreeBSD guest operating systems. However, after some time I realized I'm running out of disk space under both CentOS and Vista. Adding a second hard drive under CentOS solved my problem as LVM was already in use. Unfortunately, I needed to double 32GB space without creating a new D: drive under Windows Vista. Here is a simple procedure to increase your Virtual machine's disk capacity by resizing vmware vmdk file.
Required Tools
- VMWare Product : Working Virtual machine and Vmware Workstation (it will work with other vmware product such as GSX Server and VMware Server).
- GParted LiveCD : Third-party utility to expand the size of a virtual disk.
Step # 1: Shutdown The Guest Operating System
Shutdown and poweroff Windows Vista.
Delete all your snapshots from snapshot manager by visting VM > Snapshot Manger. Since you are going to resize you virtual disk, these snapshots going to create a problem for you.
Backup your entire virtual machine. My VM is located at /share/vms/WindowsVista. So I made a backup:
# cp -arv /share/vms/WindowsVista /safe/path/to/vm/05062009/
OR
# rsync /share/vms/WindowsVista user@lan.nixcraft.net.in:/.dumps/vms/05062009/
Another option is you can clone your guest in VMware, if you want to keep the existing virtual machine configuration by visiting VM > Clone option.
Step # 2: Increase Your Virtual Machine's Disk Capacity
Open shell prompt and type the following command:
# /usr/bin/vmware-vdiskmanager -x {diskSize}GB yourvm.vmdk
If you are using Windows operating host system change directory to C:\Program Files\VMware\VMware Workstation or add this to your PATH settings. Click on Start > Run and type cmd to open Windows shell prompt:
vmware-vdiskmanager -x {diskSize}GB "c:\vm\yourvm.vmdk"
OR use full path as follows
C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager -x {diskSize}GB "c:\vm\yourvm.vmdk"
Example: Increase Size to 32GB
Linux host example:
# /usr/bin/vmware-vdiskmanager -x 32GB /share/vms/WindowsVista/vista.vmdk
Windows host example:
C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager -x 32GB "c:\vm\centos.vmdk"
Step # 3: Expand The Size Of a Virtual Disk
Now, disk size is increased but operating system will only show 16GB used and 16GB unused. To add new 16GB to C: (i.e. expand the size of a a virtual disk), use GParted. You will need to use a third-party utility such as GParted to resize the expanded partitions. The GParted application is the GNOME partition editor for creating, reorganizing, and deleting disk partitions. GParted is a live Linux based CD. Download latest version here or use wget command as follows:
$ cd /tmp
$ wget http://nchc.dl.sourceforge.net/sourceforge/gparted/gparted-live-0.4.5-2.iso
Start Vmware
Select your VM (such as Windows Vista). Click on VM menu > Select Properties > Select CD / DVD > Use ISO Image > Click on Browse > Select /tmp/gparted-live-0.4.5-2.iso > Ok > Save.
Start your virtual machine. Press F2 to visit Vmware BIOS menu. Make sure boot option order is set as follows (CDROM drive should be the first boot device):
Hit [F10] function key to save and exit BIOS menu. Within minutes you will boot into Gparted Live CD.
Select your disk (such as /dev/sda1).
Click on Resize/Move button.
Set a new size to maximum size (it is displayed on the screen itself).
Finally, hit Resize/Move button to start the process:
Depending on the amount (disk size and storage type) and type (resize or move) operation resize may tae a long time. After sometime Gparted will give out the final confirmation about disk resize operation (you must not get any error on screen):
Click on exit button shutdown Gparted.
Step # 4: Fix Windows MBR and Partition Issue
- Get your Windows Vista CD and insert the installation disc.
- Click Repair your computer to fix MBR and other small issue.
- When the repair process is complete, click Finish.
Step # 5: Verify Your Disk Space
Make sure the virtual machine configured to start from a hard disk by pressing F2 key. Save and exit BIOS. Once done, you should able to boot into Windows vista (chkdsk may run at startup). Just verify your disk space:
Recommend Readings:
- The official Vmware website and documentation.
- A Stop error occurs, or the computer stops responding when you try to start Windows Vista.
- Resize Windows Partition with Open Source Software.
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- 10 Greatest Open Source Software Of 2009
- My 10 UNIX Command Line Mistakes
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email this to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: Jun/18/2009









{ 12 comments… read them below or add one }
Thanks a lot for the detail.
It’s still to much trouble… I’ll give up.
For the Windows VM you coud also have used the build-in diskpart.exe.
@Muster,
Thanks for sharing diskpart.exe. I had no idea about it.
There is another solution that allows you to define growable disk size, at least in
Windows guest, but I don’t remember now how.
The warm feeling I get when someone is thoughtful enough to say thank you for having been helped far outweighs the empty one
I get when there’s no feedback at all
my question could be stupid ….but if you can use vmware-diskmanager to increse a partition …it will be posible to use to de-crease it ?
Great step by step just got some trouble then now it work like a charm, i just get the turn around..
@ ulver if you want to de-crease it.. But go to gparted first to deacrease it using resize. Then delete the unallocated part of the this. the use repair from windows.
Actually i use Windows 7 RC
You can use system restore cd 1.1.2 this is very light tools gparted is included in this iso.. its only 239mb…
Download it then burn it.
I’ve follow that step by step but when I open gparted in my vmware console, there’s disable option for resize button. I am using xubuntu 9.04 host and FreeBSD 6.3 Guest. I just don’t know where the wrong part is.
HI
I installed Ubuntu as guest OS under windows XP(host system). Now i have a problem of disk space for ubuntu. How can i increase the ubuntu disk space…
Thank you
I am running ubuntu 8.04 using VMWare on Windows XP. I downloaded the vmware-vdiskmanager through the VDDK Development Kit (Since I am using VMWare Player. I have read a few posts stating that Ubuntu will automatically recognize and increase the vmdk but that is not happening. Any comments/suggestions?
Thanks.
I usually use the Free download:
VMWare Converter
Tell it the source VM image
Tell it the folder to put the new image into
Tell it to enlarge the drive
don’t know if this works with VM Player… I’m running workstation 6.x