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

Discussions related to using VirtualBox on Mac OS X hosts.
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

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

Post by Laura »

Several people have posted about getting the same error message, but I haven't seen a solution that works other than to send mpack your vbox file and have them fix it (which isn't very satisfying). I'm also new to VB and having trouble interpreting suggestions. So here's the summary:

I installed VB on my MacBookPro (OS 10.11.6 because I like stability!) a couple of years ago and wanted to use it again for a Windows-only application. I already had Windows 7 installed, but decided not to upgrade to 10 because I had a piece of software that would be deleted during the upgrade. So I upgraded VB to 6.1, then had to apply a bunch of updates to Windows 7. I installed the new program and it was working fine. I wanted to share a folder between the Mac and VM, so I followed instructions in a YouTube video (maybe a bad idea, but...). This had me select the folder going through settings/shared folders for the VM and then install Guest Additions. This all seemed to go fine. I think the problem was one mentioned in other posts, i.e., that I turned off VB while the GuestAdditions iso was still mounted because the "Cannot attach medium " error message appeared when I restarted VB. So here's the current state:

Upon opening VB, the Windows7 VM is listed in the Manager, but is marked "Inaccessible." Available options on right click are Export to OCI, Remove, and Refresh. (I tried Refresh, but nothing changes.) Clicking the VM menu, the options Details, Snapshots, Logs are listed but grayed out. To the right is the error message shown in the screen shot below.
VBManager.message.tiff
VBManager.message.tiff (88.6 KiB) Viewed 3218 times
Following some advice from other posts here, I went to the Virtual Media Manager and looked at Optical disks. VBoxGuestAdditions.iso was indeed listed there, so I removed it. This didn't help immediately or after relaunching VB. I looked in the Media Manager again and verified the iso status as Not Attached. (Actually, there are 3 disks listed, but all show up as Not Attached, second screen shot).
VBMedia.notattached.tiff
VBMedia.notattached.tiff (96.51 KiB) Viewed 3218 times
This approach was as much as I could glean from the prior posts, so now I'm at a loss and hoping for some help. I'd settle for a reference to a different post!

Thanks!
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

Oh -- clicking on Windows7.vbox gave the error

"Trying to open a VM config '/Users/laura/VirtualBox VMs/Windows7/Windows7.vbox' which has the same UUID as an existing virtual machine."
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by fth0 »

Laura wrote:Several people have posted about getting the same error message, but I haven't seen a solution that works other than to send mpack your vbox file and have them fix it (which isn't very satisfying).
Laura wrote:I'm at a loss and hoping for some help.
ATM, I don't see an alternative solution (with the exception that not only mpack can edit .vbox files ;)). And we're not satisfied either, BTW, but a corresponding Bugtracker ticket (19648) didn't get much attention.

The problem arises when the user manages to insert one ISO file in two virtual CD drives. This is not forbidden, but for some reason VirtualBox cannot cope with this situation. I'm curious: In most cases, the affected user cannot remember how or why they got into this situation. Do you?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by scottgus1 »

If you zip and post the .vbox file we can try to edit out the problem.
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

fth0 wrote: The problem arises when the user manages to insert one ISO file in two virtual CD drives. This is not forbidden, but for some reason VirtualBox cannot cope with this situation. I'm curious: In most cases, the affected user cannot remember how or why they got into this situation. Do you?
I don't remember trying to load any isos twice. I explained all I could remember in my original post.

Good to know I don't need mpack! :-)
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

scottgus1 wrote:If you zip and post the .vbox file we can try to edit out the problem.
Here it is. I probably should've uploaded it right away. Thanks!
Attachments
Windows7.vbox.zip
(2.61 KiB) Downloaded 10 times
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

Regarding Bugtracker ticket (19648): Is there somewhere I should complain to to help this problem get more attention? It doesn't look like I'm able to post there.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by scottgus1 »

<DVDImages>
<Image uuid="{c3f46f54-0705-40ee-91a7-c884a79864ea}" location="/Users/laura/Desktop/Windows/en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso"/>
<Image uuid="{918efcfb-8051-47f2-8bb3-f38f47e5216c}" location="/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso"/>
<Image uuid="{2892758d-9e4c-4d52-98ee-acfde4201884}" location="/Users/laura/Downloads/SW_DVD9_Win_Pro_10_1909_64BIT_English_Pro_Ent_EDU_N_MLF_X22-17395.iso"/>
</DVDImages>
.......
<StorageControllers>
<StorageController name="SATA" type="AHCI" PortCount="3" useHostIOCache="false" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
<AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
<Image uuid="{03368e92-76b2-4e6f-bf7e-d5f127c2bde1}"/>
</AttachedDevice>
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="1" device="0">
<Image uuid="{918efcfb-8051-47f2-8bb3-f38f47e5216c}"/>
</AttachedDevice>
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="2" device="0">
<Image uuid="{918efcfb-8051-47f2-8bb3-f38f47e5216c}"/>
</AttachedDevice>
</StorageController>
</StorageControllers>
There you go. 2 Guest Additions ISOs loaded at once.

I took the ISO's out, but left the CD drives:
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="1" device="0"/>
<AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="2" device="0"/>
Windows7.vbox.zip
(2.56 KiB) Downloaded 11 times
Reboot your host so no Virtualbox processes are running. Rename your existing .vbox file to .vbox-bad, then put the attached .vbox in the guest folder, and try the guest.
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

Thanks! I'll compare the files and might even learn the fix myself!

Q: I'm not aware of a guest directory. Where should that be?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by scottgus1 »

Should be the same folder you found the .vbox file in. Otherwise, Right-click the guest in the main Virtualbox window's guest list, choose Show in Finderer. The folder that appears is the guest's folder, where the .vbox file goes.
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

That file was in /Users/laura/VirtualBox VMs/Windows7
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

It worked! Thanks so much. I might be afraid to try to share a folder again. This time I might use the VB documentation. 8)
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by scottgus1 »

Great! Glad you're up and running.

There is a way to load an ISO in more than one CD drive in the same guest. You can avoid it by not having more than one guest CD drive. Your guest has two now, you can select and delete one of them after the guest has been shut down.

Use 'Insert Guest Additions CD Image' in the guest Virtualbox window's Devices menu to put the Guest Additions ISO in the guest's CD drive. Then Virtualbox shouldn't load the ISO twice.
fth0
Volunteer
Posts: 5677
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by fth0 »

scottgus1 wrote:You can avoid it by not having more than one guest CD drive.
I'm still wondering if and why people really add a 2nd CD drive to their VM (I've seen no one yet remembering to have done this) ...
Laura
Posts: 14
Joined: 25. Jun 2020, 06:32

Re: Error: Cannot attach medium.... medium is already associated with the current state of the machi

Post by Laura »

I think there were two from the start. As a new user, I wouldn't have added anything without seeing explicit instructions somewhere.
Post Reply