Menu

How to Add Extra Disk Space to Ubuntu in VirtualBox

It didn’t take me long to find out that my Ubuntu system in the VirtualBox has an inconvenient issue. It ran out of disk space! The original plan is to use it for light experiment, so I only allocated 6GB of disk space for the Ubuntu system. But since I liked it and experimented with it a little bit more, it is currently 94% utilized.

Fortunately, the native virtual disk image (VDI) file format allows you to dynamically change its size. To do that we will need to use the VirtualBox management tool “VBoxManage” to handle it. You can find it in the VirtualBox installation directory, for my case it is in “c:\Program Files\Oracle\VirtualBox”.

3. Create a new partition with the newly allocated disk space

After changing the disk space with VBoxManage, the newly added disk space is shown up in the virtual system as unallocated. We need to create a new partition to use it in the virtual system. I am using a free tool called Gparted for this purpose.

3.1. Mount the Gparted image

After you download the ISO image of the Gparted, mount it to the CD.

3.2. Boot into the Gparted System

When booting from the Gparted image, you need to press a whole bunch of enter kay. Then you will see the unallocated disk space in the following window.

3.3. Create a new partition.

4. Use the new partition in the Ubuntu system

After creating the partition, reboot with hard disk, check the devices in the system

sudo blkid

You will be able to see the new partition in the list.

I wanted to mount the /dev/sda3 as my /data directory. So I modified the fstab file as following.