Yet Another "Cannot attach medium" error on Guest Additions iso after upgrade to 5.2.26

This is for discussing general topics about how to use VirtualBox.
Post Reply
droidalunit
Posts: 1
Joined: 27. Mar 2019, 21:46

Yet Another "Cannot attach medium" error on Guest Additions iso after upgrade to 5.2.26

Post by droidalunit »

Host: Windows 7 Pro SP1 x64
Only VM: Windows XP Pro SP3

As with Mary Ann's similar post "Cannot attach medium ... medium is already associated with the current state of machine" originally posted 20. Feb 2019, 19:03, I also have read much on this issue posted over the last several years. I have chosen to reference Mary Ann's because the circumstances are very similar to mine, namely that this problem occurred immediately following an upgrade from version 5.2.24 to 5.2.26. I got exactly the same screen Mary Ann shows the first time I booted with version 5.2.26 after the upgrade, and down grading back to 5.2.24 did not fix it. Here's the complete error message detail in my case:
Cannot attach medium 'C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso'
{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}: medium is already associated with the current state of
machine uuid {d5d2bb4d-0ed3-4c06-83d6-b95d2cf61d7d}!.

Result Code: VBOX_E_OBJECT_IN_USE (0x80BB000C)
Component: MediumWrap
Interface: IMedium {4afe423b-43e0-e9d0-82e8-ceb307940dda}
One notable difference in my case is that I have been using my VB VM every day for years. I do leave it and my host running for weeks on end, but when I do shut down and restart my host, I always power down my VM first before closing VB. I haven't done anything different than I've done for years. I created the VM with version 5.0.10 in 2015 and have upgraded this same way 16 times over the ensuing years until this failed upgrade to 5.2.26 today. I suspect there may be some issue caused by upgrading to version 5.2.26, but I can't be sure it isn't just highly coincidental.

With that said, I reviewed the the posted solution to Mary Ann's vbox file by socratis on 21. Feb 2019, 18:31, and decided to take a look at mine in the same area referencing the Guest Additions ISO uuid from my error message above, and lo and behold, this is what I found under Storage Controllers:

Code: Select all

    <StorageControllers>
      <StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
        <AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
          <Image uuid="{327cdf44-241d-4d9f-a206-5887a4b60f28}"/>
        </AttachedDevice>
        <AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="1">
          <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>
        </AttachedDevice>
        <AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="1" device="0">
          <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>
        </AttachedDevice>
      </StorageController>
    </StorageControllers>
See that the Guest Additions ISO uuid is indeed referenced twice. I simply removed the second attached device with that uuid and voila, I was able to access my VM once again.

I offer this post for any of you out there with a similar issue who are brave enough to try to fix it yourself. Many thanks to socrates and mpack in being so responsive to Mary Ann. Your help continues to be appreciated more than you know!
Last edited by socratis on 27. Mar 2019, 23:46, edited 1 time in total.
Reason: Added missing URL.
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: Yet Another "Cannot attach medium" error on Guest Additions iso after upgrade to 5.2.26

Post by socratis »

Thank you for taking the time to post your experience, and for your comments, appreciated. ;)

I do have a slight issue with the following though:
droidalunit wrote:this problem occurred immediately following an upgrade from version 5.2.24 to 5.2.26
I can't see for the life of me how an upgrade would add a second CD drive to the IDE controller and populate it with the GAs ISO. Because that's what you have:
droidalunit wrote:
<StorageControllers>
  <StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
    <AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
      <Image uuid="{327cdf44-241d-4d9f-a206-5887a4b60f28}"/>
    </AttachedDevice>
    <AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="1">
      <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>  <-- GAs ISO     ^-- Pri.Slave
    </AttachedDevice>
    <AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="1" device="0">
      <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>  <-- GAs ISO     ^-- Sec.Master
    </AttachedDevice>
  </StorageController>
</StorageControllers>
My guesstimate is that at some point you wanted to install the GAs, and instead of adding the GAs ISO to an existing "slot", you added a new slot. At some point, somehow (*that* is the missing info) both CD drives were populated by the GAs ISO. And after that VirtualBox went kaboom...

Apparently the root of the problem comes from the fact that VirtualBox cannot handle the same CD mounted in two different slots. I did a quick test where I manually added a 2nd instance of the same UUID CD in a 2nd slot. Kaboom! :o

The solution is to go from:
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="1">
  <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>
</AttachedDevice>
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="1" device="0">
  <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>
</AttachedDevice>
to either emptying the CD drive (note the closing "/" in the port1:0 definition):
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="1">
  <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>
</AttachedDevice>
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="1" device="0"/>
or to remove the whole controller, CD included, no more Secondary Master drive:
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="1">
  <Image uuid="{4deec59c-5799-4fb1-ab67-77a2ec4e16a1}"/>
</AttachedDevice>
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