https://xaccnus.github.io/Job-Scheduler/
Step 0. [init password]
Login your account in xacchead. run vncserver
, it will ask you to setup the password.
after setting your vnc’s password, kill the vncserver with the following command
vncserver -list
vncserver -kill :1 # assuming the vnc session is :1
Note: the number “:1” should be same with corresponding number that appeared when you start the vncserver
Step 1. [setup xserver]
Add or change “~/.vnc/xstartup” into the following code:
#!/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 &
This procedure only need to be done once.
Step 2. [enable port forwarding]
You need to exit current ssh session or connect with a new ssh session. Reconnect xacchead with port forwarding using the following command.
ssh -L 5901:localhost:5901 xxxxx@xacchead.d2.comp.nus.edu.sg
Note: you should carefully select the port/vnc session, since it will have conflicts with others. The port number corresponds to your vnc session number.
For example:
In the following example, we assums the vnc session is :1.
Step 3. [start vncserver]
From the server side, start vncserver:
vncserver :1
Step 4. [start vncviewer]
From your local machine, start vncviewer. The port is forwarded to your localhost.
Install the vncviewer on your local machine.
sudo apt install tigervnc-viewer # we suggest the tigervnc viewer.
Start vncviewer with localhost (port 5901 in this example) in command line.
vncviewer 127.0.0.1:5901
Please setup the configuration following your program instructions
In case you lock your VNC session, it may be stall in the login screen when you login next time. You can run the following command in your ssh session to unlock your VNC session.
loginctl unlock-session $(loginctl list-sessions | grep ${USER} | awk '{print $1}')