{{Header}} {{Title|title= {{project_name_long}} Tuning }} {{#seo: |description=Making {{project_name_short}} Faster. Tuning {{project_name_short}}. |image=Gear-192875640.jpg }} [[image:Gear-192875640.jpg|thumb]] {{intro| Making {{project_name_short}} Faster. Tuning {{project_name_short}}. Choose your virtualizer to get started. }} {{Tab |type=controller |linkid=virtualbox |content= {{Tab |active=true |type=section |title={{headline|h=3|content=VirtualBox}} |image=[[File:Virtualbox_logo.png]] |addToClass=special-look |content= Virtualizer [[VirtualBox]] has been chosen. }} {{Tab |type=section |title={{headline|h=3|content=KVM}} |image=[[File:Kvm-new-logo.png]] |content= Virtualizer [[KVM]] has been chosen. }} }} See below. = Introduction = {{mbox | type = notice | image = [[File:Ambox_notice.png|40px|alt=Info]] | text = Everything in this chapter is entirely optional. }} Applying steps in this chapter can improve {{project_name_short}} performance, but often at the cost of reduced security or an increased fingerprinting risk. Earlier entries in this chapter are easier to apply, while later tuning entries require a greater skill level. = Tested Tuning Steps = {{anchor|Hardware-accelerated graphics}} == Hardware-accelerated Graphics == {{Tab |type=controller |linkid=virtualbox |content= {{Tab |active=true |type=section |title={{headline|h=3|content=VirtualBox}} |image=[[File:Virtualbox_logo.png]] |addToClass=special-look |content= {{mbox | image = [[File:Ambox_warning_pn.svg.png|40px]] | text = '''Warning:''' This procedure lessens security. }} To enable hardware-accelerated graphics for {{project_name_workstation_long}}, perform these steps on the host: # Power off the VM. # VirtualBoxclick a VMSettingsDisplayGraphics ControllerAcceleration: check Enable 3D AccelerationOK # Restart the VM. Also refer to the VirtualBox manual: [https://www.virtualbox.org/manual/ch04.html#guestadd-3d Hardware-Accelerated Graphics]. Forum discussion: [https://forums.whonix.org/t/virtualbox-3d-acceleration/8673 VirtualBox 3D Acceleration] }} {{Tab |type=section |title={{headline|h=3|content=KVM}} |image=[[File:Kvm-new-logo.png]] |content= [[Undocumented]]. }} }} == Increase Virtual Machine RAM == {{Tab |type=controller |linkid=virtualbox |content= {{Tab |active=true |type=section |title={{headline|h=3|content=VirtualBox}} |image=[[File:Virtualbox_logo.png]] |addToClass=special-look |content= RAM available to Virtual Machines can be increased via VirtualBox settings. To check how much RAM is free, use free -m in a Terminal. Consider the example below: {{box|text= # Shutdown the VM. # Assign more RAM: Virtual machineMenuSettingsAdjust Memory slider to 4096Hit: OK # Restart the VM. }} See also: [[RAM|Advice for Systems with Low RAM]]. }} {{Tab |type=section |title={{headline|h=3|content=KVM}} |image=[[File:Kvm-new-logo.png]] |content= [[Undocumented]]. }} }} == Additional CPU Cores == {{Tab |type=controller |linkid=virtualbox |content= {{Tab |active=true |type=section |title={{headline|h=3|content=VirtualBox}} |image=[[File:Virtualbox_logo.png]] |addToClass=special-look |content= {{mbox | image = [[File:Ambox_warning_pn.svg.png|40px]] | text = '''Warning:''' this procedure may increase fingerprinting risks. }} On systems with multi-core processors, if [[Protocol-Leak-Protection_and_Fingerprinting-Protection#Minor_Identifiers|minor identifiers]] are not of any concern Adding CPU cores is considered a minor risk. then the number of cores available to the Virtual Machine(s) can be increased in VirtualBox settings. Do not use the maximum since that could lead to system instability! Always leave at least one CPU unassigned; for example, if you have four CPUs then assign a maximum of three CPUs to the VM. VirtualBox ticket: [https://www.virtualbox.org/ticket/19500 VirtualBox should now prohibit assigning all physical CPUs to a VM and/or fix VirtualBox CPU assignment manual]. {{box|text= # Power off the VM. # VirtualBoxclick a VMSettingsSystemProcessorReduce to 3OK # Restart the VM. }} }} {{Tab |type=section |title={{headline|h=3|content=KVM}} |image=[[File:Kvm-new-logo.png]] |content= [[Undocumented]]. }} }} = Untested Tuning Steps = == Disable CPU Mitigations == {{mbox | image = [[File:Ambox_warning_pn.svg.png|40px]] | text = '''Warning:''' this procedure lessens security. [[Untested]]! }} Consider disabling the [[Spectre Meltdown]] mitigations. ([https://forums.whonix.org/t/whonix-vulerable-due-to-missing-processor-microcode-packages-spectre-meltdown-retpoline-l1-terminal-fault-l1tf/5739 Related forum discussion].) This step should be performed in the VM intended for disabled CPU mitigations and on the host operating system if either [[Kicksecure]] or [[security-misc]] are in use. {{box|text= '''1.''' Remove the relevant CPU mitigations file. {{CodeSelect|code= sudo rm /etc/default/grub.d/40_cpu_mitigations.cfg }} '''2.''' Update grub. {{CodeSelect|code= sudo update-grub }} '''3.''' Reboot. '''4.''' Done. }} == Nested Paging and VPIDs == {{Tab |type=controller |linkid=virtualbox |content= {{Tab |active=true |type=section |title={{headline|h=3|content=VirtualBox}} |image=[[File:Virtualbox_logo.png]] |addToClass=special-look |content= It is possible to increase performance by using largepages and/or Virtual Processor Identifiers (VPIDs). It is unknown if this decreases security or stability. For further information refer to the VirtualBox manual: [https://www.virtualbox.org/manual/ch10.html#nestedpaging Nested Paging and VPIDs]. {{CodeSelect|code= vboxmanage modifyvm {{project_name_workstation_short}}-Xfce --largepages on }} {{CodeSelect|code= vboxmanage modifyvm {{project_name_gateway_short}}-Xfce --largepages on }} {{CodeSelect|code= vboxmanage modifyvm {{project_name_workstation_short}}-Xfce --vtxvpid on }} {{CodeSelect|code= vboxmanage modifyvm {{project_name_gateway_short}}-Xfce --vtxvpid on }} }} {{Tab |type=section |title={{headline|h=3|content=KVM}} |image=[[File:Kvm-new-logo.png]] |content= [[Undocumented]]. }} }} == Memory Ballooning, Page Fusion and Memory Overcommitment == {{mbox | image = [[File:Ambox_warning_pn.svg.png|40px]] | text = '''Warning:''' this procedure lessens security. }} Memory ballooning worsens security because it is a vector for side channel attacks on memory; see [[Dev/KVM#memory_balloon|here]] for further information. This entry relates to KVM but the research similarly applies to other virtualizers unless they have implemented and documented specific protections. For other security considerations, refer to the VirtualBox manual: [https://www.virtualbox.org/manual/ch04.html#guestadd-memory-usage Memory Overcommitment]. == Undocumented Tuning Settings == There are probably more tuning-related settings, but these are currently [[undocumented]] at {{project_name_short}}. Interested readers can review the manual for relevant settings of their respective virtualizer, which are unlikely to be bundled under a "tuning" chapter. {{Tab |type=controller |linkid=virtualbox |content= {{Tab |active=true |type=section |title={{headline|h=3|content=VirtualBox}} |image=[[File:Virtualbox_logo.png]] |addToClass=special-look |content= To view all settings, run. {{CodeSelect|code= vboxmanage showvminfo {{Project_name_gateway_short}}-Xfce }} Next, learn about all of these settings by reviewing the [https://www.virtualbox.org/manual/ VirtualBox manual]. }} {{Tab |type=section |title={{headline|h=3|content=KVM}} |image=[[File:Kvm-new-logo.png]] |content= [[Undocumented]]. }} }} == PCI Passthrough == {{mbox | image = [[File:Ambox_warning_pn.svg.png|40px]] | text = '''Warning:''' this procedure lessens security. }} This setting can improve graphics performance dramatically, but it worsens security because VMs should not have direct access to physical hardware. In simple terms, this feature allows the direct use of physical PCI devices on the host by the guest even if the host does not have drivers for the particular device. {{Tab |type=controller |linkid=virtualbox |content= {{Tab |active=true |type=section |title={{headline|h=3|content=VirtualBox}} |image=[[File:Virtualbox_logo.png]] |addToClass=special-look |content= For further information, refer to VirtualBox Manual: [https://documentation.help/VirtualBox/ch09s06.html PCI Passthrough]. }} {{Tab |type=section |title={{headline|h=3|content=KVM}} |image=[[File:Kvm-new-logo.png]] |content= [[Undocumented]]. }} }} = See Also = * [[RAM|Advice for Systems with Low RAM]] * [[Troubleshooting]] = Footnotes = {{Footer}} [[Category:Documentation]]