Sometimes when we use a VirtualBox virtual machine, when we create a virtual machine, we do not take into account the size of the hard disk, and then we may not have enough disk space.
The following methods can help you expand the storage space for your virtual machine (for example, Ubuntu).
1. In the host machine into the VirtualBox installation directory (usually in C:\Program Files\oracle\virtualbox), execute the following command
>vboxmanage.exe modifyhd "F:\VirtualBox vms\ubuntu 14.10\ubuntu 14.10.vdi" --resize 35840
(Please modify the Red Section yourself.) )
2. Go to Ubuntu virtual machine, download gparted partition editor
>sudo apt-get Update
>sudo Apt-get Install GParted
3. Open GParted, you can see the following interface, the disk has a unpartitioned space, select this unpartitioned space to create a new. (Partition/dev/sda3 is the partition I just created)
4. Mount the new partition. For example, I have mounted the new partition in the/home/android directory.
Add the following configuration by editing the/etc/fstab file
/DEV/SDA3/HOME/ANDROID/EXT4 Defaults 1 2
5. Execute the Mount partition.
>sudo mount-a
VirtualBox extended Ubuntu disk space