Skip to content

Instantly share code, notes, and snippets.

@rejunity
Last active November 18, 2022 02:22
Show Gist options
  • Save rejunity/48859aa3e922bccbf0b97e382057df49 to your computer and use it in GitHub Desktop.
Save rejunity/48859aa3e922bccbf0b97e382057df49 to your computer and use it in GitHub Desktop.
How to run Unity standalone application "offscreen" on Linux
# Recipe on running Unity (or any OpenGL based application) offscreen on your local Linux machine.
# Requirement: X server, NVIDIA drivers installed and working correctly.
# Tested on Ubuntu14.04.
# Summary: install XDummy and VirtualGL, configure virtual framebuffer, run your application via VirtualGL
# install XDummy
sudo apt-get update
sudo apt-get install xorg-video-abi-15 xserver-xorg-video-dummy
# download default configuration file for XDummy
wget http://xpra.org/xorg.conf .
# install VirtualGL to forward calls from virtual framebuffer device to actual GPU
wget https://downloads.sourceforge.net/project/virtualgl/2.5.1/virtualgl_2.5.1_amd64.deb .
sudo dpkg -i virtualgl_2.5.1_amd64.deb
# run virtual framebuffer and assign it to a display that is not in use already, say display 10
Xorg -noreset +extension GLX +extension RENDER -logfile ./10.log -config ./xorg.conf :10
# run Unity standalone on display 10 and via VirtualGL
DISPLAY=:10 vglrun $your_unity_exec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment