User Tools

Site Tools


vnc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
vnc [2018/03/12 15:35] – [See also] jansenvnc [2023/10/13 14:50] (current) jansen
Line 5: Line 5:
 ===== Configuration ===== ===== Configuration =====
  
-You don't have to configure much, but you can control what applications to run in yout VNC session. The startup script for VNC is **''~/.vnc/xstartup.''** +You don't have to configure much, but you can control what applications to run in yout VNC session. The startup script for VNC is **''~/.vnc/xstartup.''** (the directory ''.vnc'' will be created the first time you run a vnc session, or when you install one of our template configurations mentioned below, but if you want to create your own setup before starting a session, make sure to create the directory first)
 \\ \\
-Note: if you want to run KDE in your vnc session, this is the setup: +Note: if you want to run KDE Plasma in your vnc session, this is the setup: 
   #!/bin/sh   #!/bin/sh
   unset SESSION_MANAGER   unset SESSION_MANAGER
   vncconfig -iconic &   vncconfig -iconic &
-  startkde &+  startplasma-x11 &
  
 For Gnome, replace the last line with ''gnome-session''. Templates for the various desktops are available for installation. Run one of these commands to get the version of your liking: For Gnome, replace the last line with ''gnome-session''. Templates for the various desktops are available for installation. Run one of these commands to get the version of your liking:
Line 27: Line 27:
 ===== Starting a session ===== ===== Starting a session =====
 ---- ----
-A VNC session is started using the command **''vncserver -localhost''**. The first time you run this command, it will ask you for a password, as an additional security measure (this password can later be changed using the vncpasswd command, or by removing **''~/.vnc/passwd)''** +A VNC session is started using the command **''vncserver''**. The first time you run this command, it will ask you for a password, as an additional security measure (this password can later be changed using the vncpasswd command, or by removing **''~/.vnc/passwd)''** 
  
 Suppose your desktop is named **''eendracht.strw.leidenuniv.nl''** (so, replace this name with the name of your desktop wherever it is appropriate). The vncserver command will then print out a message like this: Suppose your desktop is named **''eendracht.strw.leidenuniv.nl''** (so, replace this name with the name of your desktop wherever it is appropriate). The vncserver command will then print out a message like this:
Line 49: Line 49:
 There is a graphical interface to start the viewer and set options, this is calles tsclient (or Terminal Service Client in the menu). This same program can also interface to Windows terminal services so make sure to select "VNC" as the protocol.  There is a graphical interface to start the viewer and set options, this is calles tsclient (or Terminal Service Client in the menu). This same program can also interface to Windows terminal services so make sure to select "VNC" as the protocol. 
  
-For accessing a VNC session running on another computer (either at the observatory, or somewhere else in the world), our Fedora desktop computers come with a list of VNC vieuwers to choose from:+For accessing a VNC session running on another computer (either at the observatory, or somewhere else in the world), our Fedora desktop computers come with a list of VNC viewers to choose from:
  
   * vncviewer: the basic commandline viewer (part of TigerVNC)   * vncviewer: the basic commandline viewer (part of TigerVNC)
Line 57: Line 57:
 There are of course also VNC viewers for other operating systems, eg MacOS and Windows: There are of course also VNC viewers for other operating systems, eg MacOS and Windows:
   * Mac OS X has a built-in VNC viewer, named ''Screen Sharing'' from Finder, in the ''Go'' menu, ''Connect to server''   * Mac OS X has a built-in VNC viewer, named ''Screen Sharing'' from Finder, in the ''Go'' menu, ''Connect to server''
 +  * [[https://www.realvnc.com/en/connect/download/viewer/|RealVNC VNC Connect]] viewer for almost any OS
   * [[http://sourceforge.net/projects/chicken/|Chicken, VNC viewer for Mac]]   * [[http://sourceforge.net/projects/chicken/|Chicken, VNC viewer for Mac]]
   * WinVNC   * WinVNC
Line 64: Line 65:
  
 ---- ----
-You cannot directly connect to a vncserver from outside the institute, since VNC itself is only minimally encrypted, and not secure enough to be exposed to the net. The solution is then to combine VNC with a SSH tunnel. +You cannot directly connect to a vncserver from outside the institute, since VNC itself is only minimally encrypted, and not secure enough to be exposed to the net. The solution is then to combine VNC with a SSH tunnel. And since many of our servers and compute nodes and clusters are not directly reachable from outside, you may need to set up a ssh ProxyJump (see [[ssh:tipsandtricks|SSH tips and tricks]]).
  
 Now we could try to describe how to set up such a tunnel, but the mechanism is know to vncviewer, so usually it is as easy as adding ''-via'' and a hostname to handle the ssh setup. Now, since all our Linux computers are reachable through ssh, it is usually best to use the same computer for ssh that is running your vnc session. The command to start the viewer will then be:  Now we could try to describe how to set up such a tunnel, but the mechanism is know to vncviewer, so usually it is as easy as adding ''-via'' and a hostname to handle the ssh setup. Now, since all our Linux computers are reachable through ssh, it is usually best to use the same computer for ssh that is running your vnc session. The command to start the viewer will then be: 
Line 84: Line 85:
 The other important thing to know is, what a tunnel actually does: it creates an encrypted connection between a local ''port'' on your computer, to a port on the remote computer. Once that is done, you want to point your VNC client to the **local** port, and let SSH takes care of the rest. The other important thing to know is, what a tunnel actually does: it creates an encrypted connection between a local ''port'' on your computer, to a port on the remote computer. Once that is done, you want to point your VNC client to the **local** port, and let SSH takes care of the rest.
  
-Example for commandline ssh on Mac OS X or Linux: +Example for commandline ssh on Mac OS X or Linux, in the example where your vnc runs on a computer called eendracht, and you have to connect through the ssh gateway ssh.strw.leidenuniv.nl (and your vnc is on :1 so the port is 5901)
-  ssh -NfL 5901:127.0.0.1:5901 user@remote.host.domain +  ssh -NfL 5901:eendracht:5901 username@ssh.strw.leidenuniv.nl  
-This forwards local port 5901 to port 5901 on the remote computer+This forwards local port 5901 to port 5901 on the remote computer. So now you can connect locally with: 
 +  vncviewer :1 
 + 
 +==== Setting up port forwarding through a graphical user interface ==== 
 +If you would like to configure port forwarding through a gui, good choices are: ''putty'' for Windows and Linux, ''bitvise'' for Windows; or ''ssh tunnel manager'' for Mac OS X
  
  
vnc.1520868950.txt.gz · Last modified: 2018/03/12 15:35 by jansen