What is the easiest way to make ubuntu boot on both native computer with NVIDIA card installed and as a VMware guest. After installing nvidia-304
driver package I can't load it in VMware. It stuck in login loop with this error in .xsession-errors
:
Xlib: extension "GLX" missing on display ":0".
The only relevant answer I found is this but it doesn't work for me. There is no switchlibglx
in NVIDIA drivers.
EDIT: My investigation results. NVIDIA spoilt the system with their OpenGL module through the symbolic link in system directory libglx.so
. Their module can only work with NVIDIA driver which is not loaded if you start the system with a different video adapter obviously. There is no default and easy way to choose which OpenGL module to use depending on the driver loaded. It's a classic unix logic. In any difficult situation don't bother to invent API and options, just overwrite the default symbolic link in global directory and let a user deal with this mess. NVIDIA just use the standard crutch to install their driver and module. There are three possible workaround:
1) install and uninstall nvidia drivers every time you use it in VMware
2) make a complicated config file that run a script and overwrite symbolic links during boot depending on the adapter present (See the answer below)
3) somehow disable the use of GLX extensions in X server to load it in VMware
Best Answer
You are having this problem because your X configuration is trying to load the nvidia driver which is then looking for a compatible nvidia device. Such a device does not exist in the guest environment instead a VMware virtual graphics device is presented instead and thus the nvidia driver is not the correct driver in the guest OS.
The correct driver for the vmware virtual graphics interface is the one provided by the xserver-xorg-video-vmware package not the ones provided by the nvidia-* packages which are only suitable for direct access to the GPU. You can install the correct driver using the following command on the guest:
Also make sure that 3D acceleration is enabled on the virtual machine configuration and that you have installed the vmware guest additions correctly. You should also make sure that you don't have an xorg.conf file which is explicitly selecting the nvidia driver since this will fail.
If you wanted a script you could set to run at boot time before lightdm is started you could try something like this:
The script checks which vendor identifier is detected for the graphics card, if nvidia it will configure ld to use the nvidia provided opengl libraries however if the vmware device is detected it will configure for mesa, mesa being the default if neither vendor string is recognised.
A number of assumptions are being made here the script wont work correctly if these are not the case:
I do not however have vmware installed so I am only able to test and be sure that it works correctly when the nvidia device is detected and the ubuntu provided nvidia drivers are installed.