Thanks for quick response. TRIM appears finally in `hdparm` results but "--nonrotational on" is also needed otherwise .vbox file stays the same.
I tested offline with no VM started, this time both on Ubuntu 64bit host and Windows 7 64bit host - same results. Guests are Ubuntu 64 bit. Here is history of my attempts:
Code: Select all
n@i:/opt/lisa$ VBoxManage storageattach lisa --storagectl "SATA Controller" --port 0 --type hdd --medium lisa.vdi
n@i:/opt/lisa$ grep "AttachedDevice type=\"HardDisk\"" lisa.vbox
<AttachedDevice type="HardDisk" port="0" device="0">
n@i:/opt/lisa$ VBoxManage storageattach lisa --storagectl "SATA Controller" --port 0 --type hdd --nonrotational on --medium lisa.vdi
VBoxManage: error: Invalid --nonrotational argument 'on'
n@i:/opt/lisa$ VBoxManage storageattach lisa --storagectl "SATA Controller" --port 0 --type hdd --nonrotational off --medium lisa.vdi
VBoxManage: error: Invalid --nonrotational argument 'off'
n@i:/opt/lisa$ grep "AttachedDevice type=\"HardDisk\"" lisa.vbox
<AttachedDevice type="HardDisk" port="0" device="0">
n@i:/opt/lisa$ VBoxManage storageattach lisa --storagectl "SATA Controller" --port 0 --type hdd --discard on --medium lisa.vdi
n@i:/opt/lisa$ grep "AttachedDevice type=\"HardDisk\"" lisa.vbox
<AttachedDevice type="HardDisk" port="0" device="0">
n@i:/opt/lisa$ grep "AttachedDevice type=\"HardDisk\"" lisa.vbox
<AttachedDevice type="HardDisk" port="0" device="0">
n@i:/opt/lisa$ VBoxManage storageattach lisa --storagectl "SATA Controller" --port 0 --type hdd --discard off --medium lisa.vdi
n@i:/opt/lisa$ grep "AttachedDevice type=\"HardDisk\"" lisa.vbox
<AttachedDevice type="HardDisk" port="0" device="0">
n@i:/opt/lisa$ VBoxManage storageattach lisa --storagectl "SATA Controller" --port 0 --type hdd --discard on --nonrotational on --medium lisa.vdi
n@i:/opt/lisa$ grep "AttachedDevice type=\"HardDisk\"" lisa.vbox
n@i:/opt/lisa$ grep "AttachedDevice*type=\"HardDisk\"" lisa.vbox
n@i:/opt/lisa$ grep "<AttachedDevice" lisa.vbox
<AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
<AttachedDevice discard="true" type="HardDisk" port="0" device="0">
So `nonrotational` doesn't work alone. Also nonrotational seems to be not set in machine config. When I added the line below manually I got finally what I needed (SSD+TRIM).
Code: Select all
<AttachedDevice discard="true" nonrotational="true" type="HardDisk" port="0" device="0">
And another story is UI. I've just found that SSD setting is not stored in .vbox file once VirtualBox UI is closed it is unchecked when opened again. Diff on .vbox file doesn't show anything.
When I check "Solid-state drive" option and click OK in configuration window then following line shows up in VBoxSVC.log:
Code: Select all
00:00:36.176000 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={22781af3-1c96-4126-9edf-67a020e0e858} aComponent={SessionMachine} aText={No storage device attached to device slot 0 on port 0 of controller 'SATA Controller'}, preserve=false
While after UI is closed this shows up:
Code: Select all
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'D:\virtualki\XP1\Snapshots/{c119f3c4-1de0-410c-8952-730c514d308f}.vmdk' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'D:\virtualki\XP1\Snapshots/{271e25a0-3fb2-42c5-9e00-c2da82ce7239}.vmdk' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'D:\virtualki\XP1\Snapshots/{b11fa740-ec69-487c-a6ae-6be8636e9bbe}.vmdk' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'D:\virtualki\XP1\Snapshots/{d4fe2f8a-238a-4b50-87da-3880798a4829}.vmdk' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'D:\virtualki\XP1\XP1.vmdk' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'D:\virtualki\Win8\Win8.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'C:\virtualki_ssd\Xubuntu1204\Snapshots/{c169d365-d82d-47a6-806f-fbbe0457644e}.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'C:\virtualki_ssd\Xubuntu1204\Snapshots/{5ed0e483-db94-42b9-a54c-24dd5f95b873}.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.049000 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={29989373-b111-4654-8493-2e1176cba890} aComponent={Medium} aText={Medium 'C:\virtualki_ssd\Xubuntu1204\Xubuntu1204.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false
00:04:23.064000 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={3b2f08eb-b810-4715-bee0-bb06b9880ad2} aComponent={VirtualBox} aText={The object is not ready}, preserve=false
Above is from Windows host, but same happens on Ubuntu host. Virtual machines are shutdown. Only one VirtualBox 4.2 UI session run and closed.
Problem occurs both with VirtualBox configurations migrated from 4.1 and also with new machines created in 4.2.
SSD and TRIM features are great, I have to test them finally with create-delete file cycle.
I hope configuration and documentation will get more polish in 4.2.1. Thanks.