VirtualBox in limbo after deleting a VDI while in saved state

-1

TL;DR: I have a VM in 'saved' status, with 2 vdis, one of which has been deleted. Altough it was not mounted, now I can't start the VM, power off, nor remove the .vdi from the Storage tree. This setup is now in limbo. How can I fix the VM?


I used to have 2 VMs. Ubuntu 16.04 and 14.04. (The Host is Windows 8.1 64bits). I used to have the .vdi of each VM added as storage in the other VM, in order to easily mount & zerofree & compact (to release disk space back the Windows host). After I no longer needed the 14.04 VM, I deleted it, and removed the files. When I did this, 16.04 VM was with 'Saved' status. So now when I try to start it I get:

Could not open the medium 'C:\Users\user\VirtualBox VMs\Ubuntu 14.04.3\Ubuntu 14.04.3.vdi'. VD: error VERR_FILE_NOT_FOUND opening image file 'C:\Users\user\VirtualBox VMs\Ubuntu 14.04.3\Ubuntu 14.04.3.vdi' (VERR_FILE_NOT_FOUND). Result Code: E_FAIL (0x80004005) Component: MediumWrap Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}

If I go to the VM settings --> Storage, I cannot remove it because the status of the VM is 'saved' (cannot edit settings while on saved).

Going to File --> Virtual Media Manager --> selecting Ubuntu 14.04.3.vdi --> clicking release:

"Failed to detach hard disk Ubuntu 14.04.3.vdi from the slot SATA Port 1 of the machine Ubuntu 16.04" The machine is not mutable or running (state is Saved). Result Code: VBOX_E_INVALID_VM_STATE (0x80BB0002) Component: SessionMachine Interface: IMachine {b2547866-a0a1-4391-8b86-6952d82efaa0}

I tried to 'fake the vdi' by copying other valid vdi to the same path, but I got this error:

UUID {bd7ef404-0a0a-4fc6-9575-c79a0a07f81b} of the medium 'C:\Users\user\VirtualBox VMs\Ubuntu 14.04.3\Ubuntu 14.04.3.vdi' does not match the value {2dccffec-7ccf-4c05-b0e2-01761b3430ac} stored in the media registry ('C:\Users\user.VirtualBox\VirtualBox.xml'). Result Code: E_FAIL (0x80004005) Component: MediumWrap Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}

I also tried to edit Ubuntu 16.04.vbox file and change the uuid value (it appears in the file two times). Re-start Virtual Box. It looked like it was working, but just before finishing loading, I got an error :

ahci#0: The source VM is missing a device on port 1. Please make sure the source and target VMs have compatible storage configurations [ver=8 pass=final] (VERR_SSM_LOAD_CONFIG_MISMATCH). Result Code: E_FAIL (0x80004005) Component: ConsoleWrap Interface: IConsole {872da645-4a9b-1727-bee2-5585105b9eed}

I want to use the VM again. If it is possible, without discarding the Saved State.

virtualbox
asked on Super User Dec 29, 2016 by user183001 • edited Dec 31, 2016 by user183001

2 Answers

2

In VirtualBox, you can always discard a saved state.

From the GUI, rightclick the VM and choose discard saved state. The shortcut key on windows is control+J.

Once the state is discarded, you should be able to remove the reference to the VDI from the Virtual Media Manager.

answered on Super User Dec 29, 2016 by LPChip • edited Dec 29, 2016 by Giacomo1968
-1
  1. Close VirtualBox
  2. Edit Ubuntu 16.04.vbox and Ubuntu 16.04.vbox-prev and removing

     <AttachedDevice type="HardDisk" hotpluggable="true" port="1"
     device="0">   <Image uuid="{bd7ef404-0a0a-4fc6-9575-c79a0a07f81b}"/>
     </AttachedDevice>
     

  3. Start VirtualBox and start the VM.

Yes, there is a big warning that says "DO NOT EDIT THIS FILE". But it worked =P

answered on Super User Dec 29, 2016 by user183001 • edited Dec 31, 2016 by user183001

User contributions licensed under CC BY-SA 3.0