Spot CORE VNC
VNC allows users to launch and interact with graphical applications on remote machines.
This document details how to setup TigerVNC on the Spot CORE. We will also use the GNOME desktop environment, port forwarding, and systemd .service files in the content below.
Spot CORE now comes preconfigured with TigerVNC. The following sections outline the steps necessary for enabling the service before use.
TigerVNC Server Enable
First, access a terminal on the Spot CORE. To do this, you can either log in to Cockpit at https://192.168.80.3:21443 and go to the Terminal tab, or you can connect through the command line:
ssh -p 20022 firstname.lastname@example.org
Create a VNC password
A default password “password” will be created for you. This password is used to access the VNC session from a client, after which you need to log in with the standard username and password for the Spot CORE. You may also choose to create a new VNC password with the following command (a view-only password is not required):
Enable and start the service on the desired port.
sudo systemctl enable vncserver@15100 # Enable service with the desired port. sudo systemctl start vncserver@15100 # Start service. systemctl status vncserver@15100 # Check the service is running.
In the example commands above, the vncserver port number used is 21000 (5900 + 15100). See start vncserver for more information.
Perform the following steps on the PC to start the VNC connection.
Install vncviewer for 64-bit Windows by downloading
vncviewer64-1.10.1.exe from https://bintray.com/tigervnc/stable/tigervnc/.
Install tigervnc-viewer on Ubuntu using apt:
sudo apt install tigervnc-viewer
We need to create a secure connection using an SSH tunnel first. The below command assumes the user is connected to Spot’s access point. Don’t forget to change the ip address or port number if required. To run this ssh session in the background without executing any commands, add
-fN arguments to the end of the command.
ssh -4 -p 20022 email@example.com -L 21000:127.0.0.1:21000
Start VNC Viewer and pass the IP address and port number.
After entering the password set using
vncpasswd earlier, a GNOME desktop environment should now be available.
TigerVNC Server Installation
This section is not required if the Spot CORE is on any software version greater than or equal to 2.3.0.
Install software required for the TigerVNC server on the Spot CORE using apt:
sudo apt install tigervnc-standalone-server tigervnc-common tigervnc-xorg-extension tigervnc-viewer
If the user has not setup a VNC password, please see the earlier instructions on how to create a vnc password.
To configure the GNOME desktop, create a xstartup file in
~/.vnc/xstartup and add the following contents.
#!/bin/sh [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources vncconfig -iconic & dbus-launch --exit-with-session gnome-session &
To enable permissions for remote sessions (such as VNC) to edit certain system settings, create the following files in
[Let user spot modify system settings for network] Identity=unix-user:spot Action=org.freedesktop.NetworkManager.* ResultAny=auth_admin_keep ResultInactive=no ResultActive=yes
[control center administration] Identity=unix-user:* Action=org.gnome.controlcenter.* ResultAny=auth_admin_keep ResultInactive=no ResultActive=yes
TigerVNC listens to ports 5900+. The default port is 5901 (5900 + 1), which can be started using the following command.
In order to specify a different port, such as 21000, run vncserver with the number equal to 21000 - 5900 = 15100.
-list to see the previously started vnc servers.
Use the below command to stop the previously started vnc servers.
vncserver -kill :1 vncserver -kill :15100
Enable vncserver on boot
In order for vncserver to automatically run on Spot CORE whenever Spot is turned on, use a systemd .service file. Create a service file named
vncserver@.service and add the following contents. This file can take a port number as an argument.
[Unit] Description=TigerVNC server After=network.target [Service] Type=simple RemainAfterExit=yes SuccessExitStatus=0 PIDFile=/home/spot/.vnc/%H:%i.pid ExecStartPre=/bin/su -l spot -c "/usr/bin/vncserver -kill :%i > /dev/null" ExecStart=/bin/su -l spot -c "/usr/bin/vncserver :%i -localhost no" ExecStop=/bin/su -l spot -c "/usr/bin/vncserver -kill :%i" [Install] WantedBy=multi-user.target
Copy the file to /etc/systemd/system/ and start the service. Change the port number as desired.
sudo cp vncserver@.service /etc/systemd/system/ sudo systemctl daemon-reload # Reloads all systemd services.