Resolved an issue with opening 3D applications in a remote Ubuntu server environment using VNC, by utilizing Turbo VNC which supports 3D acceleration.
I used a MacBook to proceed below.
Encountered an Open 3D error when using SLAM architecture remotely via VNC with a laboratory server. Previously, the server was accessed through tightvncserver
and interacted with via tiger VNC
or Real VNC
for GUI operations. This setup functioned well until the following error occurred, indicating a problem with 3D acceleration in the VNC environment:
[Open3D WARNING] GLFW Error: GLX: GLX extension not found
[OpenD WARNING] Failed to create window
This post aims to help those encountering the same issue and struggling to find a solution, as I have spent considerable time with few resolutions and no clear written workarounds. The following solution may not be perfect and might include unintentional steps, but it serves as a good workaround.
Step 0: Verify that there are no issues when entering the following command on the server Ubuntu. Access VNC and type the following
$ glxinfo
$ vglrun
If you get an error when entering a command, do the following It may not work because there is no screen when running with Ssh. If it doesn't work when running with vnc, there is a problem.
$ wget https://github.com/VirtualGL/virtualgl/releases/download/3.1.1/virtualgl_3.1.1_amd64.deb
$ sudo dpkg -i virtualgl_3.1.1_amd64.deb
$ export DISPLAY=:1
$ export VGL_DISPLAY=:1
$ echo $DISPLAY
$ echo $VGL_DISPLAY
!!! If that doesn't work, try the entire process from step 1, then try step 0 again in a VNC environment. !!
Connect to the server using SSH through Visual Code and execute:
$ sudo apt update
$ sudo apt install tightvncserver
Execute the following command to setup the VNC server:
$ tightvncserver
During the first execution, set a password for the VNC server. A new VNC display will be created for each client connection. The default port is 5900. Choose 'n'
Next, configure the VNC session:
$ vi ~/.vnc/xstartup
Insert the following script:
#!/bin/sh
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &
autocutsel -fork &
Download and install Turbo VNC on the Ubuntu server:
$ wget https://github.com/TurboVNC/turbovnc/releases/download/3.1.1/turbovnc_3.1.1_amd64.deb
$ sudo dpkg -i turbovnc_3.1.1_amd64.deb
Install Turbo VNC on your local machine as well. For macOS, use Homebrew:
To start the Turbo VNC server with specific geometry and port, use:
$ /opt/TurboVNC/bin/vncserver :1 -geometry 1920x1080 -rfbport 5901
Adjust the -geometry
and -rfbport
options as needed.
Allow traffic through the chosen port:
$ sudo ufw allow 5901/tcp
Launch Turbo VNC on your computer and connect using your server's IP address and port.
$ export DISPLAY=:1
$ echo $DISPLAY
$ export VGL_DISPLAY=:1
$ echo $VGL_DISPLAY
Example of successful connection: