How to use .vnc files and java vncviewer

399 views
Skip to first unread message

Rafael Guimaraes

unread,
Mar 3, 2022, 12:33:57 PM3/3/22
to turbovn...@googlegroups.com
Hello folks,

I have always used TurboVNC through JavaWS. I generate a .jnlp file and it launches my turbovnc java client automatically.

Since JavaWS is in its end of life, I am trying to migrate to a solution where I have a .vnc file that is generated by my web portal and it is associated with VNCViewer. I am currently using the Java VNCViewer as a standalone application (on Windows).

I am able to successfully launch the VNCViewer by command line using the command below (where 44444444 is an OTP):

java -jar VncViewer.jar myu...@10.0.0.1::5902 -Password=44444444 -FullScreen=1

However I don't know how the equivalent .vnc file format would look like. I have tried the following, but it gives me the following error: ""

[connection]
user=myuser
host=10.0.0.1
port=5902
Password=44444444
FullScreen=1

What am I doing wrong?

Moreover, if I open the VNC connection info dialog box, I get the following:
  JPEG decompression: Unaccelerated
  TurboVNC Helper: Not found

And the following warning on the terminal:
Viewport: WARNING: Could not find TurboVNC Helper JNI library.  If it is in a
Viewport:   non-standard location, then add -Djava.library.path=<dir>
Viewport:   to the Java command line to specify its location.
Viewport:   Keyboard grabbing will be disabled.

I have tried to put ljtwin64.jar and tvnchelper-win64.jar in my current directory (c:\temp) and used the following command, but nothing changed...

java -Djava.library.path=c:\temp -jar VncViewer.jar myu...@10.0.0.1::5902 -Password=44444444 -FullScreen=1

Any information would be helpful... Thanks!

Best regards,
Rafael Guimarães

DRC

unread,
Mar 3, 2022, 3:12:25 PM3/3/22
to turbovn...@googlegroups.com

The errors about the TurboVNC Helper will be resolved if you launch the viewer using the vncviewer.bat script rather than trying to launch the JAR directly.  If you elected to associate .vnc files with the TurboVNC Viewer when you installed it, then you can simply open the .vnc file in Explorer, and that will automatically invoke the TurboVNC Viewer launch script.

The .vnc format is unfortunately not documented, and I apologize for that.  It was a holdover from TightVNC v1.3.x.  I had intended to introduce a more straightforward .turbovnc format for TurboVNC 3.0 that is simply a list of the Java viewer parameters and their values, but I ran out of time and funding.  For now, here is an informal description of the .vnc format:

- Any line beginning with [ will be ignored.  Those were historically used as section headers, since .vnc was originally based on the Microsoft .ini file format.  The Java TurboVNC Viewer has never bothered with the section headers, however.

- All whitespace will be ignored.

- Using the old .ini file terminology, each line in the .vnc file contains a "key" that has a name, followed by "=", followed by a value.  Key names are case-insensitive.

- The following .vnc key names map to TurboVNC Viewer parameters of the same names:

  "Port"
  "User"
  "Restricted"
  "ViewOnly"
  "ReverseScroll"
  "FullScreen"
  "FSAltEnter"
  "Shared"
  "CursorShape"
  "CompressLevel"
  "NoUnixLogin"

  A description of those parameters and their accepted values can be obtained by running

    /opt/TurboVNC/bin/vncviewer -?

  on Un*x systems or

    "c:\Program Files\TurboVNC\vncviewer.bat" -?

  on Windows systems.

- The following .vnc keys map to TurboVNC Viewer parameters with different names or accepted values:

  "Host" key --> "Server" parameter

  "Password" key --> "EncPassword" parameter.  You can generate an encrypted password on the TurboVNC host by executing:
    echo '{unencrypted_password}' | /opt/TurboVNC/bin/vncpasswd -f | xxd -c 256 -ps
  If you are using OTP authentication, then your portal should do this in order to populate the auto-generated .vnc file with a one-time password obtained for a particular TurboVNC session.

  "Preferred_Encoding" key --> "Encoding" parameter, except that the value of the "Preferred_Encoding" key should be an encoding number (refer to https://github.com/TurboVNC/turbovnc/blob/efdb2c9db89e0bcb964f0f97e4939f96561c194f/java/com/turbovnc/rfb/RFB.java#L208) rather than an encoding name.  Don't bother with this key if you are connecting to a TurboVNC Server, as the default (Tight encoding) is the optimal choice.

  "GrabKeyboard" key --> "GrabKeyboard" parameter, except that the value of the "GrabKeyboard" key should be a keyboard grabbing option number (refer to https://github.com/TurboVNC/turbovnc/blob/efdb2c9db89e0bcb964f0f97e4939f96561c194f/java/com/turbovnc/rfb/Options.java#L47) rather than a keyboard grabbing option name.

  "Span" key --> "Span" parameter, except that the value of the "Span" key should be a spanning option number (refer to https://github.com/TurboVNC/turbovnc/blob/efdb2c9db89e0bcb964f0f97e4939f96561c194f/java/com/turbovnc/rfb/Options.java#L37) rather than a spanning option name.

  "8bit=1" key --> "Colors=256" parameter (legacy-- don't use)

  "DisableClipboard" key --> Both the "RecvClipboard" and "SendClipboard" parameters

  "FitWindow=1" key --> "Scale=FixedRatio" parameter

  "Scale_Num" and "Scale_Denom" keys --> "Scale" parameter (e.g. "Scale_Num=1" and "Scale_Denom=2" --> "Scale=50%" or "Scale_Num=2" and "Scale_Denom=1" --> "Scale=200%")

  "ResizeMode" key --> "DesktopSize" parameter, except that the value of the "ResizeMode" key should be a desktop size option number (refer to https://github.com/TurboVNC/turbovnc/blob/efdb2c9db89e0bcb964f0f97e4939f96561c194f/java/com/turbovnc/rfb/Options.java#L42) rather than a desktop size option name.

  "DesktopWidth" and "DesktopHeight" keys --> "DesktopSize" parameter (e.g. "DesktopWidth=1920" and "DesktopHeight=1200" --> "DesktopSize=1920x1200")

  "NoRemoteCursor" key --> "LocalCursor" parameter

  "Subsampling" key --> "Subsampling" parameter, except that the value of the "Subsampling" key should be a subsampling option number (refer to https://github.com/TurboVNC/turbovnc/blob/efdb2c9db89e0bcb964f0f97e4939f96561c194f/java/com/turbovnc/rfb/Options.java#L52) rather than a subsampling option name.

  "Quality" key --> "Quality" parameter, except that "Quality=-1" maps to "JPEG=0"

  A description of those parameters and their accepted values can be obtained as described above.


The .vnc file format is backward compatible with the legacy Windows TurboVNC Viewer, so it doesn't support any features that the Windows TurboVNC Viewer couldn't handle.  That unfortunately includes specifying security types, so unless the allowable security types are limited on the server, the viewer will default to TLSVnc if the 'User' key is unspecified and TLSPlain if the 'User' key is specified.  (Yet another reason to introduce the new .turbovnc file format.)

DRC

--
You received this message because you are subscribed to the Google Groups "TurboVNC User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to turbovnc-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/turbovnc-users/CAMCG4__qzfT%3DzoiMu045iFhYPAFKGqZSbWjzt11SG4oYfQ0oYQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages