How to expand a system disk for a VMware virtual machine running a Linux OS hosted by a VMware Server


To increase a virtual machines system disk running a Linux OS is a two step process.

Firstly we need to expand the disk and then we need to increase the partition size inside the host.

Expand the disk

Turn off the virtual machine that you wish to administer.

Open a command prompt and change directory to C:’Program Files’VMWare’VMWare Server or C:’Program Files’VMware’VMware Workstation depending upon what product you are running.

Run this command to expand the virtual disk: vmware-vdiskmanager -x 20GB "My harddisk.vmdk"

In my case I would like to increase the disk to 20GB so substitute your value. Include the full file location for the vmdk file and use quotes if there are spaces in the folder and/or filename

image001

The disk expansion should complete successfully

image002

Increase the partition size

Download the GParted Live LiveCD available here http://gparted.sourceforge.net/livecd.php

Gnome Partition Editor is a small bootable livecd that we can use to boot your VMware virtual machine so that we can adjust the partition size using the Gparted utility

In VMware server, edit your machine settings and configure the CD-ROM to use the Gparted .iso file and ensure that it is also ‘connected at power on’

Power your virtual machine on. You may find that you also need to enter the virtual machines BIOS settings to change the boot order so that the CD-ROM drive is first on the list. To do this press F2 when you power on the virtual machine and select the ‘Boot’ option. – and + will change the items boot order sequence

image003

The iso image should now boot and the Gnome Partition Editor menu screen appears. Select the Gparted Live (Default settings) option

image004

When the ‘Package configuration’ screen appears select the ‘Don’t touch keymap’ option

image005

Select your language from the list when prompted

image006

Select the mode. Default is 0 ‘Continue to start X to use Gparted automatically’

image007

Once it completes the boot process the livecd GUI is loaded

image008

Select your partition and click on the resize/move button. As you can see the partition I want to resize is LVM2 and not supported by Gparted!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s