Ticket #16074 (closed defect: fixed)

Opened 5 years ago

Last modified 4 years ago

stateFile reference in vbox file corrupted upon moving VM

Reported by: wouterk__ Owned by:
Component: VMM Version: VirtualBox 5.1.6
Keywords: move;snapshot;stateFile Cc:
Guest type: all Host type: Windows


When I use the VirtualBox GUI to move a VM having a live snapshot, the stateFile reference in the vbox file gets corrupted:

"Snapshots/filename.sav" becomes "Snapshots/filename.sav/Snapshots/filename.sav".

This quickly results in the VM not starting any more.

VirtualBox versions tested: 5.0.26 and 5.1.6

Host: Windows 7x64

Guest: any

Steps (all done via the VirtualBox GUI (except the vbox file copies via Windows Explorer):

  1. Create a new VM in an existing group. For instance: a Debian 64-bit VM called Deb in a group called Microsoft, accepting all defaults.
  2. Start the VM, boot from an installation iso and let the VM run for a few moments. (E.g. debian-8.6.0-amd64-kde-CD-1.iso almost instantly settles at its boot menu.)
  3. Take a (live) snapshot of the VM called Snapshot 1.
  4. Close the VM, selecting "Power off the machine" and "Restore current snapshot 'Snapshot 1'".

Resulting snapshot tree: "Snapshot 1" -> "Current State (changed)".

[Actually the creation of "Current State (changed)" here might be the result of another bug, but that's probably another matter.]

  1. Using Windows Explorer, copy Deb.vbox to Deb1.vbox.
  2. Drag the VM to another group, e.g. "Linux".
  3. Copy Deb.vbox to Deb2.vbox.
  4. Start the VM. It is restored correctly at the point it was stopped (e.g. Debian's boot menu).
  5. Close the VM, again selecting "Power off..." and "Restore ... 'Snapshot 1'".
  6. Copy Deb.vbox to Deb3.vbox.
  7. Start the VM. The VM aborts almost immediately, and a dialog box pops up, stating:
VirtualBox - Error
Failed to open a session for the virtual machine Deb.
The VM session was closed before any attempt to power it on.
Result Code: 
E_FAIL (0x80004005)
ISession {7844aa05-b02e-4cdd-a04f-ade4a762e6b7}

VBox.log provides the following error messages:

ERROR [COM]: aRC=VBOX_E_FILE_ERROR (0x80bb0004) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={VM cannot start because the saved state file 'Z:\VM\VirtualBox\Machines\Linux\Deb\Snapshots\2016-10-17T12-48-59-752997200Z.sav\Snapshots\2016-10-17T12-48-59-752997200Z.sav' is invalid (VERR_PATH_NOT_FOUND). Delete the saved state prior to starting the VM}, preserve=false aResultDetail=0
GUI: Aborting startup due to power up issue detected...

Note that Deb2.vbox (which was saved immediately after the VM was moved), already contains the invalid path in the snapshot definition:

    <Snapshot uuid="{12ae5280-3c84-409c-a9eb-03266b75b4e0}" name="Snapshot 1" timeStamp="2016-10-17T12:48:59Z" stateFile="Snapshots/2016-10-17T12-48-59-752997200Z.sav/Snapshots/2016-10-17T12-48-59-752997200Z.sav">

However, the machine state's stateFile is still correct (which is why the VM can still run successfully):

  <Machine uuid="{4091a06e-3382-47c8-a46d-3f2efa978a8d}" name="Deb" OSType="Debian_64" stateFile="Snapshots/2016-10-17T12-48-59-752997200Z.sav" currentSnapshot="{12ae5280-3c84-409c-a9eb-03266b75b4e0}" snapshotFolder="Snapshots" lastStateChange="2016-10-17T12:49:25Z">

However, in Deb3.vbox, saved after the first ("successful") run after the move, the machine state has also become corrupted:

  <Machine uuid="{4091a06e-3382-47c8-a46d-3f2efa978a8d}" name="Deb" OSType="Debian_64" stateFile="Snapshots/2016-10-17T12-48-59-752997200Z.sav/Snapshots/2016-10-17T12-48-59-752997200Z.sav" currentSnapshot="{12ae5280-3c84-409c-a9eb-03266b75b4e0}" snapshotFolder="Snapshots" currentStateModified="false" lastStateChange="2016-10-17T12:48:59Z">

This explains why the VM doesn't start any more.

Things get even worse if I then move the VM back to its original (or any other?) location: stateFile then becomes a quadrupled path:



Deb1.vbox Download (5.7 KB) - added by wouterk__ 5 years ago.
vbox file before moving VM
Deb2.vbox Download (5.7 KB) - added by wouterk__ 5 years ago.
vbox file immediately after moving VM
Deb3.vbox Download (5.8 KB) - added by wouterk__ 5 years ago.
vbox file after running moved VM
VBox.log Download (1.2 KB) - added by wouterk__ 5 years ago.
Log file of session that "failed to open"

Change History

Changed 5 years ago by wouterk__

vbox file before moving VM

Changed 5 years ago by wouterk__

vbox file immediately after moving VM

Changed 5 years ago by wouterk__

vbox file after running moved VM

Changed 5 years ago by wouterk__

Log file of session that "failed to open"

comment:1 Changed 4 years ago by frank

Same problem as in #16745. Will be fixed in 5.1.24. The most recent 5.1.x test builds (>=115382) contain the fix as well.

comment:2 Changed 4 years ago by frank

Fix is part of 5.1.24.

comment:3 Changed 4 years ago by frank

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.
ContactPrivacy policyTerms of Use