VNC
Be aware! Everyone with the VNC password will get access to your account
It is recommended not to use VNC. Use jupyterhub or screen or tmux instead. However, for GUI applications there is no other way.
The VNC (Virtual Network Computing) allows to view a graphical user interface (GUI) from a remote server in an viewer application. This can be used to launch GUI programs on the servers.
Xvnc is the Unix VNC server. Applications can display themselves on Xvnc as if it were a normal display, but they will appear on any connected VNC viewers rather than on a physical screen. The VNC protocol uses the TCP/IP ports 5900+N, where N is the display number.
Currently VNC is installed on: - SRVX8 [staff] - JET01 [staff] - AURORA [staff]
Userservices
It is highly recommended to use the userservices scripts available on all IMGW Servers to make configurations for VNC.
using the userservices | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
|
Running the script without any options will run all necessary steps. In case of error try removing your .vnc
directory, as older configurations might be in the way. There shall be at least two desktop options: icewm and xfce. You can specify this directly with the -w [DESKTOP]
option.
Setup - Manual
Please consider using the userservices vnc
script to do this setup.
First of all check if a VNC server is already running or not. Depending on the results you have two options:
- Use an existing. (Note the Port/Display Number)
- Stop all and start a new VNC server
- on Jet setup a service running your VNC Server.
Bash | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
Jet Cluser
on Jet there are the user services available to you:
Bash | |
---|---|
1 2 |
|
if you have never used this script or a vncserver
just running userservices vnc
will be enough for you to setup the VNC service. It will tell you which port you have been automatically assigned.
Connecting, setting the window manager
Use a VNC client (e.g. TigerVNC Viewer (All OS) or RealVNC VNC Viewer on Windows, or Remmina on any Linux distribution) and connect to srvx?.img.univie.ac.at:[DISPLAY]
.
Note: Since version 1.10 of tigerVNC it is possible to resize the windows directly
Connect with a viewer:
- Hostname:
srvx1.img.univie.ac.at
orjet01.img.univie.ac.at
- VNC Port:
vncserver -list
orsystemctl status --user vncserver.slice
- VNC passwort (
vncpasswd
allows to set this on the server)
The VNC server will automatically start a graphical window manager/desktop environment. Details are stored in .vnc/xstartup
. Your default configuration will load GNOME, and .vnc/xstartup
will be something like this:
Bash | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 |
|
It is recommended to use IceWM instead. This is a more lightweight alternative to GNOME. To switch to IceWM, first log out from GNOME and disconnect from your VNC viewer, then change your .vnc/xstartup
to this:
Bash | |
---|---|
1 2 3 4 5 6 7 |
|
Some information on what could be put into .Xresources
is given here. It might be possible to replace icewm
here with startxfce4
to choose XFCE Desktop environment.
VNC as a Service
This is only here for reference, on SRVX2 and Jet use the userservices vnc
.
Setup, replace [DISPLAY]
with an appropriate number, e.g. 3
:
Bash | |
---|---|
1 2 3 4 5 6 |
|
Finally stop/restart the VNC server.
Bash | |
---|---|
1 2 3 4 5 6 7 8 |
|
Monitor the status:
Bash | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
Change the resolution of your VNC Session
xrandr
gives you a list of available resolutions, that can be use. Requires a $DISPLAY
variable to be set, using your VNC display number does the trick, e.g. :3
.
Bash | |
---|---|
1 2 |
|
Change the resolution to e.g. 1920x1080 (HD):
Bash | |
---|---|
1 |
|
Adding resolutions according to your display's resolution have a look at
add_xrandr_resolution
Add a new monitor resolution to VNC | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
|
and run it like this:
Add a custom resolution to your virtual display | |
---|---|
1 2 |
|
Note: $DISPLAY
is an environment variable that is usually set to your VNC server port.
Created: October 14, 2021