I’ve been needing to do a lot of work with quick VM testing recently, firing up VMs, running scenarios for clients and my first point of call is always Oracles VirtualBox opensource visualization tool. It’s reliable, free, and ideal for mucking about with virtual machines and giving things a once over.
Until today.
Today I had to create a load of VMs, import some backups, run through some scenarios and see what was likely to happen. I have no idea why, but each time I rebooted after taking a snapshot of a VM the guest failed to boot and VirtualBox gave me the following delightful error;
Now this was an issue. Each time I booted the VM after a snapshot was taken, the VM wouldn’t fire up and VirtualBox Media Manager showed exclamation marks for that drive and it’s snapshots.
After a bit of digging and testing with the command line I found that for some reason the snapshots weren’t associated with the original disk. They were there, Media Manager could see them and showed them in the right place, but the snapshots uuidParent tag was blank instead of pointing at the main disk image.
So, if you get an error in VirtualBox stating “Parent UUID {00000000-0000-0000-0000-000000000000} of the medium “blah” does not match UUID” then this might be a help
- Add the VirtualBox directory to the system PATH variable as there’s a wealth of great command line tools in there and it’s good to access them easily.
1set path=%path%;C:\Program Files\Oracle\VirtualBox - Get the uuidCreation parameter of your parent virtual hard disk. I’ve highlighted it in bold.
1234567VBoxManage.exe internalcommands dumphdinfo c:\MyVirtualGuests\MyVirtualDisk.vhd--- Dumping VD Disk, Images=1Dumping VD image "MyVirtualDisk.vhd" (Backend=VHD)Header: Geometry PCHS=65535/16/255 LCHS=0/0/0 cbSector=512Header: uuidCreation=<strong>{3d3ebec3-d46c-4686-8754-729d7e8004e7}</strong>Header: uuidParent={00000000-0000-0000-0000-000000000000} - Get the uuidParent of the snapshot that is mentioned in your error. In my screenshot above the snapshot is catchily called {7cc77399-c4e0-4595-882d-73f81b9c1331}.vhd.
1234567VBoxManage.exe internalcommands dumphdinfo "{7cc77399-c4e0-4595-882d-73f81b9c1331}.vhd"--- Dumping VD Disk, Images=1Dumping VD image "{7cc77399-c4e0-4595-882d-73f81b9c1331}.vhd" (Backend=VHD)Header: Geometry PCHS=65535/16/255 LCHS=0/0/0 cbSector=512Header: uuidCreation={7cc77399-c4e0-4595-882d-73f81b9c1331}Header: uuidParent={00000000-0000-0000-0000-000000000000} - You can see that the output shows that the uuidParent setting for the {7cc77399-c4e0-4595-882d-73f81b9c1331}.vhd snapshot is blank; it’s been orphaned for some reason. Lets fix that.
123VBoxManage.exe internalcommands sethdparentuuid "{7cc77399-c4e0-4595-882d-73f81b9c1331}.vhd" {3d3ebec3-d46c-4686-8754-729d7e8004e7}UUID changed to: 3d3ebec3-d46c-4686-8754-729d7e8004e7 - Now you can either restart VirtualBox and start your VM again or you can click on File > Virtual Media Manager and then click on your disk and click Refresh.