Page 1 of 1

Can't get vm to work with vhd immutable images -edited-

Posted: 24. Mar 2014, 12:05
by gbf
EDIT: I tried now to put all image files and the virtual machine in the same directory and the problems seem not to occur. So you can read all what follows if you want but probably the only relevant things probably are the errors I report. I'll be making a bug report or another thread for this more specific problem


I can't get a virtual machine to work with immutable images. As soon as I remove them it works, but with them added I always get errors.

The images I'm trying to attach are vhd images. They are located in another drive, specifically a usb external drive; this may contribute to the problems, but the errors I get from Virtualbox do not seem to have to do with the images' locations; I have no way to try to move them in the same folder of the virtual machine, since they are half a terabyte big and I don't have enough space in the drive containing the virtual machine.
Please tell me if this configuration is unsupported (if it is virtualbox should at least report more meaningful errors, anyhow).

I want to load them as immutable because they are backups I would not want to ruin, and I don't have enough space to make a clone of them.

The host is Windows XP with the most recent version of Virtualbox (4.3.8r92456).

I tried attaching the images both with the command line and with the visual interface, and both with the virtual machine stopped and it running.

The commands I used from the command line are:

Code: Select all

vboxmanage storageattach "vmname" --storagectl "SATA" --port # --medium "vhd image full path"  --type hdd --mtype immutable
In the attempts with the visual interface I first added the images in the virtual machine to have them added to the media manager, then removed them, set them as Immutable from the media manager and re-added them to the virtual machine. I tried also restarting virtualbox between each step.

Here I describe my configuration in case it can help, although it's probably not relevant:
The port numbers (in place of the # in the command above) I usually used were 5 and 6.
I usually kept attached on the same controller a CD drive (with a live linux iso loaded), a 1 GB vhd and 2 images with raw access to hard disks, these last 3 stored in the same folder of the virtual machine. These 2 raw access images might seem suspect, but I tried removing them (and restarting etc.) and the problem stayed the same. I mention them only in case you suspect they might have corrupted my configuration file, but I doubt it.
The virtual machine has no snapshots.
The virtual machine is not saved in the default path (IIRC I first created it in the default directory and then moved it by changing the paths in VirtualBox.xml file).


The error I get, as soon as I try to start the machine, is:
Failed to open a session for the virtual machine vmname.

The VM session was closed before any attempt to power it on.

Result Code: E_FAIL (0x80004005)
Component: SessionMachine
Interface: ISession {12f4dcdb-12b2-4ec1-b7cd-ddd9f6c5bf4d}

There are also several strange warnings related to the immutable images: the tooltip that comes up hovering over them in the Settings -> Storage dialog says:
<vhd image full path>
Type (Format): Immutable (VHD)
Attached to: Not Attached

This base hard disk is indirectly attached using the following differencing hard disk:
<path of the snapshots folder>\<snapshot uuid>.vhd
Type (Format): Differencing (VHD)
Attached to: <vmname>

Parent UUID {00000000-0000-0000-0000-000000000000} of the medium '<path of the snapshots folder>\<snapshot uuid>.vhd' does not match UUID <vhd image uuid> of its parent medium stored in the media registry ('C:\Documents and Settings\myname/.VirtualBox\VirtualBox.xml')
I'm not sure if the fact that the original vhd image is said to be not attached is right, but most of all is strange the all-zero UUID in the last part of the message. There <vhd image uuid> is the uuid of the original vhd image stored in the vm .vbox file (I checked).
Also strange to me is the mention to VirtualBox.xml, that does not really contain the media registry on my machine, only empty xml tags <HardDisks/>, <DVDImages/> and <FloppyImages/>, and the use of the forward slash before .VirtualBox while the rest of the path uses backslashes (I typed it as it's displayed).


In the Virtual Media Manager the original vhd images are said to be not attached (but have no warning sign), the differencing snapshot under them does have the yellow warning sign and hovering over these snapshots the tooltip reports the last part of the message I posted before, namely:
<path of the snapshots folder>\<snapshot uuid>.vhd
Type (Format): Differencing (VHD)
Attached to: <vmname>

Parent UUID {00000000-0000-0000-0000-000000000000} of the medium '<path of the snapshots folder>\<snapshot uuid>.vhd' does not match UUID <vhd image uuid> of its parent medium stored in the media registry ('C:\Documents and Settings\myname/.VirtualBox\VirtualBox.xml')


As I mentioned I also tried to attach them after having booted the machine, with the command line I cited before. Doing that I get this error from the command line:
VBoxManage.exe: error: Code E_FAIL (0x80004005) - Unspecified error (extended info not available)
VBoxManage.exe: error: Context: "AttachDevice(Bstr(pszCtl).raw(), port, device, DeviceType_HardDisk, pMedium2Mount)" at line 744 of
file VBoxManageStorageController.cpp
The images though do get listed in the virtual machine settings and in the virtual media manager, with the same warnings I reported before.
But I'm still unable to access them from within the virtual machine (I also tried "udevadm control --reload" first).


I have not posted a bug ticket yet, I prefer to hear from someone else before in case it's a known problem.

Re: Can't get vm to work with vhd immutable images -edited-

Posted: 12. Apr 2014, 23:35
by emu1
I'm seeing this as well, v4.3.4 (not the latest). What works: change the global default VM directory to where the VHD is, create the VM, add the VHD, etc. It seems like it only works when the .vbox is in the same directory, or something of the sort.