Problem resizing storage for Ubuntu guest

Discussions related to using VirtualBox on Windows hosts.
Post Reply
ftwig
Posts: 9
Joined: 10. Mar 2019, 22:47

Problem resizing storage for Ubuntu guest

Post by ftwig »

I followed instructions at https://www.howtogeek.com/124622/how-to ... or-vmware/.

I went into Virtual Media Manager, selected the storage file and slid it over from 10GB to 30GB.

I then went into cmd and tried

C:\Data\VMs\Ubuntu>"c:\Program Files\Oracle\VirtualBox\VBoxmanage" modifyhd Ubuntu.vdi --resize 30000

But it errored saying drive cant be shrunk so I tried

C:\Data\VMs\Ubuntu>"c:\Program Files\Oracle\VirtualBox\VBoxmanage" modifyhd Ubuntu.vdi --resize 300000
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%

To attempt t increase drive by 30GB, which seems to fo worked

But df -h still shows / as 100% used when I spin up VM.

I went back to virtual Media Manager and it now seems to be saying Ubuntu.vdi is 292.97 which is odd. The file is still just under 10GB.

I backed up Ubuntu.vbi and there is Ubuntu.vbox-prev which seems to have the correct time.

Any ideas?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Problem resizing storage for Ubuntu guest

Post by scottgus1 »

ftwig wrote:Any ideas?
Yes. You should have followed the Virtualbox tutorial. :lol:

How to resize a Virtual Drive
ftwig wrote:slid it over from 10GB to 30GB
This alone makes the drive file "container" that holds the VM OS's partitions 30GB in size. No command line "modifyhd" is then necessary.
ftwig wrote:--resize 30000
the resize number is in megabytes. 30GB = 30 x 1024MB = 30720 MB, so 30000MB < 30GB, which explains why "--resize 30000" is interpreted as a shrink command. Shrinks aren't supported in the --resize or the Media Manager.
ftwig wrote:--resize 300000
This increased the drive size from thirty thousand MB to three hundred thousand MB, or 292.97GB.
ftwig wrote:The file is still just under 10GB
This is because it is a dynamic drive, which grows as you stuff data in, up to the maximum the drive "container" is set to allow, which is now 292-ish GB.
ftwig wrote:df -h still shows / as 100% used when I spin up VM.
See the Virtualbox tutorial. There's another step after the Media Manager or the --resize command.
Post Reply