VirtualBox possible solution to: 'Failed to open the medium with following ID' or 'medium is already associated with the current state of machine uuid'

Certain percentage of new students might stumble upon this error during or after installation of ‘Guest Additions’ for Linux Virtual Machine. This issue appear when the AttachedDevice is duplicated in the Virtual Machine configuration file. Possible cause might be the VBoxGuestAdditions.iso wasn’t unmounted by the user inside Linux after completion and/or improper shutdown of particular Virtual Machine afterwards, although this is my theory and need further investigation.

So the problem will manifest with this error notification, your ID will be different:
vb_error

As mentioned earlier, duplication in this particular case need to be removed from the Virtual Box configuration file. For editing, please avoid notepad (notepad ignore linebreaks from certain character set, ultimately smush everything into one big piece of code, not affecting functionality but make it hell a lot harder to orientate in it), you can use your favourite code editor for example VScode, Atom or even Notepad++ will do and before editing make sure that VirtualBox is turned off. VirtualBox usually spawn multiple processes and doing pretty good job terminate those after you close it. Though in this scenario we have to make sure that all its processes in the Windows Task Manager are gone:

The configuration file yourVMname.vbox is located on your system disk nested in few folders, in my case:
C:\Users\Theo\VirtualBox VMs\Xubuntu 18.04.2\Xubuntu 18.04.2.vbox <-- file we looking for, in case your file name extensions are hidden, it is the blue icon
unknown

So you opened the config file, now jump to this settings:
AttachedDevice passthrough="false" type="DVD" hotpluggable="false" <-- copy, paste friendly

Doesn’t matter how many duplication you have, our goal is trim it to one, so delete all multiple entries:

and this should be your result:

  • If it solved your problem and you are able to boot up your Linux Virtual Machine, before you turn it off, unmount VBoxGuestAdditions.iso or through the graphical interface inside your Linux machine (eject icon should do) or through the command line, copy-paste friendly:
    udisksctl unmount -b /dev/sr0

  • If it didn’t solve your problem, then try solution from

sahion

  • And as the last option but I find it the best option is to join friendly Discord server and in #virtualbox-help room ask for help. Try to remember how you turned off your virtual machine, if through the start menu inside your Linux or just powered it off via virtualbox menu or straight away closed all the windows, if you unmounted vbox additions after you installed it, any details may help analyse the growing problem and thus effectively find ultimate solution for future students.

:cd::dvd::cd::dvd::cd::dvd::cd: Happy virtualizing :cd::dvd::cd::dvd::cd::dvd::cd:

3 Likes

When I double click to open the config file, it just tries to open it again inside VirtualBox and throws me the same error. How do I open it to see that code? I tried to open it in Atom, and I couldn’t even see the file… I don’t currently have VScode on windows, I only downloaded it on my virtual machine. :confused:

Is Atom the problem or am I missing something?

I’m a dork. I tried to open it the wrong way. I finally saw it, had two copies of that code, deleted one of them, and now it works, thank you!

1 Like

Wow, this is as concise and easy-to-follow as a solution can be. Thank you so much!

1 Like