I powered off the VM and on the VMware side increased the allocated disk space. I did this by Edit Virtual Machine Settings -> Hard Disk -> Utilities and so forth. It then warned me that I should increase the partition size within the guest VM. and i dont know how to make the machine know it and i dont know where my CD is..
You don't need an actual CD. Just get the .iso image from http://www.ubuntu.com/download.
Use VM Workstation to expand the VMs disk: Settings > Hard Disk > Utilities > Expand (Disk Capacity) Start VM
On linux
From the above you should see the Disk size has increased to the value you chose in VM Workstation, but the linux VM does not know how to use it yet.
Download GParted (linux gui disk utility) download the iso (for me gparted-live-0.19.1-4-amd64.iso) burn a bootable disk from this iso
Make sure your VM connects to the CD/DVD you are going to place the bootable dvd back into your drive bay, but you need the VM to connect to it. In Workstation right click on a running VM and you will see removeable devices. Unfortunately, the VM needs to be running before you can see the removeable
devices option. your-vm > removeable devices > CD/DVD > connect now your vm connects to the dvd, but you still have to boot from it.
Use VM Workstation to boot to bios Select your VM (NOT running) > Power On > Power On to Bios When bios menu comes up go over to Boot option Select the CD/DVD drive and hit (+) to move it up, but (+) doesn’t work!! Use the (-) on the other options to move them down below CD/DVD F10 save/quit
Now you are booting from GParted I picked defaults, but still had to pick a keyboard, US English We are now at the GUI for GParted You should see your current drive on the left, followed by Extended>Swap, followed by the expanded-unallocated disk space you added
Using GParted Expand the Extended>Swap First Select which ever partition is adjacent to the unallocated portion. In my case this was the Extended>Swap Partition. NOTE: Make sure you selected the Extended, NOT the Swap! Swap is inside the Extended. Hit Move/Resize You should see the Extended partition with unallocated space to the right. Expand the partition to consume all / most of the unallocated space. Apply the change ( you probably can do multiple operations at once, i did not) after a bit gparted shows the changed
Move the Swap to the far right of Extended Partition You can see where this is going... Select the swap, move to the right, now unallocated is on the left of it. again I applied this now select Extended and shrink it now unallocated is between the partition you want to increase and extended
Increase your Partition Unfortunately, its like one of those puzzles you have to slide all the parts until you get to the one you want.
Shutdown GParted
Select you VM > Power> Power On to Bios, move CD/DVD down below HD
Now your VM is up and running with more space
Eject GParted DVD and/or Removeable Devices> Disconnect CD/DVD
You should be good to go!
If you happen to be running this on an M1 mac in a virtual machine of some kind, you are essentially out of luck. The current iso file for gparted does not support this instruction set (
arm64
), so you'll be forced to make a new partition and remount various directories.I know it sucks.
For ARM architecture VMs you aren't totally out of luck, especially if you have set up your VM with LVM. Even though there isn't a gparted bootable ISO for arm64 architectures, it has been ported to arm64 architectures and should be available in your distro.
Expand your hard drive using your hypervisor's virtual disk resizing process. Then boot your VM and make sure you have gparted installed. Use gparted to resize the LVM pv. Then use LVM commands to expand the lv you want.