Common VirtualBox Issues

From Computer Science

Running VirtualBox with a HiDPI screen

A common issue on newer Macbook pros is that VirtualBox scales very poorly to the host display when it is a HiDPI resolution. Why this is, I do not know exactly. This results in very laggy window movement, typing, and overall updating of the screen to any changes. A quick and easy workaround is to plug your computer into a secondary non-HiDPI monitor and move the virtual machine guest window to that screen. You should notice immediate improvement in usability.

The second solution is to simply rescale the host resolution to a lower one, so VirtualBox can function.

  1. First install the RDM tool here: https://github.com/avibrazil/RDM. MAKE SURE TO INSTALL THIS IN YOUR HOST MACHINE, NOT INSIDE VBOX. Simply navigate to that link, scroll to the bottom, find where it says "installable binary package?" and follow that link. Once at that directory, click either the DMG or the PKG file for the latest version, and install normally. (If you use the DMG, you will have to open finder, look on the left for RDM, and click the PKG file in there).
  2. After installing properly, you should see a little screen icon in the top right of your screen on your toolbar. Click it, and select a resolution WITHOUT a lightning bolt next to it. Preferably a lower resolution, as there is a tradeoff between pixels and performance occurring. I find that 1440x900 is fine for visibility and performance, and going above 2560x1440 or more strains Vbox. View the image below:

Screen Shot 2019-08-21 at 1.33.08 PM.png

After this is done, open up a new instance of VirtualBox and you should find the performance improved. Additional tips for improving performance on OSX:

  • Make sure 2d/3d acceleration is turned off (Settings > Display)
  • Turn the Graphics Controller to VBoxVGA (Settings > Display)

If you still have trouble after this, feel free to visit me in my office or shoot me an email at rlichenstein@middlebury.edu.

OSX Kernel Driver Not Installed error

It is common on OSX to see an error like this:

Kernel driver not installed (rc=-1908)

Make sure the kernel module has been loaded successfully.

where: suplibOsInit what: 3 VERR_VM_DRIVER_NOT_INSTALLED (-1908) - The support driver is not installed. On linux, open returned ENOENT.

If you catch this error within the first 30 minutes
  1. Navigate to System Preferences -> Security & Privacy -> General
  2. You should see an error displaying "Software from Oracle was blocked" or something to that affect
  3. Click "Allow" to the right of the message, and VirtualBox should begin to work.
See below image for reference (courtesy of apple):

Tn2459 approval.png


If the "allow" message is not appearing
This occurs if you have waited more than 30 minutes since the first attempted load of the VirtualBox Kernel Extension.
In order to fix this we have to do a few more complicated things.
  1. First, try uninstalling VirtualBox fully, deleting all relevant files, rebooting, and waiting 30 minutes. Re-install VirtualBox and see if the "allow" message appears when the error occurs.
  2. If that does not work, keep VirtualBox installed, but restart your Mac in recovery mode. (Restart your computer and hold cmd-R until the recovery mode appears)
  3. Once in Recovery mode, open a terminal prompt.
  4. Enter the command spctl kext-consent add VB5E2TV963 and press enter.
  5. Exit Recovery Mode and boot your computer normally, run VirtualBox and no error should occur.
If further errors persist, contact your instructor or an ASI for assistance.
Relevant Reading and Sources
https://forums.virtualbox.org/viewtopic.php?f=8&t=84092
https://developer.apple.com/library/archive/technotes/tn2459/_index.html
https://forums.virtualbox.org/viewtopic.php?f=8&t=84092&start=45#p443452

startxfce4 failing with (EE) AddScreen/ScreenInit failed for driver 0

There is a known bug whereby the graphical environment refuses to start. That is, when you run `startxfce4`, instead of seeing pretty pictures, you see errors like "(EE) AddScreen/ScreenInit failed for driver 0" and "(EE) Server terminated with error".

Permanent Fix

Edit our boot environment creation script, to avoid unruly bugs.

    $ sudo sed -i -e '/^MODULES=/ s/()/(i915)/' /etc/mkinitcpio.conf

(if prompted for your password, enter it)

Rebuild the initramfs:

    $ sudo mkinitcpio -P linux 

Reboot and hopefully X will start without restarting dbus.


Temporary Fix


The fix is to run this command:

$ sudo systemctl restart dbus


(The last character of the second word is the letter ell, not the digit one. When prompted, enter *your* password.)

After doing so, running `startxfce4` should work fine. Once inside, you can click on the icon at the bottom that looks like a TV screen to get a terminal in which you can type and work. You can (should) also install a text editor like atom. You should read the "Things you need to know" link above.

Whenever you boot the virtual machine anew, you will likely have to run that command again.

VM Crashing with Termination Reason: Namespace TCC, Code 0x0 (OSX/Mojava/Catalina)

Relevant bug thread: https://forums.virtualbox.org/viewtopic.php?f=8&t=97141 The Quick Fix:

Open a Terminal window. Type 'virtualbox'. Hit enter.

You should see Virtualbox open as usual (don't close the Terminal window, although you can minimize it).

Now that VirtualBox is running inside the Terminal process, it has permission to ask for permission to use your camera/microphone. You can now launch your VM and should see a prompt asking you to allow it in the preferences.

Just keep your terminal open for the remainder of your VirtualBox session.

A more effective solution should be forthcoming soon.

Screen Flickering on OSX screens (or other)

If the above section on HiDpi screens doesn't fix your issues, try the following:

  • Open VirtualBox, select your flickering VM
  • Click Settings
  • Go to Displays
  • Under 'Graphics Controller' select 'VMSVGA'
  • Click OK

Hopefully your flickering is solved!