Difference between revisions of "VNC"
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | VNC gives users a remote desktop Graphical User Interface | + | [https://en.wikipedia.org/wiki/Virtual_Network_Computing VNC] gives users a remote desktop Graphical User Interface. |
− | + | == Connection Mechanism == | |
+ | Our cpu1 server runs tigerVNC, this allows users to start server instances with a shell command `vncserver`. Users need a [[VNC viewer]] to connect to a VNC server instance. | ||
+ | [[File:Capture.png|thumb|UltraVNC connection showing a user desktop]] | ||
+ | |||
+ | == Step 0: Configure password (First time only) == | ||
+ | Connect via SSH and ensure you have setup a VNC password: `vncpasswd`. This should create the hidden folder `~/.vnc` if it didn't already exist. Copy `/home/utils/vncstuff/xstartup` to `~/.vnc` to get a working configuration for a desktop environment(xfce). This step may already have been done for you by an admin, in which case your vnc password equals your user name. | ||
+ | |||
+ | == Step 1: Start a remote vncserver instance == | ||
+ | A user must first start a running vnserver process and connect to it: `vncserver` will start an instance with default settings. You can see your running instances with `vncserver -list`. | ||
+ | |||
+ | A more specific example: `vncserver -name <sessionname> :<N>` where <N> is an integer. E.g. `vncserver -name bobsvnc :23` will create a session at display number 23, which means they have to connect to port 5923. The port formula is 5900+N. Ports occupied by others are not available, so if 23 was taken in the previous example it would have tried 24, etc. | ||
+ | |||
+ | == Step 2: Establish an SSH tunnel == | ||
+ | SSH port forwarding is the canonical solution in case the firewalls prevent direct connection to the vncserver:port. See [[SSH/SFTP|shell access]] for details. The current firewalls '''do not allow direct access''' on the VNC ports, so this step is necessary. | ||
+ | |||
+ | If you've ever use [[X11|X forwarding]] before, that's the same concept. | ||
+ | |||
+ | == Step 3: Connect with your VNC viewer == | ||
+ | * Open the viewer and connect to localhost:<port>, where <port> depends on your tunnel configuration. E.g. You setup a vncserver on 5908, then with a tunnel mapping port 5900 to remote:5908, your VNC viewer would connect to localhost:5900. You'll be prompted for your vnc password to continue. | ||
{{Note| To minimize bandwidth and cpu usage, do not use too many sessions, kill redundant sessions with `vncserver -kill`, and don't use uncompressed high quality video settings|warn}} | {{Note| To minimize bandwidth and cpu usage, do not use too many sessions, kill redundant sessions with `vncserver -kill`, and don't use uncompressed high quality video settings|warn}} | ||
− | + | ||
− | + | {{Note| In case the remote desktop reports errors upon first (successful) login, this seems to be a bug related to xfce and/or anaconda. Try deactivating conda default environment or modifying your PATH variable.}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | {{Note| In case the remote desktop reports errors upon first (successful) login |
Latest revision as of 19:36, 6 June 2020
VNC gives users a remote desktop Graphical User Interface.
Contents
Connection Mechanism
Our cpu1 server runs tigerVNC, this allows users to start server instances with a shell command vncserver
. Users need a VNC viewer to connect to a VNC server instance.
Step 0: Configure password (First time only)
Connect via SSH and ensure you have setup a VNC password: vncpasswd
. This should create the hidden folder ~/.vnc
if it didn't already exist. Copy /home/utils/vncstuff/xstartup
to ~/.vnc
to get a working configuration for a desktop environment(xfce). This step may already have been done for you by an admin, in which case your vnc password equals your user name.
Step 1: Start a remote vncserver instance
A user must first start a running vnserver process and connect to it: vncserver
will start an instance with default settings. You can see your running instances with vncserver -list
.
A more specific example: vncserver -name <sessionname> :<N>
where <N> is an integer. E.g. vncserver -name bobsvnc :23
will create a session at display number 23, which means they have to connect to port 5923. The port formula is 5900+N. Ports occupied by others are not available, so if 23 was taken in the previous example it would have tried 24, etc.
Step 2: Establish an SSH tunnel
SSH port forwarding is the canonical solution in case the firewalls prevent direct connection to the vncserver:port. See shell access for details. The current firewalls do not allow direct access on the VNC ports, so this step is necessary.
If you've ever use X forwarding before, that's the same concept.
Step 3: Connect with your VNC viewer
- Open the viewer and connect to localhost:<port>, where <port> depends on your tunnel configuration. E.g. You setup a vncserver on 5908, then with a tunnel mapping port 5900 to remote:5908, your VNC viewer would connect to localhost:5900. You'll be prompted for your vnc password to continue.
vncserver -kill
, and don't use uncompressed high quality video settings