Reputation: 10036
I've installed a Ubuntu VM using VirtualBox, but when I start it up the input lag is really noticeable. For example, when I type something there is a noticeable delay before the words show up on the screen. What can I do to reduce this lag?
Upvotes: 23
Views: 77704
Reputation: 1110
I can confirm that as of 2024 keyboard lag can still be a major problem in a Linux guest on a Windows host, however in my case none of the solutions provided by Adam in 2016 worked, and some (eg enabling 3D graphics) made things worse.
The root of the issue in my case arises from selecting the (default and recommended) VMSVGA video adapter in the VM settings, which will cause keyboard lag on guests where the host machine has certain graphics cards. VBoxSVGA is reportedly also laggy, albeit less so than VMSVGA. According to this link https://www.virtualbox.org/ticket/20552, Nvidia cards are particularly affected, and in my case I have a dedicated Nvidia card.
Switching to VBoxVGA has solved the lag problem for me. Note VirtualBox will show a warning about switching to a non-recommended graphics controller, but it can be ignored. Notwithstanding, your guest machine may need to be reconfigured to use the new graphic controller properly after rebooting.
Upvotes: 3
Reputation: 10036
Here are some things to try (all of these changes must be done when the VM is powered down):
•Give the VM more memory (RAM) to work with. I bumped mine up from ~1gb to 4gb.
Right click the VM icon, Settings -> System -> Motherboard tab, move the Base Memory
slider bar to give the VM access to more of the host machine's memory.
• Give the VM more CPU cores to work with. I went from 1 to 4.
Right click the VM icon, Settings -> System -> Processor tab, move the Processors
slider bar to allow the VM access to more cores on the host machine's CPU. You can also adjust how much of the host CPU the VM is allowed to use (i.e. what percentage) by moving the Execution Gap slider.
• Enable 3D graphics acceleration to the VM.
Right click the VM, Settings -> Display -> check the Enable 3D Acceleration
tick box.
Update: I switched to VMWare Player because it's much faster (even with a single core I didn't notice any lag). It's free for non-commercial use: http://www.vmware.com/products/player/playerpro-evaluation.html.
Upvotes: 22