Vncsend

From techdocs
Revision as of 10:12, 25 Mayıs 2023 by Plinich (talk | contribs) (→‎Security)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


vncsend (note lower case) is one half of the vncsend/vncrecv pair of programs which allow a current VLAB or lab computer session screen to be shared with another user.

Note that there is a minor variant of vncrecv named vncrecv.tutor for use on tutor computers in CSE labs. More on this below. It displays on the big screens in the labs instead of the desktop monitor connected to the tutor computer.

Intended uses:

  1. A tutor in a class who, while helping a student at the student's computer, decides that it might be useful for the rest of the class to be able to see what the tutor is doing. vncsend can be run on the student's computer to "project" the student's screen to the large monitors connected to the tutor's machine (which would already be running vncrecv.tutor).
  2. Two students working in a pair, can share either of their lab computer or VLAB screens with any other lab computer or VLAB screen one of them is using, locally or remotely.

vncsend, vncrecv and vncrecv.tutor are command-line programs. They are located in /usr/local/infrastructure/bin.

vncrecv is run first

vncrecv (or vncrecv.tutor) is run first. It takes an optional TCP port number on which it listens for incoming connections from vncsend. If this port is not specified it defaults to 65509.

Examples:

z1234567@kora01$ /usr/local/infrastructure/bin/vncrecv

or (on a tutor's computer):

z1234567@kora03$ /usr/local/infrastructure/bin/vncrecv.tutor

vncsend is then run after vncrecv has been started

vncsend is then run inside the session that you want to share. It takes one or two arguments:

  1. The first is the name or IP address of the host running vncrecv/vncrecv.tutor, and
  2. An optional second argument is the TCP port to share to. This would be useful when multiple users on, say, a VLAB host, are using vncrecv at the same time. If not specified, this also defaults to 65509.

Example:

z1234567@kora12$ /usr/local/infrastructure/bin/vncsend kora03

Terminating

vncsend and vncrecv/vncrecv.tutor can be exited with ^C. On the receiver side, you can also press F7 to get the VNC client menu and then select exit.

Notes

  • vncsend, vncrecv and vncrecv.tutor use a VNC server (vncsend) and a VNC viewer (vncrecv/vncrecv.tutor) to do most of the magic.
  • Because using VLAB requires running a VNC viewer anyway, the default VNC viewer menu key of F8 is changed in vncrecv and vncrecv.tutor to F7 so exiting a shared session in VLAB via the viewer menu doesn't accidentally actually exit your VLAB session.
  • For security, the shared VNC sessions don't use TCP connections and instead use UNIX sockets — which can be owned by the user and have permissions assigned to limit access — to avoid snooping.
  • Once started, the mouse and keyboard on BOTH screens are active.
  • vncrecv and vncrecv.tutor will only accept connections originating from CSE lab or VLAB subnetworks. This is hard-coded in the script.
  • The VNC client automatically starts in full-screen mode.
  • vncsend and vncrecv/vncrecv.tutor are written in Tcl and are non-privileged.
  • socat is used for UNIX socket ops.

Security

  • vncsend, vncrecv and vncrecv.tutor don't use any form of authentication and access is only limited by the subnetwork on which vncsend can run. Thus, don't leave vncrecv or vncrecv.tutor running when you're not around to keep an eye on them.