Skip to content

Instantly share code, notes, and snippets.

@lukicdarkoo
Last active June 8, 2025 09:47
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://github.com/VirtualGL/virtualgl/releases/download/3.1.3/virtualgl_3.1.3_amd64.deb -O /tmp/virtualgl.deb
sudo apt install /tmp/virtualgl.deb

# Install TurboVNC
wget https://github.com/TurboVNC/turbovnc/releases/download/3.2/turbovnc_3.2_amd64.deb -O /tmp/turbovnc.deb
sudo apt install /tmp/turbovnc.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

Also:

sudo nano /etc/default/grub
# Append to GRUB_CMDLINE_LINUX_DEFAULT:
# GRUB_CMDLINE_LINUX_DEFAULT="quiet splash nvidia-drm.modeset=1"

sudo update-grub
sudo reboot

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