Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Discussions related to using VirtualBox on Linux hosts.
Post Reply
SteveLD
Posts: 5
Joined: 2. Nov 2022, 00:04

Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by SteveLD »

I had a PC go bad on me, but I have Virtualbox 5.2.44 VM on another disk. Unfortunately, it didn't get closed properly so when I try to add it to my VMs using 5.2.44, it gives me this error:

Medium 'F:\VirtualBox VMs\Ubuntu18.04LTS\Ubuntu18.04LTS.vdi' cannot be closed because it is still attached to 1 virtual machines.


Result Code:
VBOX_E_OBJECT_IN_USE (0x80BB000C)
Component:
MediumWrap
Interface:
IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
Callee:
IVirtualBox {9570b9d5-f1a1-448a-10c5-e12f5285adad}
Callee RC:
VBOX_E_OBJECT_NOT_FOUND (0x80BB0001)

Is there a way to make it just load it up from a power down state or a "reset" state? I'd like to recover the VM.
I've seen others talk about this here but I haven't found the correct case where all I really want to do is load it with what it had. Is that possible? Yes, I know I might lose some changes in the image.
P.S. This also happens with 6.2 version of VB.

Thanks,
Steve
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by mpack »

It sounds like you are trying to mess with a VDI file instead of moving the VDI properly, and the VDI is embroiled in a snapshot chain or saved states.

Don't mess with VDI files, always treat the VM folder as a single unit. See Howto: Move a VM. You can also clone VMs to create independent copies.

I tend to avoid snapshots and saved states since it adds extra failure modes with no real benefit.
SteveLD
Posts: 5
Joined: 2. Nov 2022, 00:04

Re: Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by SteveLD »

I can't remember if it was last started with a snapshot. Does that matter? I just know it was up when the windows host was shutdown.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by mpack »

If you move the VM properly then it doesn't matter if it uses snapshots. That's part of what makes the right procedure the right procedure. See the FAQ I linked previously.
SteveLD
Posts: 5
Joined: 2. Nov 2022, 00:04

Re: Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by SteveLD »

Maybe I need to provide more information.
The VM in question is on a separate USB drive. The VM was running when the original host was shutdown. The old host is not accessible (not bootable).
I have installed the same version of Virtualbox on my new PC and have tried to add the VM from the drive to the Virtualbox manager. It only looks for .vdi files in this mode. This is when I get the above described error.
I have looked at the .vbox file and I don't see anything about "attach" in there, except for additional drives (which are still attached but may been in different locations). Could this cause the issue?
I just want to boot it up like it had been reset. Is this possible?

Thanks,
Steve
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by mpack »

SteveLD wrote:tried to add the VM from the drive to the Virtualbox manager. It only looks for .vdi files in this mode.
VirtualBox does not have a "add the VM" feature which only looks for VDIs. The VM is the ".vbox" file that describes the PC's hardware, a PC most certainly does not consist of any single piece of hardware such as a disk.

Perhaps a screenshot would help, but it sounds like you are trying to add a hard drive to something, not add a machine (VM) to VirtualBox.

If you have read the FAQ then you should understand that all you need to do to register a VM is to copy the VM folder whereever you want its permanent home to be, and the double-click the .vbox file. At least the latter works on Windows hosts, I don't know about Linux hosts. Alternatively, on all hosts you can register the VM using the "Add machine" menu item - which may move around in various versions.
SteveLD
Posts: 5
Joined: 2. Nov 2022, 00:04

Re: Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by SteveLD »

Yes, you are correct. I was expecting it to be a .vbox it was looking for, but somehow it came up .vdi before. Not doing that now however.
But I am still getting the same result, regardless when I try to open it.
Attachments
VBResultsmall.jpg
VBResultsmall.jpg (58.66 KiB) Viewed 1270 times
SteveLD
Posts: 5
Joined: 2. Nov 2022, 00:04

Re: Trying to add an existing 5.2.44 VB Linux, on a new host, when the old one didn't get shut down.

Post by SteveLD »

For your information, I did try to copy it to a new folder using the OS as your text suggests, and i get the same issue when I try to open it.
I can't copy it using the manager because I can't open it in VB.

Steve
Post Reply