Host drive is out of space and I don't know what to do

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Rhythmdvl
Posts: 12
Joined: 15. Oct 2015, 22:22

Host drive is out of space and I don't know what to do

Post by Rhythmdvl »

I hope someone will take a moment to help. I am minimally competent at this, so please forgive me if I miss the obvious or forget relevant details. (Plus, I probably did some very dumb things, like forgetting to write down the exact error messages. Sheesh.)

I have a Windows 7 host with an Ubuntu (12.04) guest. The guest resides on an 300 GB internal ‘E:\’ drive.

The host disk space was running low (only 15 to 20 GB of free space), so I thought to free up space by deleting the only snapshot.

I powered down the guest, selected the snapshot and hit delete. It then filled up the entire disk and errored out.

Windows now reports that there is only 308 KB of free space on the drive. Almost all space is taken up by the main .VDI (217 GB) and the snapshot .VDI (78 GB).

If it makes a difference, a recently exported .OVA file is only 236 GB. Also, other than a basic Ubuntu install and a small handful of additional utilitarian applications (e.g. Transmission, Tor browser, etc.) I only have about 40 GB of data. It's a dynamically allocated disk, if that changes anything.

I have plenty of space on an external USB drive, but not sure how it can help. Also, that external USB drive has the recent export (I powered down the guest, selected File>export, named it and saved it to the external drive. It is recent enough that I could use it in place of the current guest (if that makes things easier).

I assume I can’t just use Win 7 Explorer and manually delete the snapshot, but don’t know what to do next (or what else is relevant).

Thanks~
Brook
Posts: 1
Joined: 17. Oct 2015, 14:50

Re: Host drive is out of space and I don't know what to do

Post by Brook »

Shift-delete rather than delete, maybe. Trying to move a large file into the recycle bin is problematic most of the time.

If the snapshot is a file, it can be deleted through Win7 Explorer. Generally you can't delete a file in Windows is when it's write locked or you have insufficient permissions. Other than that, have fun. (This is not to say that a separate index containing the name of the file wouldn't end up being "corrupted" by pointing to something that doesn't exist, but well-written software should recover from that.)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Host drive is out of space and I don't know what to do

Post by mpack »

You should only manually delete a snapshot file in the host OS if it is your intention to destroy the VM beyond all hope of repair, so please ignore the suggestion by "Brook".

Ok, so you run out of disk space while the VM was merging a snapshot chain. Snapshots are prone to errors like that, which is why experienced users generally avoid them.

Once you've had an error, no good solution exists unless you have a backup. An OVA generally doesn't make a good backup, but in this case it sounds like the best available option. VirtualBox does a snapshot merge when it exports a VM, so (happily) the imported VM will not have a snapshot structure.

I suggest backing up the existing VM folder, then delete the entire VM from the GUI (say yes to deleting the physical files, since you'll have made the backup). Free up as much other disk space on the host as you can, then import the OVA appliance.

External USB2 drives are not good for much except backup, and Windows variable drive lettering scheme complicates the use of removable drives generally. You shouldn't try to run any VMs from there.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Host drive is out of space and I don't know what to do

Post by loukingjr »

I concur with nearly everything mpack said. However, I don't entirely agree that using external USB drives for anything other than backups is a bad idea. For one thing, you may not have enough space on the host so it may be the only option. My understanding is Windows can change the drive letter of external drives. I treat external drives as permanent and I use primarily a OSX environment which doesn't rename devices. I could be mistaken and I'm sure mpack will clarify if so, but I would think if Windows did change the drive letter you could resolve the problem by un-registering the guest then re-registering the same.

Of course an external USB2 or even an external USB3 drive will be slower, but sometimes that's the only choice.

See: Moving a VM if you decide to run the VM on the external drive.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
Rhythmdvl
Posts: 12
Joined: 15. Oct 2015, 22:22

Re: Host drive is out of space and I don't know what to do

Post by Rhythmdvl »

Thank you so much for your help in this.

So the OVA is a decent enough fall-back, but it’s not optimal. What about it makes it less-than-optimal?

Since I still have access to the guest both in Virtualbox GUI (and it still runs), is there a better solution? I used the export function before trying to delete the snapshot thinking that it was the right way to go. Well, at least I have the OVA.

Also, when copying E:\VM folder to the external USB as a backup, can I do it with Windows file explorer or should I use a command line (and if so, what switches should I set)?




Side note about the external: My main PC is a Frankenstein’s monster of drives. When I built it, I started with a 128 GB SSD (that was in the early-ish days of SSDs) as my boot drive and brought over my old 500 GB HDD for storage. A few years later, I added a 256 GB SSD to take over as boot drive, keeping the old SSD to host my Steam installs. In experimenting with VMs, I took an unused 300 GB drive I had around and installed the guest on that. Four internal drives, and of course I’m connected to the NAS and now this external USB drive. Yikes.

Once I untangle this VM hiccup (hopefully it’s just a hiccup), I’m going to get a simple 2 TB drive (I’m constantly astounded at how the price of storage has dropped over the years) to combine all the HDDs into one volume.
Rhythmdvl
Posts: 12
Joined: 15. Oct 2015, 22:22

Re: Host drive is out of space and I don't know what to do

Post by Rhythmdvl »

Did the backup and started to import and got this error message:
Failed to import appliance (external drive)O:\Main Ubuntu VM Oct 2015.ova.

Could not create the clone medium (boot drive) 'C:\Users\Rhytymdvl\VirtualBox VMs\VM box\Main Ubuntu VM Oct 2015-disk1.vmdk'.

VMDK: cannot write allocated data block in 'C:\Users\Rhythmdvl\VirtualBox VMs\VM box/Main Ubuntu VM Oct 2015-disk1.vmdk' (VERR_DISK_FULL).

Result Code: VBOX_E_FILE_ERROR (0x80BB0004)
Component: Appliance
Interface: IAppliance {3059cf9e-25c7-4f0b-9fa5-3c42e441670b}
I assume it's trying to import into my C drive, which doesn't have the space. Just checked under "Appliance settings" that comes up during import and it says "Virtual Disk Image C:\Users\Rhythmdvl\VirtualBox VMs\VM box\Main Ubuntu VM Oct 2015-disk1.vmdk" Can I just change that to e:? Hmmm...

...went into General Settings from the main VirtualBox menu and changed it to a folder on the E:\ drive and testing to see if that worked...
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Host drive is out of space and I don't know what to do

Post by mpack »

Rhythmdvl wrote: So the OVA is a decent enough fall-back, but it’s not optimal. What about it makes it less-than-optimal?
A backup should be an identical copy which you create in order to preserve a known working state. An OVA isn't an identical copy, it's a copy that has been converted into an OVA appliance. OVA is a VMWare standard, so the disk format will be changed to VMDK and any feature which VMWare didn't allow for in OVA will be lost. Doing so creates the risk that the imported appliance will behave differently. However, it's better than nothing if the original VM is destroyed.

As to your current problem, you'll probably have to discard the old VM - and free up the disk space - before you'll have room to create a new VM from an imported OVA, which is what you're currently doing. You may need a lot of disk space: the OVA has to be unpacked first, then you'd need space for the VM.

If you're very short of disk space then you can use the fact that OVA is just a tar archive: unpack it with untar to a secondary drive. You should then have an OVF and one or more VMDKs. You import an OVF just as you do an OVA, but of course it doesn't now need space to unpack the archive. Do not use the unpacked VMDK directly, it is not in a normal VMDK format.
Rhythmdvl
Posts: 12
Joined: 15. Oct 2015, 22:22

Re: Host drive is out of space and I don't know what to do

Post by Rhythmdvl »

Again, I greatly appreciate the time you’ve taken to write things out—it really explains what I’m seeing.

I was able to import the OVA as-is (after deleting the original), and from what I can tell the system is running as it used to. But I still need to compact it (it’s a relatively simple Linux machine with only 40 GB of data; it shouldn’t take up 207 GB). But (thanks to what I know now), the OVA converted my VDI to a VDMK. The size of the database can be compacted, but not easily.

I still have the backup copy I made before deleting/importing the OVI. Is there a way to
1) Get Virtualbox to recognize the machine on the external drive;
2) Merge its snapshot over there (the external drive has the spare room to avoid the problem I ran into in the first place);
3) Compact the database (i.e. shrink the virtual HDD to what’s actually ‘on’ the disk)
4) Bring the refurbished file/file structure back over to the internal drive?

I assume it’s possible, but will it be noticeably easier than compacting the VDMK file?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Host drive is out of space and I don't know what to do

Post by mpack »

Well, if it was me I would do the following :-
  1. Use CloneVDI to clone the VMDK to VDI format. You can tick the "Compact" option to compact the disk in the same pass.
  2. Release and remove the VMDK from the VM, then delete the VMDK.
  3. Move the clone VDI into the VM folder, rename the clone as you prefer, then use VM settings Storage panel to mount the VDI in the VM.
That should get it running the way you want.
Rhythmdvl
Posts: 12
Joined: 15. Oct 2015, 22:22

Re: Host drive is out of space and I don't know what to do

Post by Rhythmdvl »

Finally got a chance to do this (wanted to wait until I could focus), but seem to have run into a hiccup. I'm including all my steps here in case something is relevant:

I downloaded CloneVDI from the link, taking the version on page 1 (that post seemed to be updated as new versions came out).

I ran it, keeping all the default options except I checked the 'compact' option box. I saved it to one of the external drives.

When it finished cloning, I went into VirtualBox media manager, selected the VMDK file, released it, then deleted it (choosing the full delete option).

I copied the VDI from the external drive to the local drive where the machine and VMDK file exist. I changed the name slightly, but did not touch the extension.

I went to VirtualBox manager, entered the settings the VM, went to storage, selected the 'Controller:Sata' , selected the 'add' button below, chose 'add hard disk' from the dropdown, chose 'choose existing disk' button, and then navigated to the recently copied VDI file,

I received the following error message:
Failed to open the hard disk E:\VM Ubuntu\VM box\Cloned Ubuntu VM Oct 2015-disk1.vdi.

Could not get the storage format of the medium 'E:\VM Ubuntu\VM box\Cloned Ubuntu VM Oct 2015-disk1.vdi' (VERR_NOT_SUPPORTED).

Result Code: VBOX_E_IPRT_ERROR (0x80BB0005)
Component: Medium
Interface: IMedium {29989373-b111-4654-8493-2e1176cba890}
Callee: IVirtualBox {3b2f08eb-b810-4715-bee0-bb06b9880ad2}
Callee RC: VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)
I've taken the time to search on the error message, but it seems a bit broad---I'm not quite sure which results apply to this situation. Do you have any insight or direction to figure out how to overcome it?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Host drive is out of space and I don't know what to do

Post by mpack »

You had me worried for a second - I had to double check that the new CloneVDI release still creates good VDI headers... and it does.

Which most likely means that there was something wrong with the external drive you used during cloning, though I would have expected CloneVDI to give an error message if (say) you made the mistake of using a FAT formatted drive and write a >4GB file to it.

I see where you say that you deleted the VMDK before verifying that the clone worked. I assume you have another copy, since deleting your only known working copy would be catastrophically... unwise.
Post Reply