Backing up and recovering a VM

Discussions about using Windows guests in VirtualBox.
kees0_15
Posts: 4
Joined: 30. Aug 2019, 22:47
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: XP WIN10 MINT19

Re: Backing up and recovering a VM

Post by kees0_15 »

because just before I hastly "killed" my running VM., it reported "disk full .."or something alike: "make some room.."
Mpack was right: not closed, but killed. He advised read "How to resize a Virtual Drive" -> so I did.

Also started Gparted to see was is left. It showed /dev/sdb1 size: 300 GiB used: 286 GiB left: 13 GiB (rounded) but Nemo showed 45 KB !!

the directory at /home/kees/../my-vm occupies about 90 GiB. Because I cannot reach my machine through the Oracle VM VirtualBox Manager, shoud I use the VboxManager through the commandline?

Also using Gparted to enlage the my first partition is risky:

1. need to shrink partition /dev/sdb5 (space available: say about 20 GiB)
2. move partiton /dev/sdb3 ( 75 GiB, part of a LVM!!)
3. enlarge /dev/sdb5 (with the same 20 GiB)

Maybe there is a way to register my vm again, skipping the last snapshot? (from there -> clone ??)

something in my mind says "ït there; just find it"

Kees :?
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Backing up and recovering a VM

Post by mpack »

kees0_15 wrote: Also using Gparted to enlage the my first partition is risky:
Not really. Just make a backup of the VM folder before you start.

Did you overcome the problem with the corrupted .vbox file? Because nothing much can be done with your snapshots until you have a working control file.

Snapshots are not backups! Not in any sense of the word. Snapshots allow you to have convenient access to multiple alternate states of the guest OS, and that is all they do. They are of no help if you want to recover an earlier (working) state of the HOST, which is what you are trying to do here. What's worse the complexity of snapshots ensures that data loss on the host is more likely, because there are more files to damage and they must all be mutually consistent. A snapshot chain is like a patch chain. You have a base VDI, then the first (oldest) snapshot has data on how to patch the base to obtain the state #1. The second oldest snapshot contains data on how to patch state #1 to get state #2... and so on. If you zap an early state file then the entire chain is lost from that point onwards.

Incidentally, another reason not to use snapshots is that they can be huge. Each one can potentially grow to the full creation size of the hard disk, so a 30GB drive plus 10 snapshots could potentially grow to 330GB, and all of it has to be online.

One thing you can try is to identify the newest snapshot and attempt to clone it with CloneVDI. This is a Win32 app, but it also runs under Wine on Linux hosts. Note that you clone the snapshot, not the base. Whichever snapshot you pick, CloneVDI works out the chain back to the base VDI and creates a merged clone, so it's up to you to find the newest snapshot CloneVDI will accept. CloneVDI can also resize the virtual disk for you. You must then mount that clone in a new VM, you cannot replace a snapshot chain with a merged clone.
kees0_15
Posts: 4
Joined: 30. Aug 2019, 22:47
Primary OS: Ubuntu 8.04
VBox Version: OSE Debian
Guest OSses: XP WIN10 MINT19

Re: Backing up and recovering a VM

Post by kees0_15 »

thanks!

I will work that out and report back my result. (will take some time).

And no, de three *.vdi files in my VM-folder do not respond for now.

let us see if CloneVDI will be helpfull -> I give it a try on a second (physical) machine on the homenetwork (linus host with a clean XP guest)

wish me luck,

Kees :D
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Backing up and recovering a VM

Post by mpack »

Well if you're going to try CloneVDI on a second machine then make sure not to forget the base VDI. Best is to put all VDIs (base plus all snapshots) into one folder.
Tax Shack
Posts: 36
Joined: 25. Oct 2021, 04:22
Primary OS: MS Windows other
VBox Version: PUEL
Guest OSses: Win10, Win7 & WinXP

Re: Backing up and recovering a VM

Post by Tax Shack »

Hey, I was following the travails of Spinning Wheels and all of a sudden it stopped and some guy named Kees started posting with a different title (and different problem). Is the rest of this thread around or did he fly off into space? Commit suicide? I wanted to see if he was changing filenames by changing the extension!

My advice from reading this - run, don't walk, away from snapshots. I have enough trouble with the few files I have.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Backing up and recovering a VM

Post by scottgus1 »

Tax Shack wrote:run, don't walk, away from snapshots.
Preach it, brother! :D

Snapshots are good for experimentation, but not for VMs one wants to keep. Many folks misunderstand what a snapshot does, especially when they think it's a backup. Then they damage their VMs by messing around with the snapshots.
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Backing up and recovering a VM

Post by klaus »

Snapshots are frequently used by developers, and they serve a very useful purpose. They help greatly when one needs to reproduce a certain situation (which needs a non-trivial effort to create) over and over, for bug reproduction or similar reasons.

If anyone thinks that snapshots are backups then that's wrong.

Anything deserving the label 'backup' is creating an independent copy, and snapshots explicitly don't do this.

That said... one can use snapshots as a basis for creating backups (because backing up running VMs is by definition unreliable), but the independent copy needs to be created afterwards - for example with a full clone.
Post Reply