0

I have already browsed quite a bit to find a solution - but ran into several problems.

I have three VM (Windows Host).

  • Ubuntu 16, 32bit, I don't use it at all
  • Ubuntu 16, 64bit. (Installed: MongoDB, Node, NPM, Vim, Git)
  • Nothing yet, it should be for Ubuntu Server later.

When I run my VM Ubuntu-64 a message appears saying there's only 300 mb left one the hard disk, which is strange given that the previous message gave even less.

I tried to go into the vdi file (on windows) to edit it don't know how (tried Notepad - sorry if it's a silly attempt - but it says too large to be opened).

But on top of all that I don't understand how all three virtual hard disks can show "virtual size 8GB" and "actual size 8GB" when I haven't used all three of them at all - or not that much? (The VM I've used these past few days is maybe...three days old!!)

I'm really scared of trying anything just based on what I find - I'd really like not to have to go through the whole installation of my programs again.

Can anyone help me? I really apologize for the newbie question - but I'd really like to continue using that VM (the 64bit), I'm having the time of my life learning Linux commands and all.

UPDATE - removed Ubuntu 32 and Server VMs

This is the output of df -h

~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            630M     0  630M   0% /dev
tmpfs           130M  4,4M  126M   4% /run
/dev/sda1       6,5G  5,7G  460M  93% /
tmpfs           649M  236K  648M   1% /dev/shm
tmpfs           5,0M  4,0K  5,0M   1% /run/lock
tmpfs           649M     0  649M   0% /sys/fs/cgroup
sharedbox       373G   83G  290G  23% /media/sf_sharedbox
tmpfs           130M   52K  130M   1% /run/user/1000

[UPDATE] Follow the steps given by @heynnema below !

  • Could you update your question with the output of 'df -h' from a terminal in your VM ? – Soren A Jan 09 '17 at 15:12
  • 8GB is really tight. Just by installing a few updates and other software you will be running out of space soon. –  Jan 09 '17 at 15:27
  • Ok...what should I do to at least save some of my installs? It may sounds silly but I've already spent so much time! – timotheap Jan 09 '17 at 15:31
  • 1
    The df-h appears to have been run from your hose machine, not one of the VM machines. Will you give the output of the df -h from one of the VMs you are trying to save? – L. D. James Jan 09 '17 at 15:32
  • @L.D.James Not at all, I ran df -h from the VM, Ubuntu Guest, I promise. I really can't confuse the black thing in Windows and the nice thing on Ubuntu! – timotheap Jan 09 '17 at 15:36
  • Thanks for the response. On closer look I see the "373G" resource is a share, not a drive. I'll test and and format the steps I have used to resolve this issue and post it soon, if your issue is still unresolved. – L. D. James Jan 09 '17 at 15:41
  • @L.D.James thanks a lot - I don't think I'll try anything else just yet - well actually I've just tried to install and run ubuntu-tweak but failed :) – timotheap Jan 09 '17 at 16:00
  • Ubuntu-tweak is now abandonware and should not be used on current versions of Ubuntu. – heynnema Jan 09 '17 at 16:05
  • You're welcome. Heynnema just posted the resolution I was formatting for you. – L. D. James Jan 09 '17 at 16:05
  • 1
    Welcome to Ask Ubuntu! Please don't edit your post and add Solved to the title. Instead, just mark one of the posts below as the correct answer by clicking the check-mark below the vote count of the post that solved your problem. – Dan Jan 09 '17 at 17:02
  • To increase the size of an exisiting VDI see https://askubuntu.com/questions/88647/how-do-i-increase-the-hard-disk-size-of-the-virtual-machine. Note that this will require a re-partitioning of the virtual drive. It is easier to start from scratch with a much larger dynamically growing VDI (20-30 GB). Also see https://www.virtualbox.org/manual/UserManual.html – Takkat Jan 09 '17 at 18:07

1 Answers1

2

The default size for dynamic disks created in Virtualbox is 8GB. This is usually not enough for most guest operating systems to thrive. Sometimes you need to increase the dynamic disk size, after initial creation, and we use the vboxmanage command.

In Windows, to see the vboxmanage commands, in an administrative command prompt window, type:

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" /?

To change dynamic disk sizes, we do, like so:

cd path_to_where_your_vdi_is_located

then

"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifymedium disk your_vdi_name.vdi --resize megabytes
or
"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" modifymedium disk your_vdi_name.vdi --resizebyte bytes
  • Change your_vdi_name.vdi to the filename of your dynamic disk.

  • Change megabytes or bytes to the final desired size.

  • note: modifyhd was used in older versions of vboxmanage.

Once the .vdi dynamic disk has been enlarged, you need to actually increase the Ubuntu partition size to fully use the extra space. Boot the VM to a Ubuntu Live .iso image (by mounting it in the "CD" drive), select Try Ubuntu, and use gparted to set the swap partition to swapoff and then to move the swap partition to the right (if it's to the right side of the Ubuntu partition), and resize the Ubuntu partition on /dev/sda1 to its maximum size. (note: if the Ubuntu and swap partitions reside in an extended partition, you'll have to resize that first).

heynnema
  • 70,711
  • fair enough and I will but I'm still wondering whether it's normal it went full so fast given how little I've done with it? – timotheap Jan 09 '17 at 15:46
  • Being as your root only has 460M left, yes. – heynnema Jan 09 '17 at 15:48
  • I've run exactly that but it says invalid command 'disk' .. – timotheap Jan 09 '17 at 16:42
  • Do the vboxmanage /? to see the exact format for the modifymedium command in Windows. In Windows they may not use/need the disk portion of the command like you do in a Ubuntu host. I'll re-edit... – heynnema Jan 09 '17 at 16:44
  • It shows exactly that : disk | dvd | floppy . Damn ! it was so close :) – timotheap Jan 09 '17 at 16:47
  • Did you get it done? What final command did you use? I'll re-edit again for posterity... – heynnema Jan 09 '17 at 16:49
  • Changed the path a little - I had VirtualBox\VMs (that's how I access it) but had to be like you said (sorry, I assumed I had a different path) but now I have Access Denied. So now I'm browsing to see how I can change that :) – timotheap Jan 09 '17 at 16:53
  • The path shown is for the .exe... you probably have to cd path_where_your_vdi_is first... I'll re-edit one more time... – heynnema Jan 09 '17 at 16:56
  • Ok I've done it all again, now it says something interesting: VBOX_E_NOT SUPPORTED, rebox sizing not implemented yet! – timotheap Jan 09 '17 at 17:06
  • Compare my last edit of the modifymedium command with what the vboxmanage /? says... I swear its got to be right. Make sure it uses modifymedium and not modifyhd. – heynnema Jan 09 '17 at 17:14
  • I've triple checked I swear. Your commands are absolutely fine (I wouldn't have had that error message otherwise), it must be something in my files and/or it half worked and the resizing is now buggy. I suggest we close the thread here as it has an answer and my problem is now elseswhere! I'll edit my original post so as not to link to the other thread. Thank you so much for your help! – timotheap Jan 09 '17 at 17:35
  • OK, but please let me know the final fix/outcome. Put @heynnema at the start of any new comment to make sure that I see it. – heynnema Jan 09 '17 at 17:38
  • This will only increase the size of the VDI but it will not increase the size of the partition we had installed Ubuntu. – Takkat Jan 09 '17 at 18:08
  • @Takkat correct, then you have to use gparted to increase the partition size. I'll edit my answer to include that. – heynnema Jan 09 '17 at 18:15
  • Now swap will likely stand in the way of growing the Ubuntu partition.... It is much easier to just create a new install. – Takkat Jan 09 '17 at 18:23
  • @Takkat dang, you're right... Re-edit... The user prefers not to start a new install because of the programs installed in the current VM... but you're right again. – heynnema Jan 09 '17 at 18:25