VM Inaccessible: has 1 differencing child hard disks.

This is for discussing general topics about how to use VirtualBox.
Post Reply
DaveHCYJ
Posts: 7
Joined: 22. Oct 2009, 00:22
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Gentoo, XP, LinuxMint

VM Inaccessible: has 1 differencing child hard disks.

Post by DaveHCYJ »

I need some help recovering this VM , I've got a solid 10 hours of work into building up the OS and patches etc. The VM is Gentoo, it shutdown normally and I shutdown VirtualBox. When I logged back onto my computer today and opened VirtualBox I'm getting this error:

Hard disk 'C:\Users\Dave\.VirtualBox\Machines\distccd-server\Snapshots\{53ca51ad-c6f2-4d74-b677-d8140883d8bc}.vdi' with UUID {53ca51ad-c6f2-4d74-b677-d8140883d8bc} cannot be directly attached to the virtual machine 'distccd-server' ('C:\Users\Dave\.VirtualBox\Machines\distccd-server\distccd-server.xml') because it has 1 differencing child hard disks.
Result Code:
E_FAIL (0x80004005)
Component:
Machine
Interface:
IMachine {540dcfda-3df2-49c6-88fa-033a28c2ff85}


I looked in the xml file for both this VM and the VirtualBox.xml file, it seems like they don't agree on how many snapshots there should be. The VirtualBox.xml file lists the snapshots as they should be. The VM.xml file only has 1 snapshot listed and the hex string doesn't match any of the snapshots in the snapshots folder.

I'm guessing I can rebuild the VM from the original VDI file and the snapshot files, but how? I tried searching but could only find how to revert to the base vdi file. I need the snapshots applied as well. Either that or how to I fix the xml files to recognize the snapshots as they should? I can post the xml files too if needed.
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by MarkCranness »

DaveHCYJ wrote:I looked in the xml file for both this VM and the VirtualBox.xml file, it seems like they don't agree on how many snapshots there should be. The VirtualBox.xml file lists the snapshots as they should be. The VM.xml file only has 1 snapshot listed and the hex string doesn't match any of the snapshots in the snapshots folder....
It might be that you are misinterpreting the snapshot UUIDs.
The first snapshot will (store) the UUID of the base VDI and a new machine differencing VDI is created (referenced in the <StorageControllers> section at the very end of the machine XML).
Every subsequent snapshot moves the machine VDI into the snapshot and then creates a new empty machine VDI.
(For a particular hard disk, in non-branched snapshot situations) There should be same number of <Image uuid=...> sections in the machine XML as there are <HardDisk uuid=...> sections in the VirtualBox XML, with the UUIDs in the same order (top-to-bottom wise, rather than tree-wise), but DON'T move them about.
DaveHCYJ wrote:I can post the xml files too if needed.
Please do that (no need to post the <Hardware> and <ExtraData> sections).
Last edited by MarkCranness on 22. Oct 2009, 07:46, edited 1 time in total.
DaveHCYJ
Posts: 7
Joined: 22. Oct 2009, 00:22
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Gentoo, XP, LinuxMint

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by DaveHCYJ »

If it matters I'm using version 3.0.8

From VirtualBox.xml:

Code: Select all

<MachineRegistry>
      <MachineEntry uuid="{58029def-6639-4b97-9a59-d593e38fd940}" src="Machines\distccd-server\distccd-server.xml"/>
    </MachineRegistry>
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{b1ccf165-2dbd-4d34-9f76-8026b13fc607}" location="HardDisks\distccd-server.vdi" format="VDI" type="Normal">
          <HardDisk uuid="{53ca51ad-c6f2-4d74-b677-d8140883d8bc}" location="C:\Users\Dave\.VirtualBox\Machines\distccd-server\Snapshots\{53ca51ad-c6f2-4d74-b677-d8140883d8bc}.vdi" format="VDI">
            <HardDisk uuid="{45b83b64-6a04-4771-8d37-72e3ec2518e5}" location="C:\Users\Dave\.VirtualBox\Machines\distccd-server\Snapshots\{45b83b64-6a04-4771-8d37-72e3ec2518e5}.vdi" format="VDI"/>
          </HardDisk>
        </HardDisk>
      </HardDisks>
      <DVDImages>
        <Image uuid="{6434b7fd-ea3b-4d5f-a619-76b9004c71e2}" location="C:\Users\Dave\.VirtualBox\gentoo-install-x86-minimal-20091013.iso"/>
      </DVDImages>
      <FloppyImages/>
    </MediaRegistry>
From machines/distccd-server/distccd-server.xml:

Code: Select all

<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.7-windows">
  <Machine uuid="{58029def-6639-4b97-9a59-d593e38fd940}" name="distccd-server" OSType="Gentoo" lastStateChange="2009-10-21T13:28:02Z" currentSnapshot="{eee53478-d88d-4bf9-9bdb-00ab3a10a60e}">
    <Snapshot uuid="{eee53478-d88d-4bf9-9bdb-00ab3a10a60e}" name="Stable Start" timeStamp="2009-10-21T04:57:35Z">
      <Description/>    
      <StorageControllers>
        <StorageController name="IDE" type="PIIX4" PortCount="2">
          <AttachedDevice type="HardDisk" port="0" device="0">
            <Image uuid="{b1ccf165-2dbd-4d34-9f76-8026b13fc607}"/>
          </AttachedDevice>
        </StorageController>
      </StorageControllers>
    </Snapshot>
    <StorageControllers>
      <StorageController name="IDE" type="PIIX4" PortCount="2">
        <AttachedDevice type="HardDisk" port="0" device="0">
          <Image uuid="{53ca51ad-c6f2-4d74-b677-d8140883d8bc}"/>
        </AttachedDevice>
      </StorageController>
    </StorageControllers>
  </Machine>
</VirtualBox>
You Might be right, I might be confusing the snapshot UUID and the Hard drive UUIDs. But notice there is only one snapshot listed in the distccd-server.xml file, when there are actually two snapshots.

In anycase, the VM is Inaccessible and I need to figure out how to fix it or create a new VM that utilizes the three .vdi files I've got on my system.
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by MarkCranness »

DaveHCYJ wrote:But notice there is only one snapshot listed in the distccd-server.xml file, when there are actually two snapshots.
Yes, I see that.

Here's what the snapshots should look like according to VirtualBox.XML:
  • Stable Start - b1ccf165... - distccd-server.vdi - VDI/Normal
  • (missing snapshot) - {53ca51ad-c6f2-4d74-b677-d8140883d8bc}.vdi - VDI/Differencing
  • Current State - {45b83b64-6a04-4771-8d37-72e3ec2518e5}.vdi - VDI/Differencing
Here's what the snapshots look like according to distccd-server.xml:
  • Stable Start - b1ccf165... - distccd-server.vdi - VDI/Normal
  • Current State - {53ca51ad-c6f2-4d74-b677-d8140883d8bc}.vdi - VDI/Differencing
DaveHCYJ wrote:In anycase, the VM is Inaccessible and I need to figure out how to fix it or create a new VM that utilizes the three .vdi files I've got on my system.
In theory we could tweak distccd-server.xml to add the missing snapshot, but that's too scarey.
I suggest creating a flattened clone of the Current State and mounting it to another (new) VM to see that it is as you expect (perhaps using a Linux Live CD, or even just go the whole hog and create a new distccd-server with the cloned disk).

Code: Select all

VBoxManage clonehd 45b83b64-6a04-4771-8d37-72e3ec2518e5 distccd-server2.vdi
Attach that and see if it is what you need.
DaveHCYJ
Posts: 7
Joined: 22. Oct 2009, 00:22
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Gentoo, XP, LinuxMint

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by DaveHCYJ »

That worked. Thanks so much!

I didn't know you could clone from a snapshot. It was certainly easier than fixing the xml file.
sunny
Posts: 9
Joined: 22. Oct 2008, 21:31

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by sunny »

I also cloned my latest snapshot: I'm still wondering why the .vdi file is so big. The file size of my latest snapshot is 2.9 GB, but after cloning it, it has 21.5 gb (the file size of the my .vdi (from the VDI directory).
Is there a way to just clone the latest snapshot to reduce the size of the vdi?
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by MarkCranness »

Read here for how VDIs, snapshots and differencing hard disk VDIs work: Tutorial: All about VDIs.

When you clone the differencing disk attached to a snapshot, the result is a flattened VDI that contains the entire hard disk contents as at was at the snapshot.
If you want to free up space, you can Remove (use Virtual Media Manager) the existing base VDI (21.5GB) and differencing disk (2.9GB), and then attach the new clone you made in its place (saving 2.9GB).

To reduce the size of the VDI even more,
Edit: Cleanup / Delete temp files on the guest, then defragment the guest disk, /edit then either:
  • VBoxManage clonehd the Current State (or snapshot if that's really what you want), as you have already done,
    OR
  • Copy the Current State into your base VDI by using the 'Discard Snapshot' button on all of the snapshots in turn, until there are none left (while there are any snapshots left, the base VDI does not contain all the Current State changes).
    (DO NOT use the 'Discard Current Snapshot and State' button, and do not be worried when VirtualBox says that it is: 'Discarding hard disk (Your Main Disk)'. It is not actually discarding your disk, it is actually Updating it...)
THEN use mpack's CloneVDI tool, with the 'Compact drive while copying' checkbox set on, to either re-clone and compress the clonehd made above, or clone and compress the base VDI after snapshots are discarded.
If your guest OS is Linux, then read this post: Linux needs changes to grub tables if the drive UUID changes.
Last edited by MarkCranness on 5. Nov 2009, 03:39, edited 1 time in total.
sunny
Posts: 9
Joined: 22. Oct 2008, 21:31

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by sunny »

thanks!

I have a problem, I think its a bug.
I want to use the clonehd command and put the outputfile (.vdi) on an external hdd (via usb).
I did this:

Code: Select all

VBoxManage clonehd xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /media/ExternalHDD/WinXP.vdi
Output:

Code: Select all

VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

0%...FAILED
Error: failed to clone hard disk. Error message: Could not create the clone hard disk '/media/ExternalHDD/WinXP.vdi'.
VDI: cannot create image '/media/ExternalHDD/WinXP.vdi' (VERR_ACCESS_DENIED)
I thought, oh yea I forgot to do it with sudo! Then I tried it with sudo (even with sudo bash..)

Code: Select all

sudo VBoxManage clonehd xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /media/ExternalHDD/WinXP.vdi
Now I got this:

Code: Select all

VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Could not find file for the hard disk '/home/me/.VirtualBox/Machines/WinXP/Snapshots/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' (VERR_FILE_NOT_FOUND)
Details: code VBOX_E_FILE_ERROR (0x80bb0004), component HardDisk, interface IHardDisk, callee nsISupports
Context: "OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, false, Bstr(""), false, Bstr(""), srcDisk.asOutParam())" at line 624 of file VBoxManageDisk.cpp
I have no space left on my Computer, thats why I wanted to clone it to the external HDD. Can somebody please tell me how to do that? It's funny that the copy-process is initialised only when I dont use sudo (even when I says 0%...FAILED). When I use sudo, it's not copying at all! The command

Code: Select all

VBoxManage clonehd xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx WinXP.vdi
works fine.
Can anybody please tell me how to make the clone on my ext. HDD?
Thanks!
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by MarkCranness »

I think maybe what's happening with the sudo, is that also changes where it looks for the VirtualBox config files or VDI files (now expected in '/home/root/...')?
My Linux-foo is non-existant, but perhaps something like:

Code: Select all

me@blah$ sudo bash
root@blah$ set VBOX_USER_HOME=/home/me/.VirtualBox
root@blah$ VBoxManage clonehd xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /media/ExternalHDD/WinXP.vdi
(replace 'me' with your home folder).
Note: I added an optional Cleanup/Defrag step before the clonehd or CloneVDI (if your disk space can handle it) to make the final VDI smaller.
sunny
Posts: 9
Joined: 22. Oct 2008, 21:31

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by sunny »

I tried it:

Code: Select all

me@blah:~/.VirtualBox/Machines/WinXP/Snapshots$ sudo bash
root@blah:~/.VirtualBox/Machines/WinXP/Snapshots# set VBOX_USER_HOME=/home/my_username/.VirtualBox
root@blah:~/.VirtualBox/Machines/WinXP/Snapshots# VBoxManage clonehd xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /media/ExternalHDD/WinXP.vdi
I got this:

Code: Select all

VirtualBox Command Line Management Interface Version 3.0.10
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Could not find file for the hard disk '/home/my_username/.VirtualBox/Machines/WinXP/Snapshots/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' (VERR_FILE_NOT_FOUND)
Details: code VBOX_E_FILE_ERROR (0x80bb0004), component HardDisk, interface IHardDisk, callee nsISupports
Context: "OpenHardDisk(Bstr(szFilenameAbs), AccessMode_ReadWrite, false, Bstr(""), false, Bstr(""), srcDisk.asOutParam())" at line 624 of file VBoxManageDisk.cpp
Same error message
MarkCranness
Volunteer
Posts: 875
Joined: 10. Oct 2009, 06:27
Primary OS: MS Windows 7
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows Server 2008 R2; Ubuntu 11.04; Windows 2000 Server; Windows XP

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by MarkCranness »

In VirtualBox.xml, are the <MediaRegistry...<HardDisks...<HardDisk...location="" tags absolute folders or relative?
If relative, try also setting HOME to /home/my_username

Code: Select all

me@blah:~/.VirtualBox/Machines/WinXP/Snapshots$ sudo bash
root@blah:~/.VirtualBox/Machines/WinXP/Snapshots# set VBOX_USER_HOME=/home/my_username/.VirtualBox
root@blah:~/.VirtualBox/Machines/WinXP/Snapshots# set HOME=/home/my_username
root@blah:~/.VirtualBox/Machines/WinXP/Snapshots# VBoxManage clonehd xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx /media/ExternalHDD/WinXP.vdi
Sorry, my Linux-foo is all used up!
sunny
Posts: 9
Joined: 22. Oct 2008, 21:31

Re: VM Inaccessible: has 1 differencing child hard disks.

Post by sunny »

I still get the same error :( Every entry is relative to ".Virtualbox":

Code: Select all

<MachineEntry uuid="{zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz}" src="Machines/WinXP/WinXP.xml"/>

<HardDisk uuid="{yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy}" location="VDI/WinXP.vdi" format="VDI" type="Normal">
<HardDisk uuid="{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}" location="Machines/WinXP/Snapshots/{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}.vdi" format="VDI"/>
EDIT:
I did it!
I just changed the permission of the folder where I wanted to create the WinXP.vdi with "chmod 777 FOLDERNAME".
After that I could logically create the WinXP.vdi file without root rights (sudo)! Thanks anyway!

But I have another problem now:
I created a new VM on virtualbox with the WinXP.vdi attacked to it (from the external HDD). When I start WinXP, I'm getting a blue screen of death STOP: 0x0000007b :(

EDIT:
Solved, thanks to SilverWave! Just change PIIX4 to PIIX3 like it's described here:
http://forums.virtualbox.org/viewtopic. ... 0x0000007b
Post Reply