[Solved] Detaching VDI Doesn't seem to work

This is for discussing general topics about how to use VirtualBox.
Post Reply
purvisb
Posts: 3
Joined: 8. Apr 2021, 00:45

[Solved] Detaching VDI Doesn't seem to work

Post by purvisb »

I'm trying to set a VDI from "normal" to "immutable". Here's the commands I'm running:

Code: Select all

.\VBoxManage.exe storageattach "Ubuntu CS" --storagectl "SATA" --port 0 --medium emptydrive

Code: Select all

.\VBoxManage.exe modifymedium 'C:\Users\chas-purvisb\VirtualBox VMs\Ubuntu CS old\Ubuntu CS.vdi' --type immutable
Heres the output of modifymedium

Code: Select all

VBoxManage.exe: error: Cannot change the type of medium 'C:\Users\chas-purvisb\VirtualBox VMs\Ubuntu CS old\Ubuntu CS.vdi' because it is attached to 1 virtual machines
VBoxManage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component MediumWrap, interface IMedium, callee IUnknown
VBoxManage.exe: error: Context: "COMSETTER(Type)(enmMediumType)" at line 775 of file VBoxManageDisk.cpp
The settings gui for the VM list the VDI as detached in the storage tab. But the Virtual Media Manager gui information on the VDI says it is attached.
BillG
Volunteer
Posts: 5102
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Detaching VDI Doesn't seem to work

Post by BillG »

Did you try to release it from within the Media Manager? (Right-click option or use the keyboard shortcut).
Bill
purvisb
Posts: 3
Joined: 8. Apr 2021, 00:45

Re: Detaching VDI Doesn't seem to work

Post by purvisb »

BillG wrote:Did you try to release it from within the Media Manager? (Right-click option or use the keyboard shortcut).
The Release button is greyed out. I tried removing all the snapshots. There's one snapshot that I couldn't remove via the virtual media manager.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Detaching VDI Doesn't seem to work

Post by mpack »

If the release button is grayed out then the VM is still running (suspended VMs still count as running), or the disk is referenced by a snapshot.

Or the VDI may simply not exist - I don't have any examples of this on hand so I'm not sure about this behaviour.
purvisb
Posts: 3
Joined: 8. Apr 2021, 00:45

Re: Detaching VDI Doesn't seem to work

Post by purvisb »

mpack wrote:If the release button is grayed out then the VM is still running (suspended VMs still count as running), or the disk is referenced by a snapshot.

Or the VDI may simply not exist - I don't have any examples of this on hand so I'm not sure about this behaviour.
Removing all snapshots resolves the issue. Thanks.
mpack
Site Moderator
Posts: 39156
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: [Solved] Detaching VDI Doesn't seem to work

Post by mpack »

Thanks for reporting back.
Post Reply