When you use ssh with X forwarding, you might have noticed that you cannot execute programs that require 3D acceleration. That's where VirtualGL comes into play.
VirtualGL is an open source toolkit that gives any Unix or Linux remote display software the ability to run OpenGL applications with full 3D hardware acceleration.
With VirtualGL, the OpenGL commands and 3D data are instead redirected to a 3D graphics accelerator (AKA "graphics processing unit" or "GPU") in the application server, and only the rendered 3D images are sent to the client machine.
Download the following packages for the server:
Make sure you have installed the proprietary drivers for your graphics card (at least for Nvidia that I have tested this setup).
Install virtualgl on Ubuntu, by installing the deb file you already downloaded:
sudo dpkg -i virtualgl_*.deb
- Shutdown the display manager and configure virtualgl server:
# login as root # If you are using KDE, install lightdm (sudo apt-get install lightdm) # otherwise the following configuration steps do not work with SDDM (yet) service lightdm stop /opt/VirtualGL/bin/vglserver_config # Go through the questions until the configuration is done. sudo reboot # Sanity check for restricted access to 3D X Server xauth merge /etc/opt/VirtualGL/vgl_xauth_key xdpyinfo -display :0 /opt/VirtualGL/bin/glxinfo -display :0 -c # Check that the Graphic card is indeed used and not Mesa
- Install TurboVNC:
sudo dpkg -i turbovnc_*.deb
For the TurboVNC clients, you can find them at the same address
/opt/TurboVNC/bin/vncserveron the server. Possible options:
- -otp: enable One Time Password
- -geometry x: specify size of the window
- Connect using TurboVNC client (
/opt/TurboVNC/bin/vncviewer). (The screen will appear black but X is launched)
- In a terminal on the server
- export the DISPLAY variable to the value used by vncserver
export DISPLAY=:1 # if your vncserver started in DISPLAY :1
- Launch an X App (with vglrun to have 3D acceleration)
# Example command vglrun glxgears
To get a window manager up and running (in order to not have the black screen) do the following:
- With the command
vncserver -listfind the started vnc server. This command will give you an output that looks like this:
$ vncserver -list TurboVNC server sessions: X DISPLAY # PROCESS ID :1 8972
Kill the started VNC server with the command
vncserver -kill :1. Change the
X DISPLAYvalue returned by the
vncserver -listcommand earlier.
Make sure that the commands
xfce4-sessionexist in your system (if not install them), and append the following line at the end of the file
- Now start the vncserver again:
- With the command
Export PATH variables: