Differences between revisions 63 and 64
Revision 63 as of 2019-11-20 12:13:53
Size: 7732
Editor: bonaccos
Comment:
Revision 64 as of 2019-11-21 14:01:19
Size: 7994
Editor: gfreudig
Comment:
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:
Creating startup_file /home/pmuster/.vnc/xstartup.xfce..... Creating startup_file /home/pmuster/.vnc/xstartup.....
Line 31: Line 31:
New 'xfce' desktop is zampano:1 New 'default' desktop is zampano:1
Line 34: Line 34:
Starting applications specified in /home/pmuster/.vnc/xstartup.xfce Starting applications specified in /home/pmuster/.vnc/xstartup
Line 43: Line 43:
pmuster@zampano:~$ cat .vnc/xstartup.xfce pmuster@zampano:~$ cat .vnc/xstartup
Line 59: Line 59:
You can use You can use an optional desktop selection parameter
Line 61: Line 61:
vncserver [xfce|gnome|kde|special|xterm] vncserver [xfce|gnome|kde|light|xterm]
Line 63: Line 63:
at startup to use a different desktop session. If no specific desktop session is given then `/etc/X11/Xsession` which defaults to the '''Xfce4''' desktop will be used. The desktop type special selects the light desktop '''Fluxbox'''. To use a desktop outside from Xfce4, GNOME, KDE and Fluxbox please use `vncserver special` and edit the your `xstartup.special` file in `~/.vnc` according to your needs. The desktop type '''xterm''' starts a minimal desktop with a window manager and a `xterm` terminal window, here the applications must be started over the command line in the `xterm`. at startup to use a different desktop session. If no specific desktop session is given then `/etc/X11/Xsession` which defaults to the '''Xfce4''' desktop will be used. The desktop type '''light''' selects the light desktop '''Fluxbox'''. To use a desktop outside from Xfce4, GNOME, KDE, Fluxbox and Xterm please edit the your `xstartup` file in `~/.vnc` according to your needs. The desktop type '''xterm''' starts a minimal desktop with a window manager and a `xterm` terminal window, here the applications must be started over the command line in the `xterm`.<<BR>><<BR>>
The start of vncserver with no desktop parameter always looks for the xsession startup file '''~/.vnc/xstartup''' in your home, if not found it's created with a desktop startup of the default xsession ( /etc/X11/Xsession ) which points to '''Xfce4'''.
Line 65: Line 66:
If you are using `vncserver` only for remote accessing some applications on the target machine please use a light desktop like Xfce or the xterm variant, but not the extremely heavyweight desktops GNOME or KDE. For "'''Work at home'''" you can use the heavyweight desktops (p.e. the default GNOME) but please logout from your computer in the office before you go home. We do not support the parallel usage of two heavyweight desktops (local and remote) from the same user on one machine. If you are using `vncserver` only for remote accessing some applications on the target machine please use the desktop type '''light''' or '''xterm''' but not the extremely heavyweight desktops GNOME or KDE. For "'''Work at home'''" you can use the heavyweight desktops (p.e. the default GNOME) but please logout from your computer in the office before you go home. We do not support the parallel usage of two heavyweight desktops (local and remote) from the same user on one machine.
Line 67: Line 68:
For the GNOME desktop we use the TurboVNC software, all other desktops are provided by the TigerVNC software. TurboVNC's config file is `~/.vnc/config.turbo` while TigerVNC uses `~/.vnc/config`. To switch the configured '''default resolution''' of 1600x950 of the `vncserver` created display please comment out the '''geometry''' line in the configuration file and correct the resolution tp your need. For the GNOME desktop we use the TurboVNC software, all other desktops are provided by the TigerVNC software. TurboVNC's config file is `~/.vnc/config.turbo` while TigerVNC uses `~/.vnc/config`. To switch the configured '''default resolution''' of 1600x950 of the `vncserver` created display please comment out the '''geometry''' line in the configuration file and correct the resolution to your need.

What is VNC?

VNC (Virtual Network Computing) is a remote desktop software for several Operating Systems. It can be used for a single graphical application or for a full desktop session. Client and server interact over the Remote Framebuffer (RFB) Protocol. Technically the VNC server process on the target machine is an X-server with a virtual display attached to it. The VNC viewer on the client shows the content of this virtual display in his own window and transfers keyboard and mouse events to the VNC server.

How do I use VNC?

Starting the vncserver

The following instructions refer to the start of the VNC server via an ISG.EE provided wrapper script vncserver in /usr/bin_override. You can check the correct path to this wrapper script with:

pmuster@zampano:~$ which vncserver
/usr/bin_override/vncserver
pmuster@zampano:~$

Login via ssh to the target machine and start vncserver. If you had never used vncserver before the startup of the vncserver process looks like this:

pmuster@zampano:~$ vncserver
Creating directory /home/pmuster/.vnc......
Creating startup_file /home/pmuster/.vnc/xstartup.....

You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n

New 'default' desktop is zampano:1

Creating default config /home/pmuster/.vnc/config
Starting applications specified in /home/pmuster/.vnc/xstartup
Log file is /home/pmuster/.vnc/zampano:1.log

pmuster@zampano:~$

In the output of the command the number after the colon of the hostname (zampano:1) is the virtual display number of your VNC server. You need this number to connect your VNC viewer to the correct listening port of your VNC server and also to manually kill the vcnserver process.

If the .vnc subdirectory in your home does not exist it is created at startup and you will be asked to define a password for accessing your server and another one for just observing without interacting. Also created is a default xstartup script which is executed by the vncserver:

pmuster@zampano:~$ cat .vnc/xstartup
#!/bin/sh
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
unset DBUS_SESSION_BUS_ADDRESS
xsetroot -solid grey
export XKL_XMODMAP_DISABLE=1
WRAPPERDIR="/usr/bin_override"
#
/etc/X11/Xsession
#---------------------------------------------------------------------------------------------------------
# Automatically end the server process after desktop session logout
#---------------------------------------------------------------------------------------------------------
$WRAPPERDIR/vncserver -kill $DISPLAY
#
pmuster@zampano:~$

You can use an optional desktop selection parameter

vncserver [xfce|gnome|kde|light|xterm]

at startup to use a different desktop session. If no specific desktop session is given then /etc/X11/Xsession which defaults to the Xfce4 desktop will be used. The desktop type light selects the light desktop Fluxbox. To use a desktop outside from Xfce4, GNOME, KDE, Fluxbox and Xterm please edit the your xstartup file in ~/.vnc according to your needs. The desktop type xterm starts a minimal desktop with a window manager and a xterm terminal window, here the applications must be started over the command line in the xterm.

The start of vncserver with no desktop parameter always looks for the xsession startup file ~/.vnc/xstartup in your home, if not found it's created with a desktop startup of the default xsession ( /etc/X11/Xsession ) which points to Xfce4.

If you are using vncserver only for remote accessing some applications on the target machine please use the desktop type light or xterm but not the extremely heavyweight desktops GNOME or KDE. For "Work at home" you can use the heavyweight desktops (p.e. the default GNOME) but please logout from your computer in the office before you go home. We do not support the parallel usage of two heavyweight desktops (local and remote) from the same user on one machine.

For the GNOME desktop we use the TurboVNC software, all other desktops are provided by the TigerVNC software. TurboVNC's config file is ~/.vnc/config.turbo while TigerVNC uses ~/.vnc/config. To switch the configured default resolution of 1600x950 of the vncserver created display please comment out the geometry line in the configuration file and correct the resolution to your need.

Connecting the vncviewer

After the startup you can connect a VNC viewer software on your client to your VNC server. On our managed linux clients the command is:

> vncviewer zampano:1

On our managed windows clients we can install the baramundi software RealVNC for you. In the connect-popup window you have to enter the base tcp port number 5900 plus the display number:

  • zampano5901.PNG

RealVNC Viewer is free software and can be downloaded from https://www.realvnc.com .

Terminating a VNC session

As already mentioned above if you are performing a normal desktop logout in the VNC client your VNC server process is killed automatically by the vncserver -kill command after the termination of the desktop session in your xstartup script and you need to start a new one for the next session. If you only terminate the VNC viewer program your VNC server process remains active and you can reconnect your desktop session again.

To manually kill your vncserver on a host ssh to this host and enter the command:

> vncserver -kill :<display number>

VNC access from the internet

Due to security reasons the listening port of the VNC server is not directly reachable from a client in the internet. There are two possibilities to perform a vnc session to an ETH network internal host from the internet:

  • Use the Cisco SSL-VPN client software of ID and connect the SSL-VPN adapter before starting the VNC viewer programm
  • Access the VNC server through an SSH-tunnel

VNC through SSH tunnel under Linux

  1. Start VNC Server on remote host with the option -localhost
      $ ssh <remoteHost>                          // where <remoteHost> is the machine on which the application you want to start runs
      $ vncserver :<display#> -localhost          // where <display#> is a number between 1 and 99

    Attention! Always choose a strong password when starting vncserver. Otherwise, you'll make it trivial for intruders to hijack your account!

  2. Start VNC viewer on your machine (Linux)
      $ vncviewer -via <remotehost>.ee.ethz.ch localhost:<display#>
    Mac users may establish the tunnel via SSH, then use "open vnc://localhost:PORT" to use the built-in VNC client.

VNC through SSH tunnel under Windows

  1. Start VNC viewer on your machine (Windows with TightVNC and putty).
    • Putty is the most popular free ssh client software on Windows. When you have configured a normal ssh session to the vnc server machine you can configure additional port forwards on the established ssh-connection. A tunnel configuration needs a local listening port and a destination on ssh server side.The destination could be localhost or another machine reachable by the ssh server machine. The following screeshots show how to configure an additional tunnel for connecting the local vnc-server on port 5901 of the ssh server machine:

      vnc1.jpg
      After clicking the "Add"-Button the putty window changes to:
      vnc2.jpg
      Don't forget to save the session if you want this tunnel to be permanently configured in this session.

  2. Now you can connect your vnc viewer programm to the configured listening port of the putty client on the client machine:
    • vnc3.jpg


CategoryLXCL