Page 1 of 1

error opening image file

Posted: 22. Nov 2009, 07:16
by ryanGT
I spent a good chunk of today installing Windows XP as my guest OS and I fear I have screwed it up really bad. Everything was working well, I had installed all the XP service packs and some useful software. I had made two snapshots along the way and was surprised at how much disk space they took up (5 gigs or so). So, I tried to delete the first one. I guess this copies a significant amount of stuff from ~/.VirtualBox to the virtual hard drive of the guest OS. I had limited the guest's virtual hard drive to 10 gigs. Apparently that wasn't enough and the deletion of the snapshot failed. But now I can't open the next snap shot either. I am getting this message:

Failed to start the virtual machine XP.
Medium '/home/ryan/.VirtualBox/Machines/XP/Snapshots/{b60e1b24-608f-4403-9709-a3517b5019eb}.vdi' is not accessible. Could not open the hard disk '/home/ryan/.VirtualBox/Machines/XP/Snapshots/{b60e1b24-608f-4403-9709-a3517b5019eb}.vdi'.
VD: error opening image file '/home/ryan/.VirtualBox/Machines/XP/Snapshots/{b60e1b24-608f-4403-9709-a3517b5019eb}.vdi' (VERR_FILE_NOT_FOUND).

Can my guest OS be fixed so I can boot into it again, or do I need to start it from scratch?

Thanks,

Ryan

Re: error opening image file

Posted: 22. Nov 2009, 09:59
by MarkCranness
ryanGT wrote:Apparently that wasn't enough and the deletion of the snapshot failed.
How much free space on the host disk that contains the VDI files? Having a smaller (as configured in VirtualBox) virtual hard drive should not be a problem, but running out of host drive space while Deleting a snapshot will. (Deleting/Discarding? - which version are you using?)

Likely you need to start again, but please attach your /home/ryan/.VirtualBox/VirtualBox.xml and /home/ryan/.VirtualBox/Machines/XP/XP.xml files and there may be some chance we can suggest something (I'm thinking maybe the VDI files and snapshots are OK, but the xml files are out of sync).
(See 'Upload attachment' tab in the forum when you make a post)

Re: error opening image file

Posted: 22. Nov 2009, 15:43
by ryanGT
I am pretty sure I didn't run out of physical hard drive space on the host. It is carved up into many partitions and two physical drives, but the partition containing the home directories has 18 gigs available and the one where I put the virtual hard drive has 15 gigs available.

The xml files are attached. I would appreciate your guidance.

Thanks,

Ryan

Re: error opening image file

Posted: 22. Nov 2009, 15:48
by ryanGT
This seems relevant:

/home/ryan/.VirtualBox/Machines/XP/Snapshots
ryan@am2|07:44 AM|Snapshots$ ls
{5acba0d3-a321-456d-8537-b4960e421d8c}.vdi
{730741dd-0d05-4447-9f37-8c54ef7fe101}.vdi
{75545385-7842-4e38-b8c6-8b8339da3b24}.sav
{df32a5db-3bdb-4da9-98f1-ad9680a67aa3}.sav


FYI, after the problem occurred, I tried reverting to the latest snapshot I made and it acted like it was working: it was able to load the guest OS and showed me my windows desktop, but the desktop was completely unresponsive. I tried making another snapshot at that point, but it doesn't seem to have worked (when I start that one, the desktop is just a black screen the whole time).

Thanks again,

Ryan

Re: error opening image file

Posted: 23. Nov 2009, 03:04
by MarkCranness
Not much good news I'm afraid. The xml files say your snapshots and VDI files look like so:

Code: Select all

XP.vdi = b16ac225-11c1-4dd9-b7bc-ce88085b526b (SP3 = 75545385-7842-4e38-b8c6-8b8339da3b24)
|
+-{730741dd-0d05-4447-9f37-8c54ef7fe101}.vdi (SP3_take2 = df32a5db-3bdb-4da9-98f1-ad9680a67aa3)
| |
| +-{5acba0d3-a321-456d-8537-b4960e421d8c}.vdi (Current State)
|
+-{b60e1b24-608f-4403-9709-a3517b5019eb}.vdi (? file and snapshot missing)
(The first part of each line/node is the VDI filename, and the part in brackets is the snapshot they are attached to.)

I presume your '...after the problem occurred, I tried reverting to the latest snapshot I made...' snapshot was 'SP3_take2'?

There are three disk states we can use:
1 The Current State, which doesn't work too well, as you say.
2 SP3_take2, but if you recently reverted to that snapshot it will be similar to the current state anyway.
3 The base XP.vdi, which may or may not have parts of your original snapshot (the one you deleted) updated into it.

So the plan has to be to see what the base XP.VDI looks like.
The trick to doing that is to get a VM with that VDI attached without changing the VM so much that it needs reactivation (assuming re-activation might be an issue? Have you activated yet?)

If the Current State and snapshot SP3_take2 can be forever abandoned, these dirty instructions will leave you with a VM pointing directly to XP.vdi:
  • Take a backup, if you feel you need to.
  • Close all VirtualBox windows and VMs.
  • Edit VirtualBox.xml, deleting the last 3 <HardDisk...> entries, so it looks like so:

    Code: Select all

    <HardDisks>
        <HardDisk uuid="{b16ac225-11c1-4dd9-b7bc-ce88085b526b}" location="/mnt/sda3/VirtualBox/XP.vdi" format="VDI" type="Normal" />
    </HardDisks>
    (Note: /> on end)
  • Edit XP.xml, deleting all of the nested snapshots (everything between and including "<Snapshot .." to the very very last "</Snapshot>" and including the <Hardware> and <Storage Controllers> inside the snapshots).
    You should be left with one <Hardware> and one <Storage Controllers> at the end which belong to the machine/Current State.
  • edit XP.xml, change the <Storage Controllers> at the end to look like so:

    Code: Select all

    <StorageControllers>
      <StorageController name="IDE" type="PIIX4" PortCount="2" /> 
    </StorageControllers>
  • edit XP.xml, at the very top, delete the " currentSnapshot="{df32a5db-3bdb-4da9-98f1-ad9680a67aa3}" attribute from the <Machine...> section.
  • Launch the VirtualBox GUI, select the VM, Settings>Hard Disks>Attachments>(Plus tool)>Select 'XP.vdi'>OK
  • Perhaps take a snapshot (not much point) and boot the VM. See what you can see...
  • Good luck!
ryanGT wrote:I am pretty sure I didn't run out of physical hard drive space on the host. It is carved up into many partitions and two physical drives, but the partition containing the home directories has 18 gigs available and the one where I put the virtual hard drive has 15 gigs available.
The merging that goes on when you discard a snapshot may take more hard-disk space than you imagine. For safety, I would have as much free space as the total size of any existing VDI files, base+snapshots.

Re: error opening image file

Posted: 23. Nov 2009, 15:24
by ryanGT
So, I think I editted the xml files correctly (the second time), but it didn't work. The first time the VirtualBox gui gave me errors when it tried to read XP.xml. The files for the final version that I got to work are attached. When I booted the XP guest, I got a black screen with a message about disk read error.

So, I am trying to start over. I didn't delete anything though, so if you have any more things for me to try, I am open. I don't know if I will have reactivation issues or not. We will see.

Ryan