Page 1 of 2

Cannot start VM of Windows 7 64bit after creating a snapshot

Posted: 18. Feb 2015, 20:16
by ToHoHo
A while ago I created a VM of Windows 7 64 bit. Everything actually worked fine. In order to be on the safe side I decided to create a snapshot.

Today I wanted to run the VM again. However, what I get after starting the VB manager is a warning. It says:
One or more virtual hard disks, cd/dvd or floppy media are not currently accessible. As a result you will not be able to operate virtual machines that use these media until they become accessible later.
If I select "check", the Virtual Media Manager opens and I have a warning symbol in front of snapshot VHD. If I hover over it, a window shows up stating:
Parent UUID {00000000-0000-0000-0000-000000000000} of the medium 'C:\Users\User\VirtualBox VMs\XXXX\Snapshots/{6f6bed49-0fe6-4458-612-093ddfb81be4}.vhd' does not match UUID {05872920-d882-404a-a034-161792b554c7} of its parent medium stored in the media registry 'C:\Users\User/.VirtualBox\VirtualBox.xml'
If I ignore everything and just try to start the VM I receive the following error:
Failed to open a session for the virtual machine XXXX.

No error info.

Result Code: E_FAIL (0x80004005)
Component: ProgressProxy
Interface: IProgress {c20238e4-3221-4d3f-8891-81ce92d9f913}
Some more info: The primary master storage (vhd) is stored on a NAS while the snapshots are stored in 'C:\Users\User\VirtualBox VMs\XXXX\Snapshots'. Thus, I believe my problems is similar to what is described here
cchitsiang.blogspot.de/2013/09/virtualbox-tips-avoid-creating.html?_escaped_fragment_#!
and here
mcgrane.co.uk/Post/Parent-UUID-of-the-medium-does-not-match-UUID-of-its-parent
What I tried so fare:
1. Restore snapshot
2. Fixing the issue with this SetVHDParentUUID tool (for SetVHDParentUUID tool see >>mcgrane.co.uk/Post/Parent-UUID-of-the-medium-does-not-match-UUID-of-its-parent<<)

Both without success.

Any help appreciated a lot!

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 18. Feb 2015, 20:36
by mpack
ToHoHo wrote:In order to be on the safe side I decided to create a snapshot.
I'm not entirely sure what you think creating a snapshot makes you safe from. I hope you don't confuse snapshots with backups! Snapshots allow you to create multiple states for the guest. They will not help at all if you have a problem on the host, which is where all physical errors will come from. True backups are stored on secondary media and protect both host and guest.

Anyway, it would be useful if you zipped up and attached :-
  1. The .vbox file from this VM.
  2. A copy of the VirtualBox.xml file, since that file is named in the error message.
  3. The last complete log file from the Logs subfolder. Please do not give me every log you see in there, as I'm only prepared to spend a certain portion of my life wading through someone else's logs. Just pick the largest log file for a completed session.
  4. Screenshot or text listings showing the contents of the VM folder and its Snapshots subfolder. I want to see file names, sizes and creation dates
Out of curiosity, why are you using VHD files? That is the poorest of the mainstream formats by a long way. Nobody would be using it if MS weren't involved, and even they have abandoned it in favor of vhdx.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 19. Feb 2015, 02:43
by ToHoHo
mpack wrote:I'm not entirely sure what you think creating a snapshot makes you safe from. I hope you don't confuse snapshots with backups! Snapshots allow you to create multiple states for the guest. They will not help at all if you have a problem on the host, which is where all physical errors will come from.
Well, I am kind of a newbie to VMs (as you might have guessed) and I read that one indeed might mess around with the guest (e.g., drivers). Thus the snapshot.

Anyway. ;)
mpack wrote: Anyway, it would be useful if you zipped up and attached :-

The .vbox file from this VM.
A copy of the VirtualBox.xml file, since that file is named in the error message.
The last complete log file from the Logs subfolder. Please do not give me every log you see in there, as I'm only prepared to spend a certain portion of my life wading through someone else's logs. Just pick the largest log file for a completed session.
ZIP is attached. Regarding the log: All log files are from today except the startup log which seems to contain older logs. Hope this is suitable as well.
mpack wrote:Screenshot or text listings showing the contents of the VM folder and its Snapshots subfolder. I want to see file names, sizes and creation dates
VM folder local:

Code: Select all

 C:\Users\User\VirtualBox VMs\FTM AP-252

19.02.2015  00:59    <DIR>          .
19.02.2015  00:59    <DIR>          ..
18.02.2015  18:55            25.219 FTM AP-252.vbox
18.02.2015  18:55            25.219 FTM AP-252.vbox-prev
18.02.2015  18:55    <DIR>          Logs
18.02.2015  17:38    <DIR>          Snapshots
               2 Datei(en),         50.438 Bytes
               4 Verzeichnis(se), 94.391.902.208 Bytes frei
Snapshot folder:

Code: Select all

 C:\Users\User\VirtualBox VMs\FTM AP-252\Snapshots

19.02.2015  01:01    <DIR>          .
19.02.2015  01:01    <DIR>          ..
09.02.2015  22:20       981.438.540 2015-02-09T21-19-56-311380700Z.sav
18.02.2015  17:50           531.968 {a0628220-d292-4ce5-af2b-c3d019160a97}.vhd
               2 Datei(en),    981.970.508 Bytes
               2 Verzeichnis(se), 94.391.906.304 Bytes frei
Folder containing .vhd:

Code: Select all

 N:\Diss\AP-252 Virtual

03.02.2015  16:24    <DIR>          .
18.02.2015  18:18    <DIR>          ..
28.01.2015  21:08    528.896 AP-252.pvp
18.02.2015  18:07   180.126.929.408 AP-252.vhd
               2 Datei(en), 180.127.458.419 Bytes
               2 Verzeichnis(se), 1.344.169.484.288 Bytes frei
mpack wrote:Out of curiosity, why are you using VHD files? That is the poorest of the mainstream formats by a long way. Nobody would be using it if MS weren't involved, and even they have abandoned it in favor of vhdx.
Good question, simple answer: I read a tutorial about how to conserve an old machine as virtual machine. In this tutorial they advised to use Xen Convert to create an VHD. Tutorial is from mid 2013 which I did not regard as being too old. Maybe a bad misjudgment on my side.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 19. Feb 2015, 12:34
by mpack
For future reference, when one of us asks for a log, we mean the "VBox.log" file, or one of its 3 rolling backup copies, if the older sessions contain the relevant event. We never mean the startup log or any other log unless we make a point of asking for it. The VM log file tells us a lot about the VM environment over the entire session, the startup log is a recent and more specialized innovation.

Happily, your problem looks obvious :-
FTM AP-252.vbox wrote: <HardDisk uuid="{8280c76a-7128-4a36-af59-bc491c65a9d5}" location="N:/Diss/AP-252 Virtual/AP-252.vhd" format="VHD" type="Normal">
xxx<HardDisk uuid="{a0628220-d292-4ce5-af2b-c3d019160a97}" location="Snapshots/{a0628220-d292-4ce5-af2b-c3d019160a97}.vhd" format="VHD"/>
</HardDisk>
Note the strange location. What is drive N? Whatever that location is, I'm going to assume that the base VDI file is no longer present there. Locating files outside the VM folder can be quite dangerous.

I don't see how creating a snapshot could have caused the base file location to change.

The best cure would be to find the VHD file, locate it inside the VM folder (beside the .vbox file), then manually edit the location field highlighted above so that there is no path. It should just say "AP-252.vhd". Notepad++ is good for editing XML files such as the vbox file.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 19. Feb 2015, 15:55
by ToHoHo
Thank you very much for your fast help on my issue. Well, first of all I assume VDI in my case means VHD?! Or is also a VDI created if I run a VHD as VM?

Therefore, my responses are in accordance with the assumption above.
mpack wrote:Note the strange location. What is drive N?
As I stated before: The VHD is located on my NAS (drive N).
mpack wrote:Whatever that location is, I'm going to assume that the base VDI file is no longer present there.
As you can see from my last post (third folder writing) a ca. 175 GB VHD is present and accessible on drive N.
mpack wrote:The best cure would be to find the VHD file, locate it inside the VM folder (beside the .vbox file), then manually edit the location field highlighted above so that there is no path.
Due to hard drive space I would like to keep the VHD on my NAS. So, I moved the default machine folder to the NAS in this case and applied the changes to the .vbox as advised. However, brings the same errors :roll:

Well, I assume there to be a mismatch of the UUID of the snapshot and its parent medium (as stated by one of the "errors"). But how can I edit the snapshots UUID?!

Trying to do something about it I just wanted to access the VBoxManager via CMD (as admin)

Code: Select all

VBoxManage list vms
However, Windows told me it could not find the command. Isn't that strange?

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 19. Feb 2015, 16:33
by mpack
ToHoHo wrote:Thank you very much for your fast help on my issue. Well, first of all I assume VDI in my case means VHD?!
Yes, I meant VHD.
ToHoHo wrote:
mpack wrote:Note the strange location. What is drive N?
As I stated before: The VHD is located on my NAS (drive N).
Right, so you did. Sorry about that.

Re VBoxManage: it is not really odd that you got command not found. That just means that your host command search path does not include the VBox executable folder. I've already had this discussion today, so I'll just direct you to read viewtopic.php?f=6&t=66171#p313376.


Re your problem, let's try something else. Suppose you examine the snapshot VHD using CloneVDI. What does the "Header info..." feature tell you about the snapshots creation-UUID and parent-UUID fields? Then open the base VHD in your NAS folder. What are the creation and parent UUIDs there?


Incidentally: your VirtualBox.xml does not contain any registered media, so at the very least the error message contains at least one red herring. I'm leaning towards a suspicion that VirtualBox has a bug if you have a VHD snapshot chain in which the base VHD is not in the VM folder.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 19. Feb 2015, 23:59
by ToHoHo
mpack wrote:let's try something else. Suppose you examine the snapshot VHD using CloneVDI. What does the "Header info..." feature tell you about the snapshots creation-UUID and parent-UUID fields?
Header info of snapshot:
SnapshotHeader.png
SnapshotHeader.png (7.04 KiB) Viewed 7545 times
mpack wrote:Then open the base VHD in your NAS folder. What are the creation and parent UUIDs there?
Regarding the VHD: I am not able to access this file format with CloneVDI:
VHD.png
VHD.png (11.39 KiB) Viewed 7545 times
mpack wrote:I'm leaning towards a suspicion that VirtualBox has a bug if you have a VHD snapshot chain in which the base VHD is not in the VM folder.
I wouldn't be on the contrary due to my inital links here and here. Both blogs address potential problems with VHDs and snapshots while the later narrows the issue down to problems
with Oracle's VirtualBox that seems to be caused by having snapshots stored in a directory that is not right below the VHD file.
Both posts are from 2013 though. Therefore I thought this issue might be well known by now.

P. S.: As for me I figured out today how I can remove a VM from the VB GUI and set it up in such a way that VB does not care about the snapshots. As I still have a copy of the VHD in its original state, I just set up the VHD which triggered the snapshot problems from the bottom without including the snapshot. Thus, the VM is running fine again. Anyway, if you need my support to narrow the bug you can count on my help. I did not delete any files so far ;)

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 20. Feb 2015, 01:32
by mpack
Well, we seem to have established that the base VHD is not a VHD at all. But, the snapshot is not actually a snapshot either. I withdraw the suggestion of a VirtualBox bug.

Does CloneVDI allow you to clone the snapshot?

I'm not sure what you're telling me about your solution. Building a new VM around a base hd is not a general solution since it loses all data from the entire snapshot chain (i.e. everything done since the first snapshot was created).

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 24. Feb 2015, 19:38
by ToHoHo
mpack wrote:Does CloneVDI allow you to clone the snapshot?
Nope, as you can see in the picture above the "Proceed" button is not executable.
mpack wrote:I'm not sure what you're telling me about your solution. Building a new VM around a base hd is not a general solution since it loses all data from the entire snapshot chain (i.e. everything done since the first snapshot was created).
Well, but it keeps what is saved in the VHD, doesn't it? E.g. if I create a document and save it on the VM, wouldn't it be saved in the VHD? Anyway, after building the new VM I did not encounter any dramatic changes. But maybe because I did not do lot of changes since setting up the original VM.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 25. Feb 2015, 12:48
by mpack
ToHoHo wrote:Well, but it keeps what is saved in the VHD, doesn't it? E.g. if I create a document and save it on the VM, wouldn't it be saved in the VHD?
Eh? No. After the snapshot is created all writes go there, and the older VHD is frozen. A snapshot chain is a diff chain. Using the base VHD in another VM modifies the VHD, corrupting the diff chain.

But yes, in your case the failure happened almost immediately after the snapshot was created, therefore you had little or nothing written to the snapshot. I'm only pointing out that you should not regard this is a general solution. Had you not been lucky about the timing the result would have been catastrophic data loss.

Snapshots are like restore points in Windows: not a lot of use when the disk dies. Hopefully you are now creating real backups.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 27. Feb 2015, 00:23
by ST
Hi mpack,

I have been having the same issue. My host OS is Windows 7 Professional 64 bit and I have guest OSs running Windows XP, Windows Server 2008 and Windows Server 2012 R2. Currently the Oracle VirtualBox version is 4.3.22 with Guest Additions of the same version.

- All my VMs are using VHD hard disk format (due to certain requirements).
- All my VM hard disks are not on the default virtual box folder (due to space constraints). They are on other local hard disks.
- Until version 4.3 snapshots worked without a problem for all VMs.
- Since 4.3 snapshots stopped working. I know this because last week I installed older versions until I found one where the snapshots worked. I found that snapshots worked in version 4.2.6. However the problem with that is 4.2.6 didn't support Windows Server 2012 R2. So I'm back on version 4.3.22.
- After reading this comment in the chain
Incidentally: your VirtualBox.xml does not contain any registered media, so at the very least the error message contains at least one red herring. I'm leaning towards a suspicion that VirtualBox has a bug if you have a VHD snapshot chain in which the base VHD is not in the VM folder.
I put the VHD file in the VM folder and snapshots worked. I tried this with 2 VMs. 1 running Windows XP and the other running Windows Server 2012 R2.

So I do believe that there is a bug with snapshots in version 4.3 when the VHD files are not located in the VM folder.

I use snapshots to test new installations and configuration changes. If I like the result I merge the snapshot. If I don't like the result, I delete the snapshot going back to the last good configuration. So I'm hoping this issue gets resolved :).

The error I get when starting up a VM with snapshot is:

Failed to open a session for the virtual machine WinXPMCE.

No error info.

Result Code: E_FAIL (0x80004005)
Component: ProgressProxy
Interface: IProgress {c20238e4-3221-4d3f-8891-81ce92d9f913}

And when I try to delete the snapshot, I get this error:

Failed to delete the snapshot Snapshot 1 of the virtual machine WinXPMCE.

Parent UUID {00000000-0000-0000-0000-000000000000} of the medium 'C:\Users\t\VirtualBox VMs\WinXPMCE\Snapshots\{c37c5dd9-ed48-40ba-9594-c9d67580dc21}.vhd' does not match UUID {58c773b9-e66b-2a4f-a805-91367074598d} of its parent medium stored in the media registry ('C:\Users\t/.VirtualBox\VirtualBox.xml').

Result Code: E_FAIL (0x80004005)
Component: Medium
Interface: IMedium {05f2bbb6-a3a6-4fb9-9b49-6d0dda7142ac}

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 27. Feb 2015, 01:01
by Perryg
@ST,

I wonder if your problem is because you set the home variable due to your changes.

VirtualBox 4.3.22 (released 2015-02-12)
Settings: on Windows host, do not use environment variable HOME at all, the settings location is derived from the user profile directory (bug #7689)

https://www.virtualbox.org/ticket/7689

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 27. Feb 2015, 03:08
by ST
Perryg wrote: I wonder if your problem is because you set the home variable due to your changes.
Hi Perryg,

I don't believe I'm using the HOME variable. I checked my user and system variables and didn't see it there. Also in command line when I do "echo %home%", I get nothing. I also went to VirtualBox> File> Preferences> General> Default Machine Folder and selected "Reset" and the folder got reset to %USERPROFILE%\VirtualBox VMs. Let me know if I need to check elsewhere.

Thank you.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 27. Feb 2015, 12:26
by mpack
Re the "suspected bug". If you read further in the chain then you will see this suspicion was unfounded, so lets not have a myth grow around patterns that aren't there.

The suspicion was very specific: that the parent UUID link of "0000..." was incorrect, a bug caused by the parent VHD being stored outside the VM folder. And since no parent could have that UUID, that would explain why the parent was not found. VHD is not the native disk format so bugs in this area seemed credible to me.

However, further testing with CloneVDI (as a independant source) showed that the 0000 link was embedded in the "snapshot" VHD, so VBox giving that UUID in the error message was not a bug. Nothing in the above thread has established why the link is 0 - there are many known causes, the most obvious of which is inexpert cloning of a snapshot chain.

Re: Cannot start VM of Windows 7 64bit after creating a snap

Posted: 27. Feb 2015, 18:30
by ST
Hi mpack and perryg,

In addition to all the information I have provided in my first post, let me know what else I can do to help with this. Summary is, for me starting from VirtualBox version 4.3, if the base VHD is in the default VM folder (folder with .vbox file), snapshot works. If the base VHD is not in the default VM folder, snapshot does not work. There is no snapshot chain because once a snapshot is taken, the VM does not work and the first error (Failed to open a session...) is displayed when trying to start the VM. Also it is not possible to delete the snapshot using the GUI because the second error (Failed to delete the snapshot...) is displayed. Both VMs in question were created from scratch using VirtualBox.

Snapshots saves me a lot of time so I hope you guys can help in resolving this.

Thank you in advance.