Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

vm

vdi

share|improve this question

migrated from serverfault.com Nov 19 '12 at 13:41

This question came from our site for professional system and network administrators.

    
Is this a bug then? –  jeremyjjbrown Nov 19 '12 at 1:59
    
over 1000 views and no upvote? –  jeremyjjbrown Aug 20 '13 at 13:25

4 Answers 4

/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.

share|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.
share|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 Nov 22 '12 at 7:09

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.

share|improve this answer

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"
share|improve this answer
    
Can you please describe how to do that to make this a good answer worth keeping? –  David Foerster Nov 11 at 12:03
    
I put details on the edited answer. –  Survivor Nov 11 at 14:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.