Set the VirtualBox virtual harddrive to read-only.

'''1.''' Power off the machine.

'''2.''' Open setting window of the machine and set the type of storage device controller from <code>AHCI</code> to <code>LsiLogic SAS</code>.

<code>VirtualBox</code> &rarr; <code>Settings</code> &rarr; <code>Storage</code> &rarr; <code>Type:</code> <code>LsiLogic SAS</code> &rarr; <code>OK</code>

'''3.''' Learn the syntax.

Do not run the following command. Only look at it.

TODO research: <code>lsilogicsas</code> might no longer work because nowadays using IntelAhci. So commands below need adjustment. How? This is difficult because undocumented by VirtualBox.

<pre>
VBoxManage setextradata vmname "VBoxInternal/Devices/lsilogicsas/0/LUN#0/AttachedDriver/Config/ReadOnly" 1
</pre>

Replace <code>vmname</code> with the name of the actual VM name.

'''4.''' On the command line run.

<u>{{project_name_gateway_long}} Xfce example</u>:

{{CodeSelect|code=
VBoxManage setextradata {{project_name_gateway_short}}-Xfce "VBoxInternal/Devices/lsilogicsas/0/LUN#0/AttachedDriver/Config/ReadOnly" 1
}}

<u>{{project_name_workstation_long}} CLI example</u>:

{{CodeSelect|code=
VBoxManage setextradata {{project_name_workstation_short}}-CLI "VBoxInternal/Devices/lsilogicsas/0/LUN#0/AttachedDriver/Config/ReadOnly" 1
}}