I have my sandbox created using vboxmanage cli tool which created vmdk file.
I converted it from .vmdk to .vdi, as i wanted to compress it. then i attached this newly created .vdi file.
Now i want to detach the vmdk file as i don't want it any more. Can you please suggest me what should be the command for the same?
List of my HDDs are:
$ vboxmanage list hdds
UUID: f3b90783-abe7-4549-91aa-39aa6161f103
Parent UUID: base
State: created
Type: normal (base)
Location: /home/ankit/VirtualBox VMs/asr-vm/asr-sandbox-3.5.0-lb1404x64-disk1.vmdk
Storage format: VMDK
Capacity: 65536 MBytes
UUID: 1b9a4eff-f1bd-4c4e-ae48-8f11b8003244
Parent UUID: base
State: created
Type: normal (base)
Location: /home/ankit/VirtualBox VMs/asr-vm/asr-sandbox-3.5.0-lb1404x64-disk1.vdi
Storage format: VDI
Capacity: 65536 MBytes
As briefly mentioned in Section 1.18, “Alternative Front-Ends”, VBoxManage is the command-line interface to Oracle VM VirtualBox. With it, you can completely control Oracle VM VirtualBox from the command line of your host operating system.
VBoxManage.exe is a file in the root directory of the VirtualBox installation on Windows. You find it under C:\Program Files\Oracle\VirtualBox by default. Start by opening a new command prompt window and navigating to the VirtualBox folder.
the solution for this is to attach that medium with emptydrive or none. that means for that particular port and device you are attaching an emptydrive or none.
vboxmanage storageattach "asr-vm" --storagectl "SATA" --port 1 --medium none
or
vboxmanage storageattach "asr-vm" --storagectl "SATA" --port 1 --medium emptydrive
As per docs medium none is a better option.
For anyone wondering why none is a better option than emptydrive for the --medium flag, the VboxManage docs have this to say:
--mediumSpecifies what is to be attached. The following values are supported:
- none: Any existing device should be removed from the given slot.
- emptydrive: For a virtual DVD or floppy drive only, this makes the device slot behave like a removeable drive into which no media has been inserted.
So given we want to detach (or "remove" it), none seems like the correct option.
Source: https://www.virtualbox.org/manual/ch08.html#vboxmanage-storageattach
This is a reponse to Mehrdad Hedayati comment to the accepted answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With