Why can't X find my vboxvideo driver?

I am running Fedora 25 as a guest in VirtualBox 5.1.14 on a Windows 10 host. I have installed xorg-x11-server-Xorg and the VBox guest additions (using the ISO provided by VirtualBox itself). The guest additions installed fine, after forcing the correct kernel header versions with dnf install kernel-devel-$(uname -r) kernel-headers-$(uname -r). There are no errors in the VBGA install log. dmesg shows vboxvideo has loaded, systemctl shows vboxadd-service is running, vboxadd-x11 active/exited. 3D acceleration is enabled in the VM settings.

However, when I try to start X, I get (EE) Failed to load module "vboxvideo" (module does not exist, 0). I've restarted multiple times, I've reinstalled VBGA and X multiple times, it just refuses to work. Many, many, many searches have turned up many instances of this issue, but most seem to revolve around either a) installing VBGA from a package instead of the included ISO (but I used the ISO), b) VBGA failing to install correctly (but it installed fine once I had the right headers, and it appears to be running), or c) a bad /etc/X11/xorg.conf (which they recommend deleting, but I don't have one to begin with). The rest are for much older versions of VBox than I'm using and were fixed with a simple VBox update.

Why can't X find the vboxvideo driver, and how do I straighten it out?


I created an account just because I was having the same issues and I figured out some things along the way that might help others.

So to start, I am running a CentOS 7 VM in VirtualBox 4.xx and the video driver is recognized with my guest additions working almost completely (auto-resize is still broken but I can live with this for now).

Getting Video Capbilities in a CentOS 7 VM (can be modified to apply to other Linux distributions also):

1. Download and Install a compatible version of VirtualBox Guest Additions

A. Download a version, newer than or made for the presently installed VirtualBox host program

Search through the VirtualBox download repository: https://download.virtualbox.org/virtualbox/

After selecting a folder, look for the "VBoxGuestAdditions x.xx.iso" file and download it

B. Install Guest Additions dependencies

Start the VM and mount the downloaded .iso file as a CD/DVD device in the VM Devices pane.

There are a few prerequisites for installing the Guest Additions that are available via the OS's native software repository program.

For RHEL-based Linux, use the following with "yum":

yum update
yum install epel-release
yum install gcc binutils make patch libgomp glibc-headers glibc-devel kernel kernel-devel kernel-headers
yum install dkms

Be sure to type "yes" for the install commands or use the "-y" option flag

C. Install Guest Additions

Open a terminal and use the "cd" command to navigate to the root of the CD/DVD folder.

Run the following command to start the installer:

sudo sh VBoxLinuxAdditions.run

If building the main Guest Additions kernel module fails, make sure that all the prerequisites have been installed correctly. Otherwise, reinstall them and attempt to run the installer again.

2. Obtaining, Compiling and Installing the "vboxvideo" driver

A. Downloading the source files for compilation

The file in the link below is a compressed tarball of the "vboxvideo" driver source files:

https://cgit.freedesktop.org/xorg/driver/xf86-video-vbox/snapshot/xf86-video-vbox-ab07f97612d045d8c0a376174b39a294d028fef2.tar.xz

B. Compiling and installing the "vboxvideo" driver

Uncompress the downloaded files and navigate the terminal into the folder "xf86-video-vbox-..."

Run the following in the terminal:

sudo sh autogen.sh --prefix=/usr --with-xorg-module-dir=/usr/lib64/xorg/modules/drivers
sudo make && sudo make install      

These commands will install two files "vboxvideo_drv.so" and "vboxvideo_drv.la" to your Xorg module directory. Note: The kernel module "vboxvideo.ko" is installed with the Guest Additions and does not need to be adjusted for this.

3. Setting up the X Server Configuration

A. Creating/downloading the Xorg.conf file

The VirtualBox Guest Additions is setup to generate its own Xorg.conf file at the end of the install. This process is buggy in some versions. A link to a working Xorg.conf file is given below.

https://drive.google.com/file/d/1y_f5od59sv3eeHGu01PorpvlnBfvum0M/view

B. Inserting the "Xorg.conf" file for use

Once downloaded or copied, copy the file to the X11 folder.

sudo cp xorg.conf/etc/X11/

C. Closing Procedures

Restart the VM from inside the Guest OS and allow it to boot entirely. There should now be video and other guest capabilities.

To verify this, log into the OS and open the Settings menu to the Displays section.

The monitor label should read "VBX" and clicking on the label will allow adjustment of screen resolution.

Additional Notes:

I. "Black/Frozen Screen Upon Boot"

If the boot procedure hangs after completing the guide, switch to a different terminal window by pressing the "Alt" and "Fx" keys simultaneously where x is a number from 2-6 (i.e. "Alt-F2").

This will open a user login via a CLI interface.

Log into the terminal and use the following command to check the "Xorg" log:

sudo less /var/log/Xorg.0.log

Look for any entries regarding the "vboxvideo" device.

- For any "Not Found" issues:

Verify that the "vboxvideo_drv.so" file compiled in Step 2b is in the proper folder.

- For any "Incompatible Version" issues:

Verify that the proper "vboxvideo_drv.so" file compiled in Step 2b as this is meant to be compatible with the latest version of the X server available on CentOS 7. (1.19.3 - Ver(23))

The present version of the X Server is found using the command:

X -version

- For any issues regarding incorrect syntax in the "Xorg.conf":

Verify that the "Xorg.conf" file in Step 3A matches the one in the "/etc/X11/" folder on the Guest OS.

II. "Rationale behind the process"

As it turns out, the VirtualBox Guest Additions has driver files for the X Server up to X 1.18 Ver(20) included natively. Oddly enough, these files should be included in the latest version of the Guest Additions for the latest stable release of the VirtualBox host client.

These driver files were available from an a repository by OpenIndiana for a open-source version of their own Solaris-based OS, that was still usable in RHEL-based Linux. Included are some links of reference and further support.

https://pkg.openindiana.org/hipster/manifest/0/x11%2Fserver%2Fxorg%2Fdriver%2Fxorg-video-vboxvideo%401.0.1%2C5.11-2018.0.0.1%3A20180212T053651Z
https://gist.github.com/yvt/a1fd215609c0f1e5a85c7562103f3e65
https://www.openindiana.org/2017/11/11/virtualbox-video-driver-compatible-with-xorg-1-19-5-available/

If you're on Xorg server 1.19.*, then either VBox guest additions 5.1.14 doesn't support Xorg 1.19, or it thinks no vboxvideo*.so is supposed to be needed with Xorg 1.19.*. Here's what I found ...

The 5.1.14 ISO created /opt/VBoxGuestAdditions-5.1.14/lib/VBoxGuestAdditions containing many vboxvideo_drv_*.so files (where '*' is a 2 or 3 digit number). Also, there are symlinks pointing to this directory from /lib/VBoxGuestAdditions, /lib64/VBoxGuestAdditions, /usr/lib/VBoxGuestAdditions, and /usr/lib64/VBoxGuestAdditions . There is an /opt/VBoxGuestAdditions-5.1.14/lib/VBoxGuestAdditions/vobxadd-x11 script, which only goes up to Xorg version 1.18.*, and the highest-number vboxvideo_drv file is vboxvideo_drv_118.so.

FYI, I have Xorg server 1.19.3, and it fails the same way as the OP's system.

22JUL2017: I tested using vboxvideo_drv_118.so with Xorg server 1.19.3. It reported loading vboxvideo, then failed with "(EE) vboxvideo: module ABI major version (20) doesn't match the server's version (23)" and unloaded vboxvideo. So VirtualBox 5.1.14 definitely does not provide a vboxvideo*.so that is compatible with Xorg 1.19.

I also found https://bugs.archlinux.org/task/52704 which talks about fbdev being supposed to be a fallback, but being recently broken by patches 3 & 4.

Could someone with the latest VBox check their vboxadd-x11 script, please?