Installing NVIDIA drivers on Ubuntu (Guest) in VirtualBox causes it to stop working

It is not a good idea to install video drivers to a guest system.

Guest systems do not have direct access to the graphics adapter. That is why they use virtual VBox drivers.

Just remove the Nvidia driver and never install it to guest systems.

If you did not do that already, install Guest Additions from Machine menu. This will install the virtual drivers.


I had recently installed Ubuntu 15.10 64-bit onto a USB thumb drive (not a Live USB!) and had trouble with running it on my laptop[1] natively and in VirtualBox interchangeably[2] while using nvidia-364 drivers. I experienced the login loop and several other problems after troubleshooting. My laptop has NVIDIA Optimus switchable graphics.

Selecting the "Intel (Power Saving Mode)" setting in the NVIDIA X Server Settings PRIME Profiles with my laptop before booting with VirtualBox solved this problem for me.

NVIDIA X Server Settings PRIME Profiles

Here is an answer about installing nvidia-prime.

Footnotes:

  1. Windows 8.1 64-bit host
  2. See this answer for more about booting USB drives in VirtualBox.