VMs reverted to old state due to upgrade from VirtualBox 6.0.22 to 6.1.10

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Iakovos
Posts: 1
Joined: 18. Jun 2020, 21:24

VMs reverted to old state due to upgrade from VirtualBox 6.0.22 to 6.1.10

Post by Iakovos »

Hi,

I am trying to resolve (or at least understand) a very strange behaviour.

I was running VirtualBox 6.0.22 on Linux Mint 19.3 Tricia (GNU/Linux kernel: 5.3.0-53-generic) and had a couple CentOS VMs for development. I have been using these VMs for several months and have upgraded VirtualBox several times (but only minor releases in the 6.0 release path). I have rebooted my Host (and VMs) several times.

I upgraded to VirtualBox 6.1.10 (same Host) on 2020-06-11, rebooted the Host, started my VMs and some of my files/directories were missing. These files/directories were created in late 2019. Furthermore, if I run "history" I can see that a lot of commands that I have used are missing.

It looks/feels like the VM reverted to a state that was running a couple of months ago. However, an "ls -lt" shows that system files have recent dates. And the latest dnf update (in the Guest) was on "2020-06-03".

I am not using Snapshots and I have not restored the VDIs/VMs from a backup. I am using the latest Extension Pack for VirtualBox. The VDIs are of type "Normal" and "Dynamically Allocated Storage".

I start my VMs from the Host using the following command:

Code: Select all

$ VBoxManage startvm "slurm_controlller" --type headless
And I stop them from inside the VM; by issuing a "shutdown -h" command (from the Guest):

Code: Select all

$ sudo shutdown -h now
When I check the state of the VM from the Host; I can see that it is in a "running" state when running and in a "powered off" state when I shut it down:
(when it is running)

Code: Select all

$ VBoxManage showvminfo slurm_controlller | grep State
State:                       running (since 2020-06-18T19:15:48.538000000)
(after I issue the shutdown command)

Code: Select all

$ VBoxManage showvminfo slurm_controlller | grep State
State:                       powered off (since 2020-06-18T19:21:55.763000000)
My only guess is that I was not shutting down the VMs properly (even though the state looks correct) and VirtualBox was keeping some of the new files/directories in some "state"/"delta" file that was never "merged" back to the VDI. When I upgraded, these state/diff files (similar to a base and delta images in QEMU) were lost; hence, I do not see some of my files/directories.

However, I am not happy with my "explanation".

I consider the files/directories lost and I will try to re-create them (next time I must keep copies in a repository).

I was wondering if any VirtualBox users/experts/gurus have experienced something similar? Also, in order to avoid this from happening again in the future, is my process of Starting/Stopping VMs "correct"? Should I be doing something else to force VirtualBox to persist/merge all data to the VDI file? "VBoxManage controlvm <vm> savestate" doesn't sound like the right thing to do; since, I want to shutdown my VMs.

If by any chance you have a better explanation; please let me know. I would love to understand why and how this happened. I have been using VirtualBox for more than 10 years and this is the first time of a catastrophic failure (hence my first post).

Better yet, if you know of a way to get hold of my missing data; please let me know.

I can provide VirtualBox logs for the affected VMs and/or any other debug information that you need.

Love this forum, it has helped me countless of times.

Kind regards,
Iakovos
ucrasher
Posts: 85
Joined: 3. May 2012, 10:55
Primary OS: Ubuntu other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: XP,Win7,various Linux

Re: VMs reverted to old state due to upgrade from VirtualBox 6.0.22 to 6.1.10

Post by ucrasher »

Shnapshots do not survive a majpr upgrade. See the user guides.
Thanks, ucrasher.
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: VMs reverted to old state due to upgrade from VirtualBox 6.0.22 to 6.1.10

Post by mpack »

Actually, snapshots survive major upgrades just fine. I assume you must be thinking about saved states, as those are not claimed to be portable.

That said, snapshots are always an accident waiting to happen. It's obvious that an accident is what happened here (most likely a virtual drive was detached and then re-attached), but we haven't been given solid info on what. If you insist on using snapshots then remember to make backups, often.
Post Reply