Skip to content

Instantly share code, notes, and snippets.

@bresilla
Forked from Ryther/turbovnc_install.md
Created February 14, 2025 12:38
Show Gist options
  • Save bresilla/620fc011a4992b93f0b2eecbe905fdeb to your computer and use it in GitHub Desktop.
Save bresilla/620fc011a4992b93f0b2eecbe905fdeb to your computer and use it in GitHub Desktop.
TurboVNC installation [Ubuntu 22.04]

I've tested this gist with this setup:

  • Odroid N2
  • Armbian 24.2.1 Jammy CLI
  • Ubuntu Desktop

Useful links:

The workflow:

  1. Go to https://turbovnc.org/Downloads/YUM and follow the instructions in the APT section to install TurboVNC:

    • Prepare to install TurboVNC (run as root):
      wget -q -O- "https://packagecloud.io/dcommander/turbovnc/gpgkey" | gpg --dearmor > "/etc/apt/trusted.gpg.d/TurboVNC.gpg"
      wget -q -O "/etc/apt/sources.list.d/TurboVNC.list" "https://raw.githubusercontent.com/TurboVNC/repo/main/TurboVNC.list"
    • Optional if you need OpenGL (run as root):
      • Prepare to install libjpeg:
        wget -q -O- https://packagecloud.io/dcommander/libjpeg-turbo/gpgkey | gpg --dearmor >/etc/apt/trusted.gpg.d/libjpeg-turbo.gpg
        wget -q -O "/etc/apt/sources.list.d/libjpeg-turbo.list" "https://raw.githubusercontent.com/libjpeg-turbo/repo/main/libjpeg-turbo.list"
      • Prepare to install VirtualGL (run as root):
        wget -q -O- https://packagecloud.io/dcommander/virtualgl/gpgkey | gpg --dearmor >/etc/apt/trusted.gpg.d/VirtualGL.gpg
        wget -q -O "/etc/apt/sources.list.d/VirtualGL.list" "https://raw.githubusercontent.com/VirtualGL/repo/main/VirtualGL.list"
    • Install TurboVNC:
      sudo apt update
      sudo apt install -y turbovnc
    • Install TurboVNC and VirtualGL:
      sudo apt update
      sudo apt install -y turbovnc virtualgl libjpeg-turbo-official
  2. [EXPERIMENTAL]

    • Run sudo vim /etc/X11/xorg.conf.d/10-vnc.conf and insert:

      Section "Module"
      Load "vnc"
      EndSection
      
      Section "Screen"
      Identifier "Screen0"
      Option "UserPasswdVerifier" "VncAuth"
      Option "PasswordFile" "<home_path>/.vnc/passwd"
      EndSection
      
    • Change <home_path> with your own home path

    • This section is experimental and needs verification

  3. Create the password for the user:

     $ /opt/TurboVNC/bin/vncpasswd
    
  4. Start a server the first time, as user:

     $ /opt/TurboVNC/bin/vncserver
    
    • An instance on screen :1 should start without problem
  5. Kill the newly created server:

     $ /opt/TurboVNC/bin/vncserver -kill :1
    
  6. Setup the server to start at boot:

    • Modify /etc/sysconfig/tvncservers:

        $ sudo vim /etc/sysconfig/tvncservers
      

      Uncomment the last two lines (or just the VNCSERVERS and manage the configurations in ~/.vnc/turbovncserver.conf):

        VNCSERVERS="1:<username>"
        VNCSERVERARGS[1]="-geometry 1920x1080"
      

      Change <username> with your own and change the args as preferred

    • Reboot and start the systemd service and enable it:

        $ sudo systemctl start tvncserver
        $ sudo systemctl enable tvncserver
      
    • Check if the service started correctly:

        $ sudo systemctl status tvncserver
      
  7. Desktop environment can be set, with other parameters, insdie ~/.vnc/turbovncserver.conf

         $wm = plasma
         $geometry = 1920x1080
    
    • The value of $wm can be found in /usr/share/xsessions, it's the name of the file without .desktop; in the case of the KDE Plasma DE, the file found is plasma.desktop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment