[Solved] Old snapshot deleted - Parrent UUID of the medium does not match ...

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

[Solved] Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

I use Parrot OS and have a VirtualBox with Parrot OS running in it. An image of the corresponding structure/snapshots is attached.
I deleted an older snapshot (early to mid November 2023 I think) that was in between "clean_install_upgraded" and the snapshot "20231126" as it was not needed anymore.
At first glance everything seemed to have worked ok. There were no messages or anything from VirtualBox.
But when I now try to start the "Current State" it fails and I get the following error messages:
Failed to open a session for the virtual machine Parrot Sec.

Parent UUID {96bdd681-178a-45b2-a3c3-5146d35c141c} of the medium '/home/abc/VirtualBox VMs/Parrot Sec/Snapshots/{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}.vdi' does not match UUID {7afa0321-00f4-4578-9f81-d4c819973c68} of its parent medium stored in the media registry ('/home/abc/.config/VirtualBox/VirtualBox.xml').

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: MediumWrap
Interface: IMedium {ad47ad09-787b-44ab-b343-a082a3f2dfb1}
My experience with Virtualbox is very limited and I would highly appreciate any help to get the latest version running again without loosing the data.

Update: Log file added
Attachments
vm.log
(2.13 KiB) Downloaded 17 times
img_02.png
img_02.png (11.22 KiB) Viewed 3361 times
img_01.png
img_01.png (25.25 KiB) Viewed 3361 times
Last edited by Green on 17. Mar 2024, 12:17, edited 3 times in total.
Whiskeyjack
Oracle Corporation
Posts: 122
Joined: 28. Aug 2017, 13:14

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Whiskeyjack »

Hi. Please attach the VM log as explained in the "posting guide". viewtopic.php?t=8208
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

I added the log file that I obtained via "Show Log".
klaus
Oracle Corporation
Posts: 1139
Joined: 10. May 2007, 14:57

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by klaus »

This will be tricky... this shouldn't ever happen obviously and will need some hairy manual repair which needs more input: the VM config file (the one with extension .vbox) and a list of files in the VM's "Snapshots" directory. This may or may not be enough, we'll ask if necessary. Oh, and one important thing: the repair attempts will be a risk for the disk images, so you really should think about creating a backup of the whole VM directory in case multiple attempts are needed. It's all too easy to make the damage bigger, and we're all human.
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

Here some additional information that might help:
When I deleted the Snapshot the progress bar went to 99%, a little later it went to 100%, and at a certain point I gained several GB of disk space. With my limited knowledge it looked like everything went according to plan. I was using the browser for some more minutes until my notebook froze. I had to power it off and after rebooting I had the issue.
The whole folder of the VM is approximately 200GB. I think I need a new hard drive for the folder backup.
What would the process of attempting to fix it look like?
What further information are required?

File list of Snapshot folder:
18. Okt 2022 2022-10-18T19-36-12-001555000Z.sav
16. Nov 2022 2022-11-16T09-59-26-238512000Z.sav
31. Jul 2023 2023-07-31T20-57-32-116697000Z.sav
29. Feb 2024 {7afa0321-00f4-4578-9f81-d4c819973c68}.vdi
14. Nov 2023 {98b268a3-d928-4257-adc5-4af31538e27a}.vdi
28. Feb 2024 {c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}.vdi
26. Nov 2023 {c964f084-67a3-40ae-8c92-75d9b6188d58}.vdi
Attachments
Parrot Sec.txt
(20.06 KiB) Downloaded 18 times
Last edited by Green on 1. Mar 2024, 00:57, edited 1 time in total.
klaus
Oracle Corporation
Posts: 1139
Joined: 10. May 2007, 14:57

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by klaus »

Need some sleep, but it's very clear that the config file has a completely impossible disk image structure not matching the snapshots. Will see tomorrow if I can with reasonable certainty decide how things should fit together
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

Ok thanks. I work on the backup.
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

One assumption: The process of deleting the one snapshot and merging everything was successful but VirtualBox failed to adjust the links between the vdi files for whatever reason. Could this command below potentially fix my issue?

Code: Select all

VBoxManage internalcommands sethdparentuuid '/home/abc/VirtualBox VMs/Parrot Sec/Snapshots/{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}.vdi' {7afa0321-00f4-4578-9f81-d4c819973c68}
At the moment it seems like the snapshot after the deleted one is still linked to the deleted one but should be linked to the parent of the deleted one.
klaus
Oracle Corporation
Posts: 1139
Joined: 10. May 2007, 14:57

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by klaus »

No, the whole disk image/snapshot association is off. The "current state" refers to the base image when it actually should refer to the "last" image. I'll see what I can figure out in the next 15 minutes...
klaus
Oracle Corporation
Posts: 1139
Joined: 10. May 2007, 14:57

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by klaus »

This needs two fixes actually. But one thing first: while you do these changes there must be no VirtualBox related running. Check with the command

Code: Select all

ps -ef | grep [V]BoxSVC
that nothing is active. As long as the command shows any output you can't start.

Fix 1: Use some sensible text editor which doesn't do automatic line breaks and some such. Should be the case for all of them on Linux if you don't tell them to do something odd.
Initially it has the following section:

Code: Select all

      <HardDisks>
        <HardDisk uuid="{c397907f-74e8-41b8-873d-083cb9a23c9e}" location="Parrot Sec.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{7afa0321-00f4-4578-9f81-d4c819973c68}" location="Snapshots/{7afa0321-00f4-4578-9f81-d4c819973c68}.vdi" format="VDI">
            <HardDisk uuid="{c964f084-67a3-40ae-8c92-75d9b6188d58}" location="Snapshots/{c964f084-67a3-40ae-8c92-75d9b6188d58}.vdi" format="VDI"/>
            <HardDisk uuid="{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}" location="Snapshots/{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}.vdi" format="VDI"/>
          </HardDisk>
        </HardDisk>
      </HardDisks>
which you need to turn into

Code: Select all

      <HardDisks>
        <HardDisk uuid="{c397907f-74e8-41b8-873d-083cb9a23c9e}" location="Parrot Sec.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{7afa0321-00f4-4578-9f81-d4c819973c68}" location="Snapshots/{7afa0321-00f4-4578-9f81-d4c819973c68}.vdi" format="VDI">
            <HardDisk uuid="{c964f084-67a3-40ae-8c92-75d9b6188d58}" location="Snapshots/{c964f084-67a3-40ae-8c92-75d9b6188d58}.vdi" format="VDI">
              <HardDisk uuid="{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}" location="Snapshots/{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}.vdi" format="VDI"/>
            </HardDisk>
          </HardDisk>
        </HardDisk>
      </HardDisks>
Probably the best approach is using copy/paste (the forums have the "CODE: SELECT ALL" link which should help getting the right thing into the clipboard, but be extra careful that you don't change/delete anything else.

Guess now you know why I insisted you create a backup, because worst case you can restart...

Fix 2: Repair the broken parent UUID. The command you found is in principle correct, but the error message hinted to use the wrong UUID due to the additional VM config screwup.

Code: Select all

VBoxManage internalcommands sethdparentuuid '/home/abc/VirtualBox VMs/Parrot Sec/Snapshots/{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}.vdi' c964f084-67a3-40ae-8c92-75d9b6188d58
Once that's done you can fire up the VirtualBox GUI. First you should check that the yellow blobs you had in your img_001.png screenshot are gone (in Virtual Media Manager), and it's a 'linear chain' (previously c1c9... and c964... were at the same level, now c1c9 should be one level below c964). If that's the case and you see no other problems (the VM shouldn't show up as 'Inaccessible') then you can start it.

Fingers crossed.

(I'll be likely offline over the weekend, will see the success report hopefully on Monday.)
Last edited by klaus on 12. Mar 2024, 20:41, edited 1 time in total.
Reason: fix missing <HardDisks> tag in "after editing" state
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

Thank you klaus for your proposal!
I am not at home until after next weekend and I decided to leave the notebook at home, collect some social points and not spend my vacation time trouble shooting until late at night.

As soon as I am back I will test your approach. I already did a backup of the VM folder and am ready to go. I think I put too much trust in my system and the snapshot function and neglected thorough backups. Unfortunately the VM is quite large and my system was struggeling a lot with copying large files via USB. However, I made some progress on this issue yesterday.

As soon as I have news on this I am going to give an update. Let's hope for the best. Enjoy your weekend!
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

I just gave it a try and I am not there yet.
My first question is regarding the code in the "Parrot Sec.vbox".
I assumed that I have to add a "<HardDisks>" before what you proposed to copy is this correct?
So that it looks like this:

Code: Select all

      <HardDisks>
        <HardDisk uuid="{c397907f-74e8-41b8-873d-083cb9a23c9e}" location="Parrot Sec.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{7afa0321-00f4-4578-9f81-d4c819973c68}" location="Snapshots/{7afa0321-00f4-4578-9f81-d4c819973c68}.vdi" format="VDI">
            <HardDisk uuid="{c964f084-67a3-40ae-8c92-75d9b6188d58}" location="Snapshots/{c964f084-67a3-40ae-8c92-75d9b6188d58}.vdi" format="VDI">
              <HardDisk uuid="{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}" location="Snapshots/{c1c90f08-6f8d-467f-91a9-a5f5e1c8ad81}.vdi" format="VDI"/>
            </HardDisk>
          </HardDisk>
        </HardDisk>
      </HardDisks>
If I do so and also run the command you posted I get the situation shown in the attached image.

The error is the following:
Parent UUID {96bdd681-178a-45b2-a3c3-5146d35c141c} of the medium '/home/abc/VirtualBox VMs/Parrot Sec/Snapshots/{c964f084-67a3-40ae-8c92-75d9b6188d58}.vdi' does not match UUID {7afa0321-00f4-4578-9f81-d4c819973c68} of its parent medium stored in the media registry ('/home/abc/.config/VirtualBox/VirtualBox.xml').
Do I have to complete the chain by running the following command?

Code: Select all

VBoxManage internalcommands sethdparentuuid '/home/abc/VirtualBox VMs/Parrot Sec/Snapshots/{c964f084-67a3-40ae-8c92-75d9b6188d58}.vdi' 7afa0321-00f4-4578-9f81-d4c819973c68
UPDATE 1
I just tested the command above and attempted to run the machine. Unfortunately, it gets stuck in the boot process. It shows the image of Parrot OS but does not give me a login prompt.

UPDATE 2
With the above approach, I was able to start the Snapshot from November 26. Now I am busy to copy as much data as possible out of the VM. So far it looks good. Of course I would have a data loss of a few month but this is much better than what I expected. Right nw my idea would be to get as much data out of the broken VM and setup a new clean one (with real backups) and populate it with the data from the old one.
Attachments
Virtual Media Manager
Virtual Media Manager
chain_01.png (25.78 KiB) Viewed 2801 times
klaus
Oracle Corporation
Posts: 1139
Joined: 10. May 2007, 14:57

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by klaus »

Very sorry that I messed up the "after" state for editing. Yes, the <HardDisks> tag at the beginning was missing. I'll edit that post to avoid inconvenience for others referring to it later, but I wanted to keep a clear hint beyond the edit comment...

Good to see that you could get at least get the snapshot going... if the "current state" doesn't boot you'd have the possibility of booting into a rescue environment (Windows PE or Linux based) and check what you could access on the disk this way.
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

Thank you a lot klaus for your help!
Your hint with the rescue environment was also really helpful.
I am now able to boot into a rescue linux and mount the latest status before it broke.
It really seems like I can access all the files and just have to retrieve them from the broken machine.
Green
Posts: 9
Joined: 29. Feb 2024, 22:10

Re: Old snapshot deleted - Parrent UUID of the medium does not match ...

Post by Green »

I was able to retrieve all the data and now already have a new VM running. Glad that it turned out that way. Thanks again!
When I had the rescue Linux running, I somehow could not get it to access an external USB drive to store the data that I wanted to recover. As I did not want to spend a lot of time on figuring this out, I ended up running a web server on my host system and just uploaded the recovered data. It was fast and easy. Maybe a useful option to think of for others as well.
Post Reply