The path /Users/runner/work/fedora-coreos-vm/fedora-coreos-vm/next_just_a_test is a DVD ISO file. I would like to use it to boot up two VMs with VirtualBox.

How can I do it in an efficient way? (Preferably minimizing RAM memory and disk usage). I get an error message:

/usr/bin/sudo vboxmanage storagectl firstguest --name IDE Controller --add ide
/usr/bin/sudo vboxmanage storagectl secondguest --name IDE Controller --add ide
/usr/bin/sudo vboxmanage storageattach firstguest --storagectl IDE Controller --port 0 --device 0 --type dvddrive --mtype readonly --medium next_just_a_test
/usr/bin/sudo vboxmanage storageattach secondguest --storagectl IDE Controller --port 0 --device 0 --type dvddrive --mtype readonly --medium next_just_a_test
VBoxManage: error: Cannot register the DVD image '/Users/runner/work/fedora-coreos-vm/fedora-coreos-vm/next_just_a_test' {c93832a7-5b60-4ae5-99f3-ab799194d1ee} because a CD/DVD image '/Users/runner/work/fedora-coreos-vm/fedora-coreos-vm/next_just_a_test' with UUID {dd91eb2b-b2ea-4729-99ad-11204a39c6da} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 191 of file VBoxManageDisk.cpp
VBoxManage: error: Invalid UUID or filename "next_just_a_test"

Additional information: The host computer is running macOS 10.15.

  • 1
    Maybe with a symbolic link so it would look like 2 different files. Also, what happens it you try those steps on the VirtualBox GUI instead of commands?
    – golimar
    Jul 20, 2021 at 11:53
  • I am writing a GitHub Action so I will need to write it as a script and have no access to any GUI. For all the details: github.com/eriksjolund/fedora-coreos-vm/runs/… (I changed the order of two lines in the output in the question but I think it shouldn't matter). Jul 20, 2021 at 12:04
  • Thanks for the tip, adding a symlink could be worth a test. I will try that. The man pages also speak about UUIDs vs file paths. I don't know if the same UUID could be shared somehow between the VMs. The GitHub Runner has limited resources so I would like to find the most resource-efficient solution. Jul 20, 2021 at 12:05
  • It seems the example I provided in the question sometimes works. It seems it is undeterministic. The order of the vboxmanage commands might be in different orders in my case. The vboxmanage commands are in order for the same VM though. I'm a bit confused as what is happening. Anyway, I tried a new approach where only the first /usr/bin/sudo vboxmanage storageattach ... use the filepath. The second time I use the uuid that can be parsed out from the command /usr/bin/sudo vboxmanage list dvds. It never failed after that. (I've only tried 3 times so far so it might be luck) Jul 23, 2021 at 9:40
  • I haven't tried the symlink approach yet. I'm holding my thumb the uuid-parsing (from sudo vboxmanage list dvds) is the way to go. Jul 23, 2021 at 9:43


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.