Page 1 of 1
VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 17:48
by MichaelBMiner
Hello All,
I am attempting to create a script to auto backup my VM nightly at 7pm.
Code: Select all
@echo off
set VBoxUUID=b071ad64-e158-46ac-8b77-4f80de83a3f8
echo Saving state and shutting down
vboxmanage controlvm %VBoxUUID% savestate
timeout /t 120
echo Saving snapshot
vboxmanage snapshot %VBoxUUID% take YoctoBuild_ --live --uniquename Timestamp
timeout /t 120
echo Restarting from saved state
vboxmanage startvm %VBoxUUID%
timeout /t 120
echo VM successfully saved!
If I create a new VM this works fine. If I insert the Guest Additions CD (do not install it) then run my script. When the VM comes back to life I get the Guru Meditation error. If I insert the Guest Additions CD, install the software and then eject the CD I get the same issue. Has anyone successfully set up a nightly snapshot in windows 10? VirtualBox version 6.1.30 r148432 (Qt5.6.2)
Re: VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 18:15
by scottgus1
Rather than diagnose the problem, I'll have to present a frame challenge:
That backup routine is severely flawed, in that it locks the VM to the host and the Virtualbox version, and is not really a backup but a differencing stage that can break very easily.
Saved States are Virtualbox-version-locked and sometimes host-PC-locked. So you'd be really hard-pressed to restore a working VM with no data loss some time from now when the Virtualbox version has been updated a few times, or if your host PC has died and you're attempting to put the VM on a new host.
Snapshots are not backups. They are hardware-and-data differencing stages. They need to all be present to make a working VM and you'll get a huge VM taking up extra-bytes of space with data that will never be accessed again.
The best backup of a VM is to shut down the VM completely, not save state, then copy the VM folder (and any disk files you manually store outside the VM folder) to backup media. This backup can be 'FC' file-compared to ensure backup integrity and can be put on any host running any Virtualbox version later than the version the VM was saved under.
To back up a live VM, run in-the-VM 3rd-party backup software compatible with all the VM OS's services, and store the backup image outside the VM over a network to another physical host drive's shared folder or to another server.
Re: VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 19:06
by MichaelBMiner
So you're saying my script should shutdown the VM, physically copy the VM folder to a new location, then restart the VM?
Re: VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 19:10
by scottgus1
That would be a good backup plan. Extra credit if the script also runs an FC command on the files and confirms they were copied correctly.
Re: VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 19:23
by fth0
Regarding the Guru Meditation, can you provide a (zipped) VBox.log file?
Re: VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 19:25
by MichaelBMiner
scottgus1 wrote:That would be a good backup plan. Extra credit if the script also runs an FC command on the files and confirms they were copied correctly.
Is it safe to use VBoxManage to stop/start the VM? Is my corruption only coming from the snapshot command?
Re: VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 19:26
by MichaelBMiner
fth0 wrote:Regarding the Guru Meditation, can you provide a (zipped) VBox.log file?
I will see if I can still access it. If I can I will post it.
Re: VBoxManage Forces Guru Mode
Posted: 2. Feb 2022, 19:39
by scottgus1
MichaelBMiner wrote:Is it safe to use VBoxManage to stop/start the VM? Is my corruption only coming from the snapshot command?
That's a good question. I have scripted VM backup shutdowns using:
vboxmanage controlvm "vm name" acpipowerbutton
and had no troubles, after I made sure that the VM OS was set to respond properly to ACPI Power Button signals ("What to do if the user taps the power button" stuff).
VM starts using vboxmanage also have had no troubles for me.
I never had trouble over the Guest Additions ISO, though I endeavored to eject the GAs ISO after they were installed, and having the GAs ISO loaded during a snapshot is not recommended, since the GAs ISO presence becomes part of the snapshot and causes problems to folks restoring a snapshot. (And, chant with me: "Snapshots are not backups..."

)
We'll see if the log can show why your script had troubles.