VirtualBox

Opened 11 years ago

Closed 10 years ago

Last modified 9 years ago

#11750 closed defect (fixed)

Restoring a snapshot automatically detach the hard-disk from the controller => fixed in SVN

Reported by: drikc Owned by:
Component: virtual disk Version: VirtualBox 4.2.12
Keywords: Cc:
Guest type: Linux Host type: Windows

Description

Restoring a snapshot automatically detach the hard-disk from the SATA controller.

The result is that I can't run the snapshot state - virtual box return the following error:


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).

Code d'erreur : E_FAIL (0x80004005) Composant : Console Interface : IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}


That is, when I click the restore button right after I can check by going into the storage configuration that my disk is detached. I can attached it again but then I'm back to the actual state and not the wanted snapshot state.

Attachments (7)

1attempt-dev.vbox (62.4 KB ) - added by awilkin 10 years ago.
VBox file after first snapshot attempt
1attempt-errors.txt (195 bytes ) - added by awilkin 10 years ago.
The popup messages after first snapshot attempt
1attempt-snapshots.txt (903 bytes ) - added by awilkin 10 years ago.
Snapshot directory contents after first snapshot attempt
1attempt-VBox.log (70.9 KB ) - added by awilkin 10 years ago.
Log file after first snapshot attempt
2attempt-dev.vbox (74.4 KB ) - added by awilkin 10 years ago.
VBox file after second snapshot attempt (disk is detached)
2attempt-snapshots.txt (978 bytes ) - added by awilkin 10 years ago.
Snapshot directory contents after second snapshot attempt
2attempt-VBox.log (72.0 KB ) - added by awilkin 10 years ago.
Log file after second snapshot attempt

Download all attachments as: .zip

Change History (46)

comment:1 by drikc, 11 years ago

I could bypass this issue by editing the .vbox configuration xml file. I record the storage controller setup and inserted it into the configuration back when it is - missing which result to: <StorageController name="SATA" type="AHCI" PortCount="1" useHostIOCache="true" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">

<AttachedDevice type="HardDisk" port="0" device="0">

<Image uuid="{85a06972-8cd2-466b-bdcc-43faffbc2e51}"/>

</AttachedDevice>

</StorageController>

Otherwise this tag is empty...

comment:2 by drikc, 11 years ago

Mhh this didn't make finally; the guest linux system report some disk error ...

comment:3 by ciaranmac, 11 years ago

I'm getting the above error when I try to restore some snapshots, ever since I upgraded to the latest 4.2.18 r88780 (Windows 8 64bit). It makes some snapshots inaccessible but some others are still working. As suggested on previous reports of this error, I tried disabling EHCI and upgrading to the latest Guest Additions, but neither of these steps prevents the error.

Failed to open a session for the virtual machine Windows XP Pro Clone.

piix3ide#0: The target VM is missing a primary master device. Please make sure the source and target VMs have compatible storage configurations [ver=20 pass=final] (VERR_SSM_LOAD_CONFIG_MISMATCH).

Result Code: E_FAIL (0x80004005) Component: Console Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

comment:4 by ciaranmac, 11 years ago

FYI: Uninstalling 4.2.18 and then installing 4.2.16 has fixed this issue for me.

comment:5 by isabellf, 11 years ago

I had a similar issue, unfortunately, all my VMs lost all there attachments in the process. I'm pretty sure there must have been some issue writing the xml file to the host, so I checked the .xml backup : it has 0 KB and is useless.

I'm using 4.2.18 r88781, I tried downgrading to 4.2.16 without effect.

comment:6 by isabellf, 11 years ago

I got the same issue once more, but this time I noticed that the attachment gets removed when the snapshot I try to create fails with the "Failed to create snapshot for virtual machine X". I though I could simply create a new snapshot but it seems like the current machine state is affected as well.

Maybe this is caused by a write error on the media or something, but the drive I'm using appears healthy and windows (7) does not report any problem with the NTFS volume.

I looked at the logs but couldn't really find something relevant. I was thinking about doing a manual backup of the .xml file before any attempt to create a new snapshot. One thing worth mentioning: my disk is a windows JBOD volume spawn across 4 disks. I also have indexing enabled on the volume.

comment:7 by isabellf, 11 years ago

One additional information about my issue which would be more precisely described as:

"Taking a snapshot automatically detach the hard-disk from the controller when the snapshot fails"

The VM is in a paused status, I'm not attempting a 'live snapshot'.

comment:8 by orestesca, 11 years ago

I'm having the same issue. This ticket has been open for months but it seems 4.2.18 was released without doing anything about this.

What I did:

  • Installed an Debian 7.1, took a snapshot.
  • Installed some packages, took some more snapshots along the way.
  • When I tried to restore any snapshot I got the following error:
Failed to start the virtual machine vm.

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).

Result Code: E_FAIL (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

The settings GUI for the VM seems to be in "read only" mode and I can't re-attach the drive. See this screenshot -> http://i.imgur.com/dZ7Lgp3.png

Now my vm is in an unrecoverable state and I can't find a solution other than creating a new one from scratch.

Downloading doesn't work, I get:

Failed to open a session for the virtual machine vm.

The device helper structure version has changed.

If you have upgraded VirtualBox recently, please make sure you have terminated all VMs and upgraded any extension packs. If this error persists, try re-installing VirtualBox. (VERR_PDM_DEVHLPR3_VERSION_MISMATCH).

Result Code: E_FAIL (0x80004005)
Component: Console
Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}


Which is perfectly understandable, but still a problem

Last edited 11 years ago by orestesca (previous) (diff)

in reply to:  4 comment:9 by jkeller, 11 years ago

Replying to ciaranmac:

FYI: Uninstalling 4.2.18 and then installing 4.2.16 has fixed this issue for me.

I can confirm that this issue also affects 4.2.18 on OS X 10.8.5. Exact same error messages taking and loading from snapshots. I thought it was transient, as the 2nd snapshot attempt succeeded, but loading that snapshot failed completely.

Reverting to 4.2.16 fixed the issue for me so far.

comment:10 by Frank Mehnert, 11 years ago

We cannot reproduce the problem. We have tried this with a number of different setups. I think there must be some condition involved. Can you provide more information? The ideal case would be a simple test case, for example create a new dummy VM, change some settings, start the VM, take a snapshot, terminate the VM, restore the snapshot.

comment:11 by awilkin, 11 years ago

I’m having the same problem (Linux guest on Windows host. Guest additions installed). I encountered an error when attempting a live snapshot (I can’t remember what the error was). I then paused the VM and tried taking the snapshot again, and it worked. I don’t know if the error contributed to the snapshot losing its disk or not.

Looking at <HardDisks> in the vbox XML file, I see an orphaned disk that has no associated snapshot and is not part of the current state. I also have a snapshot that is missing its <AttachedDevice> entry. All subsequent snapshots are also missing their entries.

I was able to recover the snapshot by adding an <AttachedDevice> entry and referencing the orphaned disk. However, all subsequent snapshots were unrecoverable because no vmdk files exist for them (though they do have SAV files). It seems no vmdks were written after the first snapshot lost its disk.

comment:12 by snaperror, 11 years ago

I have the same error ! Please contact me via email so I can provide you more details about the context when this error happens.

comment:13 by awilkin, 11 years ago

Problem occurred again. I attempted to save a snapshot. I got a message saying "The Virtual Machine is currently in the Paused state and not able to see any keyboard or mouse input...". After clicking OK, I got this error: "Failed to create a snapshot of the virtual machine dev". I checked the vbox file, and indeed the most recent <HardDisk> element had been orphaned.

Make sure all VBox processes are shutdown or my recovery trick above doesn't work.

comment:14 by josh_123, 11 years ago

I am experiencing this issue as well.

First the the snapshot fails "Failed to create a snapshot of the virtual machine MY-VM-NAME" then on trying again to snapshot, no error is presented, but looking at the details of the snapshot indicates that it is now detached. Trying to play this snapshot after it has been restored fails. I have only tested this when taking snapshots while the machine is running.

I find it generally occurs when I create a snapshot (which works fine) not long after creating a previous snapshot (perhaps within the last 30 minutes).

I have had it occur on:

  • Windows 7 host with Windows 7 guest
  • Windows Server 2008 host with Ubuntu 12.0.4 guest

All using VirtualBox 4.2.18 (I never had this issue on VirtualBox 4.2.16 or older).

comment:15 by ts, 11 years ago

I am encountering this issue as well. I have the latest VirtualBox 4.2.18, host is Windows 7, guest Windows 8 (both 64-bit).

I tried to create a snapshot. The first try failed, gave some error. Tried to create the snapshot again and the second time was successful. Then saved the machine state and closed VirtualBox. Next time I try to restore it, it gets to 95% and then finds it is missing a device. When I open the configuration I see that no storage is listed for the machine, but I do see the path to my .vdi in the XML. I cannot add the storage via settings as I am locked out, VirtualBox is not allowing me to edit.

Last edited 11 years ago by ts (previous) (diff)

comment:16 by Brooke00, 11 years ago

I'm having the same error, also using 4.2.18. My VM is a 32-bit XP. I saved the state of my VM, took a snapshot of it, switched back to a previous snapshot for a bit, then went to switch back to this snapshot, and get this error with detail:

Result Code: E_FAIL (0x80004005) Component: Console Interface: IConsole {db7ab4ca-2a3f-4183-9243-c1208da92392}

Log also shows:

00:00:08.376624 Changing the VM state from 'DESTROYING' to 'TERMINATED'. 00:00:08.609191 ERROR [COM]: aRC=E_FAIL (0x80004005) aIID={db7ab4ca-2a3f-4183-9243-c1208da92392} aComponent={Console} aText={piix3ide#0: The target VM is missing a primary master device. Please make sure the source and target VMs have compatible storage configurations [ver=20 pass=final] (VERR_SSM_LOAD_CONFIG_MISMATCH)}, preserve=false 00:00:08.609689 Power up failed (vrc=VERR_SSM_LOAD_CONFIG_MISMATCH, rc=E_FAIL (0X80004005))

Last edited 11 years ago by Brooke00 (previous) (diff)

comment:17 by toni76, 11 years ago

Facing same issue here.

Host: Windows 7 64-bit Virtualbox version 4.2.18 Guest: Debian Wheezy 64-bit

So far for this image I've done one full clone. After that I took a couple of snapshots (on that clone). One of the snapshots gave the error "Failed to create snapshot for virtual machine X". Snapshot creation worked, when retried. At this point I had the virtual machine constantly running for 2 days. After creating a couple of more snapshots I shut down the virtual machine. Attempt to restart that vm failed in an error "FATAL: Could not read from the boot medium! System halted.". Attempt to restore an earlier snapshot resulted in the same error as described in the ticket description ("The target VM is missing a device on port 0").

comment:18 by aeichner, 10 years ago

As Frank pointed out above we are not able to reproduce this problem so far. Maybe someone who can reproduce this can attach the VBox.log and VM settings file before restoring the snapshot and after restoring it when the error happens. Ideally getting the VM settings after every step would be great so we can see what exactly changed after each step. So far it looks like a regression in 4.2.18 and there are only reports from Windows hosts and one OS X host as far as I can tell. Unfortunately the chance to get this fixed is rather low until we can reproduce the problem ourself.

by awilkin, 10 years ago

Attachment: 1attempt-dev.vbox added

VBox file after first snapshot attempt

by awilkin, 10 years ago

Attachment: 1attempt-errors.txt added

The popup messages after first snapshot attempt

by awilkin, 10 years ago

Attachment: 1attempt-snapshots.txt added

Snapshot directory contents after first snapshot attempt

by awilkin, 10 years ago

Attachment: 1attempt-VBox.log added

Log file after first snapshot attempt

by awilkin, 10 years ago

Attachment: 2attempt-dev.vbox added

VBox file after second snapshot attempt (disk is detached)

by awilkin, 10 years ago

Attachment: 2attempt-snapshots.txt added

Snapshot directory contents after second snapshot attempt

by awilkin, 10 years ago

Attachment: 2attempt-VBox.log added

Log file after second snapshot attempt

comment:19 by awilkin, 10 years ago

Added log files. The bug is intermittent so these steps don't always work.

1) Attempt a live snapshot.
2) Two popups messages (see 1attempt-errors.txt)
3) Pause the VM
4) Attempt second snapshot.
5) Snapshot is successful.
6) Next time the VM is started, "missing a device on port 0" error reported.

This is just what happens for me. Other people's steps may be different.

comment:20 by jkeller, 10 years ago

I can confirm those steps when I encountered it. (I haven't been able to reinstall 4.2.18 and test again.)

The only difference is that I didn't pause the VM before the 2nd snapshot attempt.

comment:21 by aeichner, 10 years ago

Thanks for this information! I'm able to reproduce the issue now. Pausing the VM before the first snapshot makes the difference here.

comment:22 by aeichner, 10 years ago

Summary: Restoring a snapshot automatically detach the hard-disk from the controllerRestoring a snapshot automatically detach the hard-disk from the controller => fixed in SVN

The problem should be fixed in the next maintenance release.

comment:23 by Jacob Klein, 10 years ago

Did the fix for this Ticket make it into the 4.3 release today?

comment:24 by Zikmen, 10 years ago

What is the workaround at this time to reatatch a drive lost during taking a snapshot procedure?

comment:25 by ItalloSan, 10 years ago

I have the same problem today and have the 4.3 update.Lost a few hours work unless there is a workarourd?_

comment:26 by ZB, 10 years ago

Hello, I am having this problem as well. I was running 4.2.18 at the time that it began. I have no idea what caused it. From what I am reading, maybe I upgraded to 4.2.18, maybe that was what caused it. I cannot determine what I did or what I should do, I have been reading everything I can find about this.

I upgraded to 4.2.3, same problem. I uninstalled 4.2.3 and reinstalled 4.2.3, same thing. I installed 4.2.3 and went back to 4.2.16, same issue. I have tried a lot of things, I have gone back to previous snapshots, I have discarded my state. No matter what I do, I cannot get past this problem.

Can anyone advise?

Thanks,

ZB

Version 3, edited 10 years ago by ZB (previous) (next) (diff)

comment:27 by sash, 10 years ago

I had the same problem in Windows 7 (64-Bit) using VirtualBox 4.2.18

I also had a snapshot, without a harddisk attached and in the settings it wasn't possible to attach a hard disk, since it was all 'greyed out'

A Workaround for me was, to make a clone of the 'broken' snapshot (when asked i choose complete clone and current state. (since i use the german version, i dont know the exact english translation)

the clone still has not an hard disk attached, but it has again the possibility to set a harddisk - and the harddisk of the snapshots are located (on my windows machine) right in the snapshot directory of the 'original' vm. the virtual hard disk has a cryptic name like {f5ec7b93-6fb9-4ff9-9e85-09afc65a9dfa}.vhd

once attached, i was able to start the VM (in the state of the snapshot) again.

sadly the snapshot become 'upgraded' to a full vm :-(

but i was glad, that it was running again!

after that i cloned the 'reborn' vm again with a proper name, so that so virtual hard disk, also gets the proper name and delete the copy of the 'broken' snapshot vm. (but thats just cosmetics)

hope that helps someone!

comment:28 by Benjamin Berthelot, 10 years ago

I have got the same problem with three of my VM, and found the solution. VirtualBox says that storage is detached, so we have to make the link to the storage.

http://img4.hostingpics.net/pics/691785Virtualboxerror.png

My environment :

  • Host : Windows 7 (64 bits)
  • Virtualbox v4.2.18
  • Virtual machines : Debian 7 and OpenBSD 5.3

Don't modify .vbox or others files !

Follow these steps :

Just tried with version : 4.2.18

  1. Right-click on VM and select Forget saved state (Ctrl+J) if the VM is saved
  2. Go to the Configuration (Ctrl+S) of virtual machine
  3. Select Storage
  4. Click on icon Add Hard Disk (IDE or SATA)
  5. Select Choose an existing disk
  6. Select the file *.vdi created for your virtual machine, in the right folder
  7. Valid with OK
  8. Start your virtual machine

Next, your can't restore an older snapshot ! Create a new snapshot.

Benjamin

Last edited 10 years ago by Benjamin Berthelot (previous) (diff)

comment:29 by Jacob Klein, 10 years ago

Did the fix for this Ticket make it into the 4.3.2 release today?

comment:30 by Frank Mehnert, 10 years ago

Yes. The fix will also be part of the next 4.2.x maintenance release.

comment:31 by Jacob Klein, 10 years ago

Thank you for the reply. Out of curiosity and verification, could you also confirm that the fix was NOT included in 4.2.18 nor 4.3.0? Thanks, Jacob

comment:32 by Chris Russell, 10 years ago

VirtualBox 4.2.18 r88780 on Windows 7 64-bit. FWIW I'm running F-secure with deep guard enabled. Other than that, it's just a standard Win7 client as host. Guest in Debian 7.2.0 amd64. Symptoms exactly as reported in this thread.

Benjamin - thanks very much for your directions above. I followed and am now able to boot the VM. But I've lost an as-yet-to-be-determined amount of work from yesterday which is a major bummer.

Any word on the availability of a patch for this issue? This is a really nasty bug.

comment:33 by Neal M, 10 years ago

Hi, unfortunately this is still happening for me too and it's very annoying. I often lose work. Let me know if I can be of any help.

Neal

comment:34 by Frank Mehnert, 10 years ago

Resolution: fixed
Status: newclosed

Fix is part of VBox 4.2.20 and 4.3.4.

in reply to:  34 comment:35 by Chris Russell, 10 years ago

Replying to frank:

Fix is part of VBox 4.2.20 and 4.3.4.

Thank you!

comment:36 by Nishit, 10 years ago

Hi, I am using Ubuntu 12.04 and Virtualbox version is 4.2.10 r84104. My current state is showing last snapshot data. Last snapshot I had taken on 6th SEP. 2013, all data which I had saved after last snapshot has been lost. Is there a way to restore to last/previous session state? Please let me know soon.

comment:37 by dreezman, 10 years ago

Hello,

I'm on 4.3.6. On 4.2.18 I had this same problem so I upgraded. I am still not able to recover my snapshots. Drive was detached I reattached it and it booted the original image. Looks like this version does not fix the problem.

dreez

comment:38 by the go to guy, 10 years ago

I hope this helps someone else, if you've re attached the storage and it's an old snap shot, instead attach the latest snapshot.vdi instead.

Eg attach {sdf897etcetc}.vdi not yourmachine.vdi

comment:39 by Peng, 9 years ago

Snapshot use Microsoft's difference virtual technology, this means you can create a child VHD file (maybe more classes) from a parent VHD file; this child VHD points its parent and records the incremental changes from its parent VHD. If you want to go back previous status, you can redirect your VHD to your original parent file. But the precondition is your parent VHD and your child VHD MUST be in the same partition. For some reason many people put their Vbox storage files into different partition, for example, put the system disk at the SSD in order to improve the performance. In this case Snapshot will crash your VMs, the way to restart your system is:

  1. Rename your system VHD and use this command:VBoxManage internalcommands sethduuid yourvhdfilename
  2. Recreat a new VM and point your system storage to the existing and renamed VHD
  3. Point your others storage disk to their original place.
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use