25

I have a VMware Player virtual machine setup, running Ubuntu 10.04 as the a guest OS.

The VM was created on a 20GB virtual drive, with a single partition for working space. Finally I got to the point where I need to expand the size of the virtual drive. Resizing the drive itself, adding some 10GB, was easy via the VMware Player menus. I now need to resize the main partition itself (I prefer this over creating a separate partition and mounting it).

According to GParted, I now have the following partitions:

enter image description here

My question is, how can I increase the size of the Filesystem partition to include the free 10GB?

From information I found online, it looks like one limitation is the fact that he swap partition is immediately adjacent to the filesystem, so my understanding is that first thing would be to move that partition to the end of the volume. How can this be done?

Also, some sources suggest that the system should be booted from a LiveCD, so the filesystem is not the boot partition, and thus make it easier to resize. As mentioned above, I run a VM, so I am not sure how to boot it from a LiveCD. Any ideas?

  • You tell vmware to boot from the cd image, just like you did the when you first installed Ubuntu in it. – psusi May 13 '13 at 16:02
  • @psusi - thanks. The VM is run with VMware Player, not VMware, so i am not sure where to tell it to boot from CD. Also, obviously, I need to boot the VM on which I currently work form the CD. The only time I remember pointing to the ISO was when creating the VM, and there everything was done automatically. – ysap May 13 '13 at 16:44
35

I was just doing exactly that a minute ago. What you want to do is:

  1. In the machine's settings point the CD Drive to the .iso file with your Ubuntu LiveCD. You may also need to make sure the "Connect at power on" check box is checked.
  2. Power the virtual machine on and hit F2 with the focus inside the machine.
  3. Once inside the BIOS move to the Boot tab and select CD-Rom as primary boot device.
  4. Run gParted - I think it's always there.
  5. Destroy the swap partition: swapoff, delete the extended and linux-swap partitions.
  6. Resize your primary partition to desired size.
  7. Allocate your swap back again to whatever you like - create an extended partition and then allocate as linux swap. Remember about swapon :)

And that's it. You now have a big primary partition!

In my case you'd need to have Jedi reflexes to get into BIOS by pressing F2 on the splash screen - the boot delay is just too short. What you can do to slow it down is go to your vm's .vmx file and type in something reasonable like:

bios.bootDelay = "5000"

For 5 seconds of boot delay.

  • Thanks, by this time, I already added a partition past that swap partition. I then mount that filesystem in my primary filesystem, and continue as usual. However, your answer will probably be valuable next time I need to increase the drive size :-) – ysap May 23 '13 at 19:16
  • Very nice. At least in Fusion 6, the quotes are not allowed. Use: bios.bootDelay = 5000 – Brent Faust Nov 21 '13 at 5:23
  • Really big thank you for bios delay option. You saved a lot of my time :) – Roman Badiornyi Nov 22 '13 at 13:27
  • 3
    This worked perfectly. You can also use bios.forceSetupOnce="TRUE" as an alternative to bios.BootDelay kb.vmware.com/selfservice/microsites/… – OscarRyz May 21 '14 at 18:44
  • 1
    This worked great for me, but I'd like to add that I had to go to the virtual machine Settings > CD/DVD and check the box that says "Connect at power on". Using VMWare Player 7.0.0. – Chuck Claunch Feb 20 '15 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.