Opened 8 years ago
Last modified 5 years ago
#16450 new defect
VM locks up when setting --discard and --nonrotational and using fstrim
| Reported by: | Motlib | Owned by: | |
|---|---|---|---|
| Component: | virtual disk | Version: | VirtualBox 5.1.14 |
| Keywords: | SSD fstrim discard | Cc: | |
| Guest type: | Linux | Host type: | Linux |
Description
I changed the settings of my Xubuntu VM to emulate an SSD:
VBoxManage storageattach Xubuntu --storagectl SATA --port 0 --discard on --nonrotational on
After that started the VM. Everything runs fine until running fstrim in the VM. First the VDI file is shrinked a bit, then VirtualBox starts continuously reading from host filesystem (I guess from the VDI file). After some time the VM guest OS reports storage problems (timeouts) in dmesg output. No access to emulated storage is possible after that, but VM continues to run (e.g. scrolling in windows, moving mouse, ...). See attached VM screenshots and VBox.log for details.
I already observed the same behavior with a Windows 10 VM which locked up in the same way, but then I did not record any logs or error information.
Problem seems to be similar to ticket #15509.
Host info: Kubuntu 16.10 64 Bit, VirtualBox 5.1.6 (installed from Kubuntu repository)
Guest info: Xubuntu 16.10 64 Bit, 1 SATA controller, 1 VDA file with dynamic size
Please tell if any more information is needed.
Attachments (5)
Change History (9)
by , 8 years ago
| Attachment: | VirtualBox_Xubuntu_04_02_2017_10_01_14.png added |
|---|
by , 8 years ago
| Attachment: | VirtualBox_Xubuntu_04_02_2017_10_02_11.png added |
|---|
dmesg output in VM, part 2
by , 8 years ago
| Attachment: | VirtualBox_Xubuntu_04_02_2017_10_02_27.png added |
|---|
dmesg output in VM, part 3
comment:1 by , 8 years ago
In the guest info above is a typo. Of course it's a VDI file.
Now I also discovered the same behavior with Windows 7 64 Bit as host OS, Kubuntu 16.10 64 bit as guest os and VirtualBox version 5.1.14r112924. VirtualBox again starts continuously reading the VDI file and the guest OS becomes unresponsive.
comment:2 by , 6 years ago
I'm also seeing this lockup when using a Windows 2016 guest (https://github.com/rgl/windows-2016-vagrant) running in Ubuntu 18.04 and in a Windows 10 host. Not using the --discard argument makes things work again.
comment:3 by , 6 years ago
This issue is very easy to reproduce. Just try to install Windows 10 or Debian 9 on such a VM, using a medium that's attached with the nonrotational and discard parameters. The VirtualBox VM process stops responding to controls.
comment:4 by , 5 years ago
I can avoid hang with any of:
- Use PIIX4 storage controller type.
- Use HOST I/O Cache.
Windows 10 host. I think problem from concurrent VDI access. IDE controller not support multiple commands and Windows cache hide/fix concurrent access to VDI file.


dmesg output in VM, part 1