How to Resize a VirtualBox Ubuntu VM

I have an Ubuntu virtual machine installed on my Windows 10 box. I use it for development purposes.

It was initially set up with a default size of 10GB. But after a while I started getting low disk space errors. So I needed to increase the size of the virtual disk.

This is a 2 step process:

  1. Use the Virtual Media Manager that from the VirtualBox File Menu. Increase the size of the disk with the slider.
  2. Inside the Ubuntu VM, use GParted to expand the file system to use the extra space.

These steps are expanded upon here:

Here is a picture of the Virtual Media Manager dialog box accessed from the file menu of VirtualBox. Just use the slider at the bottom to make more space available. I have already set mine to 50GB (from the default 10GB when I created the VM).

NOTE though that this only ALLOWS the virtual machine to use more storage, the virtual machine’s file system still needs to be resized to use this extra space, see steps below.

Now, to resize the filesystem on the Ubuntu virtual machine, you use a program called GParted. Just use the command “sudo apt-get install gparted” to install it, then type “gparted” to start the GUI

There is shows /dev/sda1. You can right click on it to resize it. In this case, since I chose 50GB in step 1 above, I can expand it from 10GB to 50GB.

Just right click on the line starting with /dev/sda1 and choose Resize/Move. Enter the new size in the dialog box and click “Resize”.


Then click the checkbox near the top of the screen. This should be done in a few seconds.

Voila!

Advertisement

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 )

Connecting to %s