I have Ubuntu 12.04 running on VirtualBox 4.2.4 in a Dynamic VDI disk with the limit set to 8gb on a real ext4 partition with more than 40gb of empty room available. However, the VDI it does not expand to the limit. 8gb is more than enough for what I want to do.

How do I make the rest of the space available? Available space in / and .home is 41kb.



  • Is this a bug then? – jeremyjjbrown Nov 19 '12 at 1:59
  • My hack-ish solution was to just add another virtual drive. BTW I didn't test this myself, but this page suggests that the issue is caused by the fact that the swap partition is placed after the main partition. I'll try rearranging partitions next time I'm installing ubuntu guest and post a follow-up. – Андрей Беньковский Apr 4 '16 at 18:32
  • You probably made a partition that is too small, explaining the full disk. – Dr_Bunsen Jun 20 '19 at 9:20

I fixed my VirtualBox machine by setting the path on Windows 7 host machine to include the VirtualBox install directory (Steps):

  1. click start button
  2. Right click computer
  3. Click Properties
  4. Click Advanced System Settings
  5. On [Advanced] tab click [Environment Variables] button
  6. Under System Variables, scroll down to path and click [Edit]
  7. Add everything in quotes to end of line ";C:\Program Files\Oracle\VirtualBox\"
  8. Click [Ok]

Next move to the directory of the VirtualBox Disk (under username\VirtualBox VMs) taken from (https://forums.virtualbox.org/viewtopic.php?f=7&t=52351)

  1. open cmd and move to the VirtualBox drive
  2. enter this command: VBoxManage showhdinfo
  3. Take note of the UUID of the disk.
  4. enter this command: VBoxManage modifyhd UUID_of_the_VDI_disk --resize 80000 (this makes the disk 80 gigs, adjust to the size you want)

IMPORTANT STEPS START HERE: Next boot the Virtual machine on LiveCD (Install disk) (taken from Extending Ubuntu Partition size with the unallocated space (swap is between these two))

I can't stress this enough:

It is highly recommended to backup any important files before doing resize/move/extend operations.

The way to do it, is by deleting the swap partition, extend the partition that you want, and then re-create the swap partition.

Swap partition can only be deleted after swap is turned off:

SWAP off: sudo /sbin/swapoff -a SWAP on: sudo /sbin/swapon -a

The steps:

  1. Boot from the Ubuntu LiveCD
  2. Open terminal, and turn swap off
  3. Install GParted
  4. Extend the partiton that you want, but leave space for swap
  5. commit the changes
  6. create swap partition
  7. turn swap on

Note: If your swap is not your primary hard drive, then see SwapFaq on how to activate the swap partition

It is highly recommended to backup any important files before doing resize/move/extend operations.

| improve this answer | |

Had the same problem on Ubuntu 15.04 running Ubuntu Gnome 15.04 in a Virtual Machine. It seems that despite it being 'Dynamically allocated storage' VirtuaBox wasn't increasing it and I was down to my last 100MB and it wouldn't let me update via Software Updates. The solution was to perform the update via the terminal.

sudo apt-get upgrade

This seemed to force VirtualBox to create the additional storage, it jumped up to 500MB free as soon as the update started.

| improve this answer | |
  • That's really odd. I ran dpkg -i and apt-get update got a message about being out of space, but apt-get upgrade worked on Ubuntu Gnome 16.04 – Josiah Jun 1 '16 at 14:16

/tmp is going to be a tmpfs - i.e. a filesystem stored in RAM. So unless you assigned you have ~800MB free RAM in your VM, it isn't going to be enough to hold the ISO.

This is probably not what you intended: just save the ISO in a 'real' directory (e.g. /home/<username>) and it should work just fine.

| improve this answer | |
  • So if I am trying to load 1+GB of files into MongoDB and the VM memory is set to 1024 is it likely that I would be running into the same issue? – jeremyjjbrown Nov 19 '12 at 0:22
  • Where is the file stored? If it's disk-backed, then no - MongoDB should read the file in chunks and load it rather than loading the entire file at once. By storing your ISO in /tmp, you're forcing the OS to store the entire ISO in memory. – Jay Nov 19 '12 at 0:24
  • dbpath=/var/lib/mongodb I'm getting the computer is running out of disk space message from the OS. Apparently, my image was misleading. – jeremyjjbrown Nov 19 '12 at 0:26

It doesn't seem to be related to the growth of your virtual disk as you should have an error message from VirtualBox telling you that it can't allocate more disk space for your virtual disk.

Some ideas:

  • Did you use a special partitionning scheme in your VM?
  • What's the result of df -h in your VM?
  • You may use baobab to search what consumes all your / space.
| improve this answer | |
  • +1 for baobab. Although it did not tell me why the vdi won't grow it's going to be useful in the future. – jeremyjjbrown Nov 22 '12 at 1:02
  • Thanks. From what I can tell, your vdi don't grow because the OS inside don't need it to grow. I mean, surely your /tmp or even / filesystem is full in your VM. The filesystem won't expand by itself. What df -h tells you? – Christophe Drevet-Droguet Nov 22 '12 at 7:09

Try setting up a shared folder, it may be a solution to your problem.

  1. From VirtualBox enter your VM settings > shared folders and add a new one; choose the path in your host machine name it FOLDER_NAME and check Auto mount and make permanent.
  2. Install Guest additions; look at this to see how
  3. Make a folder on your guest VM to point to the folder created on the host, just create a new folder, for example /home/"your_user_name"/shared
  4. Mmount the shared folder: sudo mount -t vboxsf "FOLDER_NAME" /home/"your_user_name"/shared
  5. To make the mount automatic, add mount -t vboxsf "FOLDER_NAME" /home/"your_user_name"/shared" to the end of "/etc/rc.local" before "exit 0"
| improve this answer | |

You can use this easy solution: In your Terminal type this command

VBoxManage.exe modifyhd "path-of-your-disk" --resize 20000

You can find the path of your disk under the configuration of your VM / storage / yourVM.vbi (path on the right)

| improve this answer | |
  • He probably made an partition in the VM, thus resizing the disk has only an influence on the host. – Dr_Bunsen Jun 20 '19 at 9:20
  • So it's not about the hypervisor ! he should modify the partition inside the VM...!! – omarhamdaoui Jun 21 '19 at 10:17
  • That is indeed what I meant. – Dr_Bunsen Jun 21 '19 at 12:48

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.