Cannot remove Virtual Media

Discussions related to using VirtualBox on Linux hosts.
inshion
Posts: 9
Joined: 13. Apr 2012, 09:29

Cannot remove Virtual Media

Post by inshion »

QQ截图20151225212252.jpg
QQ截图20151225212252.jpg (102.01 KiB) Viewed 7195 times
Failed to close the disk image file /data/inshion/VMX/XP/XP.vdi.

Medium '/data/inshion/VMX/XP/XP.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}


But I have already deleted all files about the XP machine...

Version 5.0.6 r103037
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Cannot remove Virtual Media

Post by mpack »

You can see in the background that the VM is still running.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Cannot remove Virtual Media

Post by loukingjr »

My eyes aren't what they used to be but I can see that as well.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Cannot remove Virtual Media

Post by socratis »

Just to play devil's advocate, the VM running on the background is called "CentOS...something" and the virtual HD is in "/data/inshion/VMX/XP/XP.vdi". Somebody had to really try to attach that XP.vdi in the CentOS VM.

@inshion: Please post the output of the command "VBoxManage showmediuminfo /data/inshion/VMX/XP/XP.vdi".
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Cannot remove Virtual Media

Post by loukingjr »

True. But the Media manager sure won't delete it while it's attached to a running guest.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
inshion
Posts: 9
Joined: 13. Apr 2012, 09:29

Re: Cannot remove Virtual Media

Post by inshion »

socratis wrote:Just to play devil's advocate, the VM running on the background is called "CentOS...something" and the virtual HD is in "/data/inshion/VMX/XP/XP.vdi". Somebody had to really try to attach that XP.vdi in the CentOS VM.

@inshion: Please post the output of the command "VBoxManage showmediuminfo /data/inshion/VMX/XP/XP.vdi".

$ VBoxManage showmediuminfo /data/inshion/VMX/XP/XP.vdi
UUID: dc4a0562-f3f8-47f4-992d-353ed5b8aecd
Parent UUID: base
State: inaccessible
Access Error: Could not open the medium '/data/inshion/VMX/XP/XP.vdi'.
VD: error VERR_FILE_NOT_FOUND opening image file '/data/inshion/VMX/XP/XP.vdi' (VERR_FILE_NOT_FOUND)
Type: normal (base)
Location: /data/inshion/VMX/XP/XP.vdi
Storage format: VDI
Format variant: dynamic default
Capacity: 524288 MBytes
Size on disk: 1870 MBytes
Encryption: disabled
VBoxManage: error: Could not find a registered machine with UUID {4bfe4757-7954-47c1-9550-d09baba88513}
VBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "FindMachine(machineIds, pMachine.asOutParam())" at line 1282 of file VBoxManageDisk.cpp
Child UUIDs:

I have deleted /data/inshion/VMX/XP yet.
and the background VM of "CentOS..." never used resources about that "XP" .
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Cannot remove Virtual Media

Post by mpack »

Is this so hard? The VM running in the background is highlighted, so this is clearly the right VM.

The path to the VDI is non-standard, so another VM's VDI has been mounted in this VM as a second drive.

The user is trying to unload the secondary VDI while the VM is running, that isn't going to happen: HDs are not removable stored in VBox (at least not IDE: not sure about SATA).

I see no mystery here: shut down (not suspend) the VM.
inshion
Posts: 9
Joined: 13. Apr 2012, 09:29

Re: Cannot remove Virtual Media

Post by inshion »

mpack wrote:Is this so hard? The VM running in the background is highlighted, so this is clearly the right VM.

The path to the VDI is non-standard, so another VM's VDI has been mounted in this VM as a second drive.

The user is trying to unload the secondary VDI while the VM is running, that isn't going to happen: HDs are not removable stored in VBox (at least not IDE: not sure about SATA).

I see no mystery here: shut down (not suspend) the VM.
No, it is not like that.

I shutdown all VMs, and the error is still there. And I use 'ps' to see the processes —— no background VM:
V1.jpg
V1.jpg (65.49 KiB) Viewed 7130 times
V2.jpg
V2.jpg (24.38 KiB) Viewed 7130 times
$ ps aux | grep Vir
inshion 8502 0.0 0.0 103308 876 pts/2 S+ 09:28 0:00 grep Vir
inshion 16349 0.4 0.1 893008 40576 ? Sl Dec25 9:42 /usr/lib/virtualbox/VirtualBox
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Cannot remove Virtual Media

Post by socratis »

Have you closed all VirtualBox processes? If not, shut down everything including the VirtualBox Manager and check not only for "vir" but for "vbox" processes as well. Wait about 30 sec and relaunch VirtualBox Manager. See if that helps...

If not, zip and attach the "VirtualBox.xml" file located either in "$HOME/.config/VirtualBox" or in "$HOME/.VirtualBox"
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Cannot remove Virtual Media

Post by loukingjr »

I find this whole thread very confusing. The only way I am aware of that a .vdi shows up indented in the VirtualBox Media Manager as it does in the OP is because it's a snapshot. How a Snapshot of a CentOS guest becomes XP.vdi is beyond me.
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Cannot remove Virtual Media

Post by socratis »

It is not indented. He has 5 snapshots for the CentOS, but the XP used to be a standalone, no-snapshot VM.

@inshion: Can you tell us a little bit more on if you had an XP client and how EXACTLY did you remove it?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Cannot remove Virtual Media

Post by loukingjr »

socratis wrote:It is not indented. He has 5 snapshots for the CentOS, but the XP used to be a standalone, no-snapshot VM.
Look again in the original screen shot in the media manager window. :roll:
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
loukingjr
Volunteer
Posts: 8851
Joined: 30. Apr 2009, 09:45
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: just about all that run

Re: Cannot remove Virtual Media

Post by loukingjr »

It's in the second screen shot as well. I'm not even a little disappointed. :lol:
OSX, Linux and Windows Hosts & Guests
There are three groups of people. Those that can count and those that can't.
inshion
Posts: 9
Joined: 13. Apr 2012, 09:29

Re: Cannot remove Virtual Media

Post by inshion »

socratis wrote:It is not indented. He has 5 snapshots for the CentOS, but the XP used to be a standalone, no-snapshot VM.

@inshion: Can you tell us a little bit more on if you had an XP client and how EXACTLY did you remove it?
The whole story is like this:

1. There were two VMs , one was 'XP' and the other was 'CentOS6'. They had no relation with each other. Each was absolute.
2. 'XP' had some snapshots. I deleted one in the Snapshots screen ( while 'XP' was running). It took about 20 minutes (or longer?..), and then an error occured ( I forgot the error text). Then the 'XP' VM could not startup.
3. I removed the 'XP' VM by 'Remove Only' in the main screen of Virtual Box.
4. I found 'XP.vdi' in the Virtual Media Manager with a yellow sign. Then I tried to remove it, but error occured('Failed to close the disk image file /data/inshion/VMX/XP/XP.vdi.').
5. I used 'rm -rf' to delete all the files of 'XP' in the file system.
6. I tried to removed "XP.vdi" in the Virtual Media Manager again. Then, you can see this Post....
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Cannot remove Virtual Media

Post by socratis »

You might have missed my previous post:
socratis wrote:Have you closed all VirtualBox processes? If not, shut down everything including the VirtualBox Manager and check not only for "vir" but for "vbox" processes as well. Wait about 30 sec and relaunch VirtualBox Manager. See if that helps...

If not, zip and attach the "VirtualBox.xml" file located either in "$HOME/.config/VirtualBox" or in "$HOME/.VirtualBox"
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply