Opened 8 years ago
#16362 new defect
Cannot create solid state drives when VM is running
Reported by: | jkv | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 5.0.30 |
Keywords: | Cc: | ||
Guest type: | Linux | Host type: | Mac OS X |
Description
I want to simulate the replacement of a solid state drive while the system is running.
I have a VM (guest OS: ubuntu 14:04), with a SATA controller of 4 hotpluggable disks. The solid-state drive is on port 3.
I first create a new medium to represent the replacement disk: $ vboxmanage createmedium disk --filename disks/ssd6.vmdk --size 8192 --format VMDK 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Medium created. UUID: 9532c0bc-f14b-4f0c-a4df-b366024ed58d
Then I remove the solid state drive from the VM: $vboxmanage storageattach "standalone_default_1473423571692_13381" --storagectl SATAController --port=3 --medium=none
Then I want to replace it with a new virtual Solid-State Drive: $ vboxmanage storageattach "standalone_default_1473423571692_13381" --storagectl SATAController --port=3 --medium=disks/ssd6.vmdk --type hdd --nonrotational on
I get the following error: VBoxManage: error: The machine is not mutable (state is Running) VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component SessionMachine, interface IMachine, callee nsISupports VBoxManage: error: Context: "NonRotationalDevice(Bstr(pszCtl).raw(), port, device, TRUE)" at line 837 of file VBoxManageStorageController.cpp
If I omit the option --nonrotational on, the command succeeds, but it's added as a regular (hotpluggable) hard disk.