Page 1 of 1

Failed to open a session for the virtual machine

Posted: 9. Aug 2015, 04:30
by RossB
The popup box says "No error info." Details show
Result Code: E_FAIL (0x80004005)
Component: ProgressProxy
Interface: IProgress
The perhaps slightly more informative log is attached.

The virtual media manager shows that the second virtual hard disk has troubles:
Could not open the medium [path].vdi
Error reading pre-header in [path].vdi (VERR_EOF)
VD: error VERR_VD_VDI_INVALID_HEADER opening image file (*see footnote)

When I attempt to start the VM, which is in the saved state, the window that would hold the VM pops up for about a second and then closes. Then the failure message pops up. The machine was probably in a window taking up the whole screen before it was saved.

When this problem arose I tried to restart the machine several times. Then I closed everything and restarted the machine. There was a disk check during the restart, which found and "fixed" quite a few problems. No better luck starting the VM afterwards.

The host system is running Windows 7 Pro (64 bit) running Dell Data Protection Encryption 8.3.2.6161 for the disk and Symantec Endpoint Protection 12.1.4112.4156 anti-virus. VirtualBox 4.3.30 r101610 64 bit. The system I'm trying to start is 64 bit Linux.

What can I do? Would reinstalling the VirtualBox software be a possible fix (e.g., if one of the program files is corrupted)? Worst case, I could try going back to the last snapshot; that would lose some work (and I don't know that will work).

The VM was created an earlier version of VirtualBox, I think 4.3.20 or .22.

(*) Is there a good way to capture this information? It only showed up when I hovered over the line in the disk manager with the disk, and so I had to remember a bit, type a bit, repeat.

Re: Failed to open a session for the virtual machine

Posted: 10. Aug 2015, 10:08
by aeichner
Your VDI looks corrupted beyond repair. VBox fails to read the header of the file which is only a few bytes long at the beginning of the file. If you have a look at the file it should only be a few bytes long.

Re: Failed to open a session for the virtual machine

Posted: 10. Aug 2015, 21:52
by RossB
Thanks for your response. The named vdi file is 0 bytes. The vdi file is identified as "dynamically allocated differencing storage" and the VMM (virtual media manager) does show vdi file under Snapshots with a UUID-type name, 6MB allocated out of 20GB. I doubt it had as little as 6MB before the crash.

I have some questions about recovering, and about how it happened.

Recovery
I tried to clone the VM (full clone) before further experiments, but that failed. Is there some way I can make a backup copy? I tried a clone that did not include snapshots; I've attached a screenshot of the error that resulted.Image

The virtual disk that failed had nothing critical to the system, and so I'd like to get the VM started without it.

Is there a way to substitute a new virtual disk for the broken one? The options to remove the old disk ("remove attachment" in the VM settings or release in the VMM=virtual media manager) are greyed out. I'm guessing that is related to the VM being in a saved state.

Alternately, I have snapshot taken just after adding the virtual disk which later failed. Using it is less desirable because I would lose other work on VM. Would reverting to that snapshot help, or will it likely suffer from the same corruption as the current version of the VM?

Diagnosis/Future Avoidance
I'm surprised this happened, though less so given the apparent corruption of the host physical disk. I have wondered if putting the host in sleep or hibernate mode is safe while the VM, or even VirtualBox, is running. Is it? Is there something else that might have triggered the problem? Since the VM is in a saved state it doesn't seem it was active, though perhaps I suspended or shut down the host before the VM was saved completely.

Re: Failed to open a session for the virtual machine

Posted: 14. Aug 2015, 04:12
by noteirak
Given your disk corruption, I would NOT advise to use any kind of saved state or snapshot. Just create a new VM with the same settings.

Re: Failed to open a session for the virtual machine

Posted: 15. Aug 2015, 05:14
by RossB
The problem is that I have some work in the VM (specifically its virtual disk) that I'd like to recover. I think most of the work is on the apparently OK virtual disk rather than the corrupt one.

I appreciate your advice that the VM is not trustworthy, and will make a new one. But that's not going to get my lost work back.

I also wonder if I might have run into a bug. I think I took the snapshot right after attaching the new virtual disk, and I wonder if that's why the VDI file is empty even though it's related snapshot file is not.

Ross

Re: Failed to open a session for the virtual machine

Posted: 15. Aug 2015, 20:45
by noteirak
You can always make a new VM and also attach the old disk after the OS install - this will be like a 2nd harddrive you plug in your computer to recover data.

Re: Failed to open a session for the virtual machine

Posted: 16. Aug 2015, 21:30
by RossB
I was able to copy the good virtual disk and get the info off it. Because of snapshotting, I assume, this was not straightforward. Here's what worked (following advice on the growing a hard disk FAQ):

Code: Select all

c:\Users\Ross\VirtualBox VMs>"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" clonehd wheezy10\Snapshots\{0a851908-e80e-4a92-aeab-8e5314682165}.vdi s.vdi --format VDI --variant standard
.

The UUID was for the last snapshot. However, the following did not work:

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe clonehd 0a851908-e80e-4a92-aeab-8e5314682165 c:\Users\Ross\Documents\spare.vdi
The latter only produced a virtual disk that was, I think, at the time of the first snapshot. All the other methods I tried had the same problem. Those included using the virtual media manager gui, which only allowed me to make a copy of the top level vdi file, not any of the snapshots.

I don't know if using the file name instead of the UUID or one of the options made the difference. Does anyone know? The default values for the options don't seem to be in the manual or online help.

Here's some background on the virtual disks and snapshots. The first set refer to my intact virtual disk; the second set, starting with the vdb file, refer to the apparently corrupted second disk. The very last entry is for the disk created by the second, unsuccessful clone command given above (I renamed the file after creation). I''ve edited out the other list entries.

Code: Select all

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe list hdds

UUID:           faacbd2a-7b2c-46ab-bde7-066881474efc
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       C:\Users\Ross\VirtualBox VMs\wheezy10\wheezy10-sda.vdi
Storage format: VDI
Capacity:       20480 MBytes

UUID:           547f0025-1fe0-41d4-85cd-df3541cfd637
Parent UUID:    faacbd2a-7b2c-46ab-bde7-066881474efc
State:          created
Type:           normal (differencing)
Location:       C:\Users\Ross\VirtualBox VMs\wheezy10\Snapshots/{547f0025-1fe0-41d4-85cd-df3541cfd637}.vdi
Storage format: VDI
Capacity:       20480 MBytes

UUID:           9730b1e9-cc50-424e-b9f8-96065377234b
Parent UUID:    547f0025-1fe0-41d4-85cd-df3541cfd637
State:          created
Type:           normal (differencing)
Location:       C:\Users\Ross\VirtualBox VMs\wheezy10\Snapshots/{9730b1e9-cc50-424e-b9f8-96065377234b}.vdi
Storage format: VDI
Capacity:       20480 MBytes

UUID:           0a851908-e80e-4a92-aeab-8e5314682165
Parent UUID:    9730b1e9-cc50-424e-b9f8-96065377234b
State:          created
Type:           normal (differencing)
Location:       C:\Users\Ross\VirtualBox VMs\wheezy10\Snapshots/{0a851908-e80e-4a92-aeab-8e5314682165}.vdi
Storage format: VDI
Capacity:       20480 MBytes

UUID:           8732fe72-0044-4bfa-835e-ba0db2ade85b
Parent UUID:    base
State:          inaccessible
Type:           normal (base)
Location:       C:\Users\Ross\VirtualBox VMs\wheezy10\wheezy10-sdb.vdi
Storage format: VDI
Capacity:       0 MBytes

UUID:           3e7b6aea-b5c3-402c-b1cb-1b216ac30ad4
Parent UUID:    8732fe72-0044-4bfa-835e-ba0db2ade85b
State:          created
Type:           normal (differencing)
Location:       C:\Users\Ross\VirtualBox VMs\wheezy10\Snapshots/{3e7b6aea-b5c3-402c-b1cb-1b216ac30ad4}.vdi
Storage format: VDI
Capacity:       20480 MBytes


UUID:           96c147f2-6cde-4dad-8623-ee92d7eebcdb
Parent UUID:    base
State:          locked write
Type:           normal (base)
Location:       C:\Users\Ross\VirtualBox VMs\wheezy10\wheezy11-was10-sda.vdi
Storage format: VDI
Capacity:       20480 MBytes