How to increase virtual disk space?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
virtual.box
Posts: 10
Joined: 4. Mar 2021, 09:05

How to increase virtual disk space?

Post by virtual.box »

How do I increase virtual disk space?
It appears I am running low at 600MB, I need to download and install a 1gb program shortly.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to increase virtual disk space?

Post by mpack »

OldGeezer916
Posts: 6
Joined: 5. Mar 2021, 02:42

Re: How to increase virtual disk space?

Post by OldGeezer916 »

Don't overdo it on the size. It's easy to make it bigger but not to make it smaller again. I guess all I can do is wait for the dynamic disk to adjust for all the empty space on the VB machine. At least that's what I got when I Googled. So far that's not happening I did need more room for an upgrade but not nearly as much I set. Now it's wasting 10 gigs on my system drive.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to increase virtual disk space?

Post by mpack »

OldGeezer916 wrote:I guess all I can do is wait for the dynamic disk to adjust for all the empty space on the VB machine.
You'll wait a long time for that. VirtualBox disks do "dynamic allocation", which means they allocate host disk space only when host disk space is needed. I.e. when a sector is written to for the first time.

There is no automatic "dynamic deallocation". VirtualBox has no way of knowing that a guest OS filesystem considers that sector no longer needed, because the guest usually doesn't know how to unwrite or delete a disk sector.

There is allegedly something you can do to achieve this: first mark the drive as "nonrotational" in the VM settings (i.e. simulate an SSD), and you'll also need to be using a guest OS that enables trim and is aware that some drives support trim. When the guest OS issues a trim command to the controller, VirtualBox is supposed to compact the drive dynamically. I say allegedly because I've never bothered to try that feature myself; very few others have reported that they have, and I have no way to verify their results.

Most of us let a VDI find its own level, choosing a conservative capacity to begin with (neither too large nor too small). If you made a one-time mistake that causes a VDI to balloon to full size then run a compaction step, e.g. run the disk through CloneVDI with the "Keep UUID" and "Compact" options set.
OldGeezer916
Posts: 6
Joined: 5. Mar 2021, 02:42

Re: How to increase virtual disk space?

Post by OldGeezer916 »

@mpack:
I'll check into that tool, but I'll probably need to get help from my son. He set up my "user friendly" Ubuntu for me. Some of it would be beyond my skill level if not for that. He set me up with Sysclone. It does not compact anything. He's pretty busy between work & his family, so it could be a while before he gets over here. He doesn't mind helping out, but he want's to see me put in some effort first.
AlexisWilke
Posts: 28
Joined: 11. Mar 2021, 19:25

Re: How to increase virtual disk space?

Post by AlexisWilke »

If you're still looking, I wrote this post, https://linux.m2osw.com/running-parted- ... xed-drives, a little while ago and it worked every time for me.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How to increase virtual disk space?

Post by mpack »

I'm not sure I understand what that post is saying. You can't change the size of a host VDI file with a guest partition editor. Or with a host partition editor for that matter.
Post Reply