Out of space on HD. How can I get rid of snapshots

Discussions related to using VirtualBox on Windows hosts.
Post Reply
cgmendla
Posts: 6
Joined: 30. Jan 2018, 00:51
Primary OS: Other
VBox Version: OSE other
Guest OSses: Using win 10 to run ubuntu 16.4

Out of space on HD. How can I get rid of snapshots

Post by cgmendla »

I am running windows 10.
Virtualbox Version 5.1.30 r118389 (Qt5.6.2)
One HD - 2.3 GB free of 148 GB - Not much I can delete.
15 snapshots
Virtualbox VMs folder has 98 GB
I have a drive on my network I can copy/ move folders to.
The VM is critical to me right now. I can't mess this up.

I've been reading up on trying to get rid of the snapshot files but it seems line a huge mess of landmines. It seems that I will probably run out of disk when doing merges. I did read something about moving the snapshots and doing symbolic links. I have not done anything like that before so I'm uncertain if that is the way to go.

Questions:
1. Does copying the Virtual machines folder to another drive for safekeeping help in case of a crash while trying to sort this out.
2. What would be the procedure given the space constraints above to try to get rid of the snapshots?

Thanks - I'd really appreciate any insights. I'm looking for the safest way to do this. If it takes a while to do, that is fine. I just need to free the space up and end up with a vm that has my current state on it (I think that is the correct terminology)


Chris
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Out of space on HD. How can I get rid of snapshots

Post by socratis »

cgmendla wrote:The VM is critical to me right now. I can't mess this up.
So, I take it that you have a backup of this critical system, right?
cgmendla wrote:I did read something about moving the snapshots and doing symbolic links.
Not a great idea. Symbolic links in Windows is mostly a joke...
cgmendla wrote:1. Does copying the Virtual machines folder to another drive for safekeeping help in case of a crash while trying to sort this out.
Absolutely. Take a look at the FAQ "Moving a VM" and interpret it as "Backing up a VM".
cgmendla wrote:2. What would be the procedure given the space constraints above to try to get rid of the snapshots?
Copy the main VDI and all its snapshots to another hard drive (similar, but not identical to the backup procedure). Run "CloneVDI" and merge your snapshots. Replace your main VDI with the outcome of the CloneVDI procedure. I would keep the same UUID and compact the VDI while at it...

And stay away from multiple snapshots...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
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: Out of space on HD. How can I get rid of snapshots

Post by mpack »

I would add that in order to "merge snapshots" using CloneVDI you need to clone the latest snapshot - don't make the newbie mistake of cloning the base VDI.

I'd then keep that clone VDI in reserve until you get rid of the snapshots: "restore" reduces the snapshot count without needing much disk space, it simply discards data but you don't care about that since the clone still has it. Once you are down to one VDI (nothing in the snapshots folder) you should be able to replace that VDI with the clone (*) and be back at exactly the same state, using much less disk space.

(*) Assuming you use "Keep UUID" as Socratis suggested.
cgmendla
Posts: 6
Joined: 30. Jan 2018, 00:51
Primary OS: Other
VBox Version: OSE other
Guest OSses: Using win 10 to run ubuntu 16.4

Re: Out of space on HD. How can I get rid of snapshots

Post by cgmendla »

Thanks for the replies.

I have two copies on two separate drives so I"m ready to do this.

I downloaded clonevdi, cloned a copy of my last snapshot (Which was a good vm), That gave me a cloned file of Clone of {e570585e-f3b8-47fc-9c53-d14ccdf97d4a}.vdi. I did a Keep UUID and compacted it. That is a 24 GB file. I'm assuming that clone is the latest version.

Am I correct in the next steps.

1. Open Virtualbox and do restores to roll back all of the snapshots for the VM on my laptop (The original VM folder). Just go to each snapshot starting with the newest and click the delete snapshot icon
2. Once I have removed all the snapshots then copy the Clone of {e570585e-f3b8-47fc-9c53-d14ccdf97d4a}.vdi file over . Do I need to rename it to match the name of the current VDI file, VM1.vdi ?

At that point, I should have a VM that is where the current VM was but without the snapshots (I learned my lesson on that!!)

If this fails, I could copy back the VM folder with all the files and snapshots and be back where I was?


Thanks

Chris
Attachments
temp virtualbox.JPG
temp virtualbox.JPG (56.82 KiB) Viewed 8469 times
cgmendla
Posts: 6
Joined: 30. Jan 2018, 00:51
Primary OS: Other
VBox Version: OSE other
Guest OSses: Using win 10 to run ubuntu 16.4

Re: Out of space on HD. How can I get rid of snapshots

Post by cgmendla »

I thought I followed the procedure, First I get the ubuntu screen, then an uncompression error - system halted.

What I did was

1. Copied the VM folder (snapshots, vbox, vdi's, logs) to another drive
2. Ran clonevdi against the newest snapshot with keep the uuid and compress.
3. Went back to the Laptop, ran virtualbox and deleted all the snapshots through virtualbox.
4. Copied the cloned VDI back to the laptop
5. Tried renaming my original VM1.vdi to VM1.VD1.old and the cloned version to VD1.vdi

that gave me the compression error.

I'd appreciate any thoughts on what I missed.

thanks

chris
Attachments
temp virtualbox files.JPG
temp virtualbox files.JPG (24.31 KiB) Viewed 8449 times
temp virtualbox ubuntu screen.JPG
temp virtualbox ubuntu screen.JPG (45.91 KiB) Viewed 8449 times
temp virtualbox error.JPG
temp virtualbox error.JPG (15.35 KiB) Viewed 8449 times
cgmendla
Posts: 6
Joined: 30. Jan 2018, 00:51
Primary OS: Other
VBox Version: OSE other
Guest OSses: Using win 10 to run ubuntu 16.4

Re: Out of space on HD. How can I get rid of snapshots

Post by cgmendla »

Another update here. I did have a crash about a week ago where i restored from a previous snapshot. I"m going to go back to an older snapshot and try that. I'll post the results.

Am I correct in assuming I have to rename the cloned vdi to what the original vdi was named after I copy it back over.?
cgmendla
Posts: 6
Joined: 30. Jan 2018, 00:51
Primary OS: Other
VBox Version: OSE other
Guest OSses: Using win 10 to run ubuntu 16.4

Re: Out of space on HD. How can I get rid of snapshots

Post by cgmendla »

UPDATE - SOLVED!!. I tried going back to some older snapshots from about a month ago. I got one of them working which puts me in pretty good shape. Any data I need can be pulled from GIThub. All I need to do is update some apps and reapply the meltdown/spectre patches.

To recap (as best as I recall)

1. Cloned the copy of an earlier snapshot on another drive with Clonevdi
2. Copied that clone back to my vm
3. (Previously rolled back all the snapshots on the VM.)
4. Renamed the original vdi from VM1.vdi to VM1.vdi.original.
5. renamed the cloned VDI to VM1.vdi

Started it up and it ran!!

Thanks again for the help. What you told me worked. I just happened to have a bad snapshot I think.

CHris
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: Out of space on HD. How can I get rid of snapshots

Post by mpack »

Well done for getting it to work.

The mention of compression puzzles me. Did you recently enable some kind of disk compression in the guest OS, perhaps in the hope of reducing disk space? That would have been pointless with all those snapshots already existing, in fact it may even have involved the complete replacement of the guest filesystem, which would have been a big disk space hit even after compression.
cgmendla
Posts: 6
Joined: 30. Jan 2018, 00:51
Primary OS: Other
VBox Version: OSE other
Guest OSses: Using win 10 to run ubuntu 16.4

Re: Out of space on HD. How can I get rid of snapshots

Post by cgmendla »

I'm not sure exactly what caused the compression error. I was doing too much trial and error and lost track of the troubleshooting process.

It could have been

1. I had a crash when the system ran out of disk space about a month ago.
2. I **think** that when I got the clone working I did not choose 'compress" in clonevdi. However, I don't think that had anything to do with it because if it works the way I think, it's just a form of disk optimization, not actual compression.

At any rate I'm back up and running. I'll be making regular clones and moving them to other drives.

thanks again.

chris
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: Out of space on HD. How can I get rid of snapshots

Post by mpack »

cgmendla wrote:2. I **think** that when I got the clone working I did not choose 'compress" in clonevdi.
There is no "compress" option in CloneVDI. The option is "compact" which, as you say, as a disk optimization step and doesn't involve compression.

The compression message comes from the guest, therefore it must refer to a guest feature. No host tool can be involved in that feature, except perhaps to stop it working (e.g. if a disk UUID changes, if the guest compression tool uses UUIDs to identify disks).
Martin
Volunteer
Posts: 2562
Joined: 30. May 2007, 18:05
Primary OS: Fedora other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP, Win7, Win10, Linux, OS/2

Re: Out of space on HD. How can I get rid of snapshots

Post by Martin »

The "uncompression error" is coming from your Ubuntu boot process when it tries to uncompress the initrd.
Many similar error messages can be found on the Internet for Ubuntu without Virtualbox, one example:
https://ubuntuforums.org/showthread.php?t=2147608
Post Reply