Remote X11 Session with GPU

Linux: running remote X11 server with GPU access


There are times where it is convenient to have a remote X11 session with access to the remote GPU.  I have used this process for many things, including running a video game remotely (for testing purposes.)


Documenting this process here for me as much as anyone else who finds it useful.


Assumptions

  • root on local and remote boxes
  • running Xubuntu (not a requirement but you'll need to modify some of these steps)
  • latest VirtualGL is 2.6.3 and you are running 64-bit OS


Setup

On the remote server:

  1. Install VirtualGL
cd /tmp/ && curl -sL https://sourceforge.net/projects/virtualgl/files/2.6.3/virtualgl_2.6.3_amd64.deb/download > virtualgl_2.6.3_amd64.deb
sudo dpkg -i virtualgl_2.6.3_amd64.deb
sudo apt-get -f install
sudo apt-get install tigervnc-standalone-server
sudo service lightdm stop
sudo /opt/VirtualGL/bin/vglserver_config
## follow the prompts
sudoedit /usr/share/lightdm/lightdm.conf.d/50-xserver-command.conf
## add "+iglx" to "X -core" line
sudo reboot
  1. Test remote server setup
ssh    <remote server host/ip>
xauth merge /etc/opt/VirtualGL/vgl_xauth_key
xdpyinfo -display :0
/opt/VirtualGL/bin/glxinfo -display :0 -c

On the local box:

  1. Install vncviewer
sudo apt-get install tigervnc-viewer
Operation
On the local box:
  1. Connect and start the remote server
ssh -L 5998:127.0.0.1:5998        <remote server host/ip>
vncpaswd
screen
sudo xauth -f /var/run/lightdm/root/:0 list
vglrun Xvnc -geometry 3840x2160 -localhost -desktop RemoteServerName -NeverShared -SecurityTypes VncAuth -PasswordFile ~/.vnc/passwd :98
^Ac          ## screen command to create new screen window ##
export DISPLAY=:98
ssh-agent xfce4-session
  1. Run local VNC to view remote desktop
vncviewer localhost::5998

Comments

Popular posts from this blog

Xubuntu Home Server on Dell XPS 13 9370

Cygwin + syslog-ng

Installing Fedora 21 on a (late 2014) Mac Mini