Hard disk detached while restoring snapshot (VB 5.2.44)

Discussions related to using VirtualBox on Linux hosts.
Post Reply
EdwardLai
Posts: 2
Joined: 18. Nov 2021, 04:29

Hard disk detached while restoring snapshot (VB 5.2.44)

Post by EdwardLai »

Hi,

I'm using VirtualBox 5.2.44r139111 on a Linux Ubuntu Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-29-generic x86_64) on the server.

The guest OS is windows 7, sometimes the hard-disk detached from the controller automatically while restoring a snapshot.

No guest additions installed. More clues were found in the .vbox configuration xml file, missing AttachedDevice property under the StorageControllers.

I could bypass this issue by editing the .vbox configuration xml file or reattach the hard disk to the guest via gui.

Can someone help me? Thanks!

More infomation:
Errmsg: ahci#0: The target VM is missing a device on port 0. Please make sure the source and target VMs have compatible storage configurations [ver=6 pass=final] (VERR_SSM_LOAD_CONFIG_MISMATCH).
VBoxManage: error: Context: "LockMachine(a->session, LockType_Shared)" at line 388 of file VBoxManageControlVM.cpp
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Hard disk detached while restoring snapshot (VB 5.2.44)

Post by scottgus1 »

EdwardLai wrote:sometimes the hard-disk detached from the controller automatically while restoring a snapshot.
Snapshots include hardware configurations. So a disconnected hard drive file would become part of the snapshot if it was disconnected when the snapshot was taken.

You can read the .vbox file for the VM to see the snapshot chain in the XML. Each nested snapshot will have its own hardware configuration. Look at the <StorageControllers> section of each snapshot to see what drive files are attached for that snapshot (match up the UUIDs shown with the UUIDs at the beginning of the XML under the <MediaRegistry> section).

BTW, you really need to have good backups of the data inside the VM using a 3rd-party tool if you want to preserve the data while using snapshots. Also make a full backup of the VM folder & files while the VM is shut down.
EdwardLai
Posts: 2
Joined: 18. Nov 2021, 04:29

Re: Hard disk detached while restoring snapshot (VB 5.2.44)

Post by EdwardLai »

Thanks for @scottgus1's reply. I am trying to figure out what triggered this error.

I haven't removed the hard disk or changed any configuration before the snapshot was taken. And the 3rd-party tool I am using just invoke the VBoxManage to PowerOn, Shutdown, Restore Snapshot of the specific vms.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Hard disk detached while restoring snapshot (VB 5.2.44)

Post by scottgus1 »

EdwardLai wrote: I am trying to figure out what triggered this error.
It may not be an error. It may be in the VM's configuration in the .vbox file. Thus the indication to inspect each snapshot's storage section. What did you find when you searched the .vbox file as requested?
EdwardLai wrote:3rd-party tool I am using just invoke the VBoxManage to PowerOn, Shutdown, Restore Snapshot
If this is part of some backup routine, stop using that tool. The 'backup' will leave you with a restored VM that behaves just as if the power were unplugged on it, with dirty data and corrupted databases. Start a new topic about how to do a reliable backup if you're interested.

The '3rd party tool' I was referring to is a compatible backup program running inside the VM to back up the OS inside.
Post Reply