VNC Server usage with Indapps¶
Sinumerik EDGE platform is capabable of enabling VNC server access for industrial applications for those have X11 based graphical outputs. Industrial applications can opt for VNC server usage and render their graphical outputs on platform managed VNC server. VNC clients can access VNC server and interact with their applcations from the machine network interface of their devices.
Enable VNC Server access for Indapps¶
Please refer to VNC Server Usage to enable VNC server access for industrial applications.
Using VNC server from Indapps¶
Containers of industrial applications with VNC server access are automatically given access of
/tmp/.X11-unix/X1
and /etc/xorg/config/Xauthcookie
files. These files are for VNC server socket
communication and VNC server authorization, respectively.
Prerequisites¶
Before applications can start rendering on VNC server, there are some prerequisite commands that each container must have run before each application startup.
-
Waiting until X socket and authority files are ready.
while [ ! -S /tmp/.X11-unix/X1 ] || [ ! -f /etc/xorg/config/Xauthcookie ]; do echo 'Waiting for X1 socket and Xauthcookie to be prepared.' sleep 1 done
This sleep loop holds program flow until the neccessary files are prepared for container. Containers which are permitted for VNC server usage, may start before the relevant files are prepared for them. For that reason, this ready wait loop is essential for industrial applications that use VNC server, otherwise applications may start too soon and fail to render.
-
export DISPLAY=:1
This is an environment variable that tells X11 based applications to use display number 1 for X protocol communication which essentially translates into using
/tmp/.X11-unix/X1
file. -
xauth add $(cat /etc/xorg/config/Xauthcookie)
This command generates a
.Xauthority
file inHOME
directory, permitting X11 applications to be authorized for VNC server communication.
After successfully executing all the steps mentioned above, applications can start and render their graphical outputs on VNC server.
Connecting VNC server as a client¶
Containers under industrial applications with VNC server access are dynamically assigned a port number to have a connection from machine network. These ports are open for VNC communication.
In order to find the port number corresponding to a container, the configuration of the relevant industrial
application can be viewed from Diagnostic
application. Inside the configurations, the displayNumber
field
can be found listed under the relevant container name. This field is a dynamically assigned number and
may change for each start. This number can be used to compute the port number. For this prefix the
displayNumber
with 590
. Eg. for the displayNumber
being 3
, the port for VNC access would be 5903
.
VNC clients can connect to this port using the machine network IP of their devices.
Such as <machine-network>:590X
where machine network is the IP for your machinelan and 590X is the computed
port number.
Limitations¶
Currently, at most 5 containers can be viewed through VNC. This means that display output of the applications that have been assigned a displayNumber
greater than 5 cannot be viewed.
Any questions left?
Except where otherwise noted, content on this site is licensed under the The Siemens Inner Source License - 1.1.