[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.
piter
Posts: 4
Joined: 11. Nov 2019, 02:15

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

Post by piter »

It looks that I have the same problem :/
I'm super entry level user and I'm scared that I've lost access to Ubuntu ...

I attached my VB Machine Definition file.
Can I hope for any help?

BR,
P.
Attachments
Ubuntu Linux.zip
(2.02 KiB) Downloaded 25 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: [Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

Please don't hijack/piggyback on other people's threads, it's easy enough to create your very own, unique thread that gets all the attention... ;)

Replace your "Ubuntu Linux.vbox" with the one below:
[Removed non-working .vbox file, see follow-up]

I would really like to know why you added 2 (TWO) CD drives, on which both you inserted the Guest Additions ISO... :roll:
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.
piter
Posts: 4
Joined: 11. Nov 2019, 02:15

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

Post by piter »

Sorry for that, I thought it will be more appreciated to add post regarding to the same subject instead of create unique thread with the same problem :)

I replaced 'VirtualBox.xml' file in 'C:\Users\User\.VirtualBox\'
It didn't help.
socratis wrote:Why did I add 2 (TWO) CD drives with inserted the Guest Additions ISO?
Did I? I have no idea :)
Probably it might be related to the process of changing the size of the disc. I was following some YT tutorials how to do it and I was doing it blindly ;)
After that right now in VirtualBox VMs folder I have Ubuntu Linux folder with 2 Virtual Disk Images inside:
  • Ubuntu Linux (old -15 GB)
  • Ubuntu Linux New (new - 30 GB)
I found the solution.I don't know whether it is correct and stable but it works.
I created new Virtual Machine and added existing virtual machine (Ubuntu Linux New) in the hard disc section.
That'all. Is something wrong in that approach? As I said - it works :)
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: [Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

[color=#00AA00]socratis[/color] wrote:Replace your "Ubuntu Linux.vbox" with the one below:
[color=#105289]piter[/color] wrote:I replaced 'VirtualBox.xml' file in 'C:\Users\User\.VirtualBox\'
Do you see the problem here? I told you to replace a specific file, and you replaced another!!! :o
piter wrote:Did I? I have no idea
piter wrote:I was following some YT tutorials
Now I do know why you added a 2nd CD drive; you were following some YouTube tutorial from some random blogger. And this misaligned advice keeps on propagating, that's how the instances of dual CD drives, both of them loaded with the GAs ISO keep on increasing...

You should have a searchable PDF included with your installation (C:\Program Files\Oracle\VirtualBox\doc\UserManual.pdf). There's also the on-line manual in PDF format, again searchable. Take advantage of that fact, and use it to search the PDF for the terms that interest you. Stick to the User Manual instead of random, possibly outdated advice on the internet...
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.
piter
Posts: 4
Joined: 11. Nov 2019, 02:15

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

Post by piter »

As I said before, I'm totally beginner and probably what's even worse, I've had already followed bad practices.

I changed the file as you suggested and now the error looks like this (attachment):
Extra content at the end of the document.
Location: 'C:\Users\User\VirtualBox VMs\Ubuntu Linux\Ubuntu Linux.vbox', line 88 (0), column 1.
F:\tinderbox\win-6.0\src\VBox\Main\src-server\MachineImpl.cpp[752] (long __cdecl Machine::i_registeredInit(void)).
Thanks for your reply and really appreciate your advice about following PDF instuction.

P.
error.JPG
error.JPG (28.1 KiB) Viewed 2255 times
Last edited by socratis on 11. Nov 2019, 14:35, edited 1 time in total.
Reason: Enclosed the information in [quote] tag for better readability
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: [Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

piter wrote:As I said before, I'm totally beginner and probably what's even worse, I've had already followed bad practices.
No worries, that's why we're here... ;)
piter wrote:now the error looks like this
I'm terribly sorry about that! I deleted an extra line, and even worse, I didn't actually test it, mea culpa... :?

Please try the following one, I'll edit my previous post to remove the wrong one as well:

Code: Select all

<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.virtualbox.org/" version="1.16-windows">
  <Machine uuid="{9617e1d5-bc02-43aa-a168-084ab686d553}" name="Ubuntu Linux" OSType="Ubuntu_64" snapshotFolder="Snapshots" lastStateChange="2019-11-10T18:40:36Z">
    <MediaRegistry>
      <HardDisks>
        <HardDisk uuid="{d9a2abea-8128-4e83-bc64-4ba56acfdacf}" location="Ubuntu Linux.vdi" format="VDI" type="Normal"/>
        <HardDisk uuid="{d0576b2f-bf02-4a62-a97d-5bba86bd279d}" location="Ubuntu Linux New.vdi" format="VDI" type="Normal"/>
      </HardDisks>
    </MediaRegistry>
    <ExtraData>
      <ExtraDataItem name="GUI/Fullscreen" value="true"/>
      <ExtraDataItem name="GUI/LastCloseAction" value="PowerOff"/>
      <ExtraDataItem name="GUI/LastGuestSizeHint" value="1920,1027"/>
      <ExtraDataItem name="GUI/LastGuestSizeHint1" value="640,454"/>
      <ExtraDataItem name="GUI/LastNormalWindowPosition" value="1920,27,640,480,max"/>
      <ExtraDataItem name="GUI/LastNormalWindowPosition1" value="640,276,640,480"/>
      <ExtraDataItem name="GUI/LastScaleWindowPosition" value="2120,207,885,636,max"/>
      <ExtraDataItem name="GUI/LastScaleWindowPosition1" value="640,276,640,480"/>
      <ExtraDataItem name="GUI/ScaleFactor" value="1"/>
      <ExtraDataItem name="GUI/StatusBar/Enabled" value="false"/>
      <ExtraDataItem name="GUI/VirtualScreenToHostScreen0" value="1"/>
    </ExtraData>
    <Hardware>
      <CPU count="2">
        <PAE enabled="true"/>
        <LongMode enabled="true"/>
        <X2APIC enabled="true"/>
        <HardwareVirtExLargePages enabled="true"/>
      </CPU>
      <Memory RAMSize="4096"/>
      <HID Pointing="USBTablet"/>
      <Display controller="VMSVGA" VRAMSize="128" monitorCount="2"/>
      <VideoCapture screens="3" file="." fps="25"/>
      <BIOS>
        <IOAPIC enabled="true"/>
      </BIOS>
      <USB>
        <Controllers>
          <Controller name="OHCI" type="OHCI"/>
        </Controllers>
      </USB>
      <Network>
        <Adapter slot="0" enabled="true" MACAddress="0800275C8BF7" promiscuousModePolicy="AllowNetwork" type="82540EM">
          <DisabledModes>
            <InternalNetwork name="intnet"/>
            <NATNetwork name="NatNetwork"/>
          </DisabledModes>
          <BridgedInterface name="Intel(R) Centrino(R) Ultimate-N 6300 AGN"/>
        </Adapter>
      </Network>
      <AudioAdapter codec="AD1980" driver="DirectSound" enabled="true" enabledIn="false"/>
      <RTC localOrUTC="UTC"/>
      <GuestProperties>
        <GuestProperty name="/VirtualBox/GuestAdd/HostVerLastChecked" value="6.0.10" timestamp="1573225088356444900" flags=""/>
        <GuestProperty name="/VirtualBox/GuestAdd/Revision" value="132072" timestamp="1573225056788936306" flags=""/>
        <GuestProperty name="/VirtualBox/GuestAdd/Version" value="6.0.10" timestamp="1573225056788936304" flags=""/>
        <GuestProperty name="/VirtualBox/GuestAdd/VersionExt" value="6.0.10" timestamp="1573225056788936305" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/Net/0/MAC" value="0800275C8BF7" timestamp="1573225056795937204" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/Net/0/Name" value="enp0s3" timestamp="1573225056795937206" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/Net/0/Status" value="Up" timestamp="1573225056795937205" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Broadcast" value="192.168.0.255" timestamp="1573225056795937202" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/IP" value="192.168.0.104" timestamp="1573225056795937201" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/Net/0/V4/Netmask" value="255.255.255.0" timestamp="1573225056795937203" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/Net/Count" value="1" timestamp="1573225181774807500" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Linux" timestamp="1573225056788936300" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="5.0.0-29-generic" timestamp="1573225056788936301" flags=""/>
        <GuestProperty name="/VirtualBox/GuestInfo/OS/Version" value="#31~18.04.1-Ubuntu SMP Thu Sep 12 18:29:21 UTC 2019" timestamp="1573225056788936302" flags=""/>
        <GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="pl_PL" timestamp="1573225095103301600" flags="RDONLYGUEST"/>
      </GuestProperties>
    </Hardware>
    <StorageControllers>
      <StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
        <AttachedDevice passthrough="false" type="DVD" hotpluggable="false" port="0" device="0">
        </AttachedDevice>
      </StorageController>
      <StorageController name="SATA" type="AHCI" PortCount="2" useHostIOCache="true" Bootable="true" IDE0MasterEmulationPort="0" IDE0SlaveEmulationPort="1" IDE1MasterEmulationPort="2" IDE1SlaveEmulationPort="3">
        <AttachedDevice type="HardDisk" hotpluggable="false" port="0" device="0">
          <Image uuid="{d0576b2f-bf02-4a62-a97d-5bba86bd279d}"/>
        </AttachedDevice>
      </StorageController>
    </StorageControllers>
  </Machine>
</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.
piter
Posts: 4
Joined: 11. Nov 2019, 02:15

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

Post by piter »

Yeah! Now it works properly! :)
Thank you very much for your help and patience :)
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: [Solved] Cannot attach medium ... medium is already associated with the current state of machine

Post by socratis »

Glad you got it going.

And since I'd rather not have any more issues on an already marked as [Solved] thread, I'm locking this...
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.
Locked