Skip to content

Instantly share code, notes, and snippets.

@lukicdarkoo
Last active July 26, 2023 20:19
Show Gist options
  • Save lukicdarkoo/c07e961d783aff0cac1634bb0d2f2d48 to your computer and use it in GitHub Desktop.
Save lukicdarkoo/c07e961d783aff0cac1634bb0d2f2d48 to your computer and use it in GitHub Desktop.
VNC with NVIDIA acceleration (without display)

Server Configuration

Install VirtualGL and TurboVNC

# Install VirtualGL
wget https://nav.dl.sourceforge.net/project/virtualgl/3.1/virtualgl_3.1_amd64.deb
sudo apt install ./virtualgl_3.1_amd64.deb

# Install TurboVNC
wget https://deac-ams.dl.sourceforge.net/project/turbovnc/3.0.3/turbovnc_3.0.3_amd64.deb
sudo apt install ./turbovnc_3.0.3_amd64.deb

You can also check for newer versions of VirtualGL and TurboVNC

Configure Xorg

sudo nvidia-xconfig -a --allow-empty-initial-configuration --use-display-device=None --virtual=1920x1200
# sudo nvidia-xconfig -a --use-display-device=None --virtual=1280x1024

Add AllowEmptyInitialConfiguration option to /etc/X11/xorg.conf:

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    Option         "AllowEmptyInitialConfiguration" "True" # <-- This line is new
    EndSubSection
EndSection

Configure VirtualGL

sudo systemctl stop gdm

/opt/VirtualGL/bin/vglserver_config
# Pick option 1) and say `n` to everything

sudo reboot

# Verify the VirtualGL configuration 
xdpyinfo -display :0
/opt/VirtualGL/bin/glxinfo -display :0 -c

Configure xfce

sudo apt install xfce4
echo "vglrun startxfce4" >> ~/.vnc/xstartup.turbovnc

Start TurboVNC

/opt/TurboVNC/bin/vncserver

Client Configuration

Install TurboVNC

wget https://deac-ams.dl.sourceforge.net/project/turbovnc/3.0.3/turbovnc_3.0.3_amd64.deb
sudo apt install ./turbovnc_3.0.3_amd64.deb

Start TurboVNC

/opt/TurboVNC/bin/vncviewer

type

pcname.local:5901

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment