Opened 4 years ago
#20246 new defect
vboxmanage modifymedium lock not released immediately
Reported by: | Mrpn | Owned by: | |
---|---|---|---|
Component: | other | Version: | VirtualBox 6.1.18 |
Keywords: | Cc: | ||
Guest type: | other | Host type: | Linux |
Description
This is a host only issue.
Sometimes the lock of a medium during vboxmanage is still in effect after the command has completed. This is especially when the host cpu is heavily loaded. The following seems to work with a sleep trick. (Delay the next command, so the lock is released.)
vboxmanage modifymedium "$parentmedium" --compact && sleep 10s && touch -r "$parentmedium" "${parentmedium}.stamp"
vboxmanage storageattach "${parentvm}" --storagectl "${storagename}" --port ${storageport} --device ${storagedevice} --type hdd --medium emptydrive && sleep 10s
vboxmanage modifymedium "${parentmedium}" --type immutable && sleep 10s
Example: https://github.com/nipatriknilsson/vboxcloneimmutable