[Solved] Cannot attach medium ... medium is already associated with the current state of machine

This is for discussing general topics about how to use VirtualBox.
Mary Ann
Posts: 5
Joined: 20. Feb 2019, 18:52

[Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by Mary Ann »

I have read many conversations regarding this issue; each solution seems to be unique to the user.

I have not opened my VM in months and do not know what state it was in or how it closed when last accessed.

I expected an update and so before trying to access my VM, I updated VirtualBox from 5.2.22 to 5.2.26. Installed guest additions when prompted.
Opened VB and received this error:
Cannot attach medium 'C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso' {17aac5ed-ed98-40d2-8174-d1fc942efc2f}: medium is already associated with the current state of machine uuid {1877280d-8c31-49a7-8087-0a2e520f8947}!.
Result Code: VBOX_E_OBJECT_IN_USE (0x80BB000C)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
The VM is "inaccessible." When I right-click its icon my only active options are Remove, Refresh, Resort. There are no saved states. Under Virtual Media Manager, I can see that there is a Win 10 ISO attached, and the VBoxGuestAdditions ISO attached. If I remove them and restart the Vbox, they are still there.

Based on a similar post, I tried reinstalling the previous version of VB, but have received the same error. I haven't reinstalled v5.2.26 yet.

Is there any recourse? Do I have to trash this VM and start over?

Thank you!
Last edited by socratis on 21. Feb 2019, 23:26, edited 1 time in total.
Reason: Marked as [Solved].
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by mpack »

I believe you need to right click the VM and "Discard the current state". It is no longer valid.

Basically you shouldn't update VirtualBox while you have VMs in suspended states. If you don't think you can remember to shut them down then I suggest you start shutting them down after every use.

Btw, the error message you describe is not consistent with your description of the problem. If the GAs were updated last time you ran the VM then it shouldn't still have the old GAs CD mounted... unless you made the really obscure error of adding a second virtual CD drive (not media) to the VM, and it has the old GAs CD. I think it's more likely that what you actually updated was the extension pack on the host, not the guest additions.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

Mary Ann wrote:The VM is "inaccessible."
What does that mean? When you select the Details pane, the only thing you see is the error? I think that's what you mean, but please verify...
Mary Ann wrote:There are no saved states.
Then you have a snapshot.

I believe that you took a snapshot while you had the VBoxGuestAdditions.iso still mounted. Then you upgraded VirtualBox, which forces a new UUID for the above mentioned ISO. Since you can't have two of them, you are facing this problem.

Right-click on the VM, "Show in Explorer". ZIP the chosen .vbox file and attach it to your response.

Image
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.
Mary Ann
Posts: 5
Joined: 20. Feb 2019, 18:52

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by Mary Ann »

I anticipated that you would direct me to right click the VM and discard the current state. This is why I indicated up front, "When I right-click its icon my only active options are Remove, Refresh, Resort." and "There are no saved states."

You may be correct that I updated the Extension Pack not the Guest Additions. I cannot reproduce the experience (I have reinstalled V5.2.26) so cannot be sure.
Mary Ann
Posts: 5
Joined: 20. Feb 2019, 18:52

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by Mary Ann »

When viewing the Virtualbox Manager, the VM icon reads "inaccessible." You cannot left-click on the VM icon. Right-click yields only the options mentioned so I cannot zip the .vbox file. Only the error message displays in the right-hand window.

When I click on the Machine Tools, Snapshots is listed, but grayed out. I interpret this to mean that there are no snapshots.
Attachments
Capture.JPG
Capture.JPG (59.06 KiB) Viewed 26524 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

Try to go manually then to "C:\Users\<you>\VirtualBox VMs\APW\". In there you'll find the "APW.vbox" file. That is assuming you kept all the defaults when you installed VirualBox and the VM.
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.
Mary Ann
Posts: 5
Joined: 20. Feb 2019, 18:52

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by Mary Ann »

Thank you for your help. I'm grateful.
Attachments
APW.zip
(2.32 KiB) Downloaded 817 times
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by mpack »

You have two CD/DVD drives attached to the VM. Both of them have the Guest Additions CD mounted, which is what has gotten things confused.

It's a common enough mistake: people go to the Storage settings and instead of adding media to an existing CD/DVD drive, they add a new drive. You need to change media for a selected drive using the media panel on the right of the Storage dialog, not the drives and controllers panel on the left.

Your fixed .vbox file is below.
Attachments
APW-repaired.zip
(2.14 KiB) Downloaded 945 times
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

mpack wrote:people go to the Storage settings and instead of adding media to an existing CD/DVD drive, they add a new drive.
Actually, as you noticed, it was worse, way worse than that!
<Image uuid="{17aac5ed-ed98-40d2-8174-d1fc942efc2f}" location="C:/Program Files/Oracle/VirtualBox/VBoxGuestAdditions.iso"/>
...
<StorageController name="USB" type="USB" PortCount="8" useHostIOCache="true" Bootable="true">
  <AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="0">
	<Image uuid="{17aac5ed-ed98-40d2-8174-d1fc942efc2f}"/>
  </AttachedDevice>
</StorageController>
The GAs ISO was mounted on a new USB controller! That's a first... :shock: :)
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.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by mpack »

Yes, I hadn't seen a DVD drive attached to the USB controller either, but I guess VirtualBox must allow it!
Mary Ann
Posts: 5
Joined: 20. Feb 2019, 18:52

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by Mary Ann »

@mpack and @socratis, you answer this very question so often and for so many, I'm just glad that I could give you a little variety and entertainment in your generous contribution to the VB world. Once again, I'm unable to do something in the conventional way, not even make a mistake :roll:

Thank you for straightening me out.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: Another Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

Mary Ann wrote:Once again, I'm unable to do something in the conventional way, not even make a mistake :roll:
That's a keeper! :lol:
Mary Ann wrote:Thank you for straightening me out.
So, you were able to get it going with the new .vbox that mpack gave you? I'll go ahead and mark this as [Solved] because I think you did.

And remember to always eject your GAs once you're done with the installation...
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.
PuppinoCbr
Posts: 9
Joined: 3. Sep 2019, 17:02

Re: [Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by PuppinoCbr »

Please, can you help me with this file? I've the same problem "inaccessible"
Attachments
IE8 - Win7.zip
(6.17 KiB) Downloaded 67 times
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: [Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by scottgus1 »

Assuming you have "exactly" the same error message:
Cannot attach medium 'C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso' {17aac5ed-ed98-40d2-8174-d1fc942efc2f}: medium is already associated with the current state of machine uuid {1877280d-8c31-49a7-8087-0a2e520f8947}!.
Result Code: VBOX_E_OBJECT_IN_USE (0x80BB000C)
Click your guest's CD drive and click "Remove Disk from Virtual Drive":
optical drive ad hoc viso.png
optical drive ad hoc viso.png (27.35 KiB) Viewed 24760 times
Otherwise, open a new thread. Good on you for posting the zipped .vbox file with Upload Attachment, though.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by mpack »

Yes, exactly the same problem. Superfluous second DVD drive created, and the same media somehow mounted in both!

This VM also has multiple snapshots with the ISO mounted in the snapshots too, just to add to the fun.

I would try going to File|Virtual Media Manager, find the "VBoxGuestAdditions.iso" entry in optical disks, highlight and "Remove" it. I think that should remove it from everywhere (all VMs, all snapshots and drives).

I'd then delete the second DVD drive in that VM.
Locked