How to call TigerVNC from Cygwin

308 views
Skip to first unread message

chr.asim...@gmail.com

unread,
Mar 7, 2019, 6:19:11 AM3/7/19
to TigerVNC User Discussion/Support
Hello,

I have installed TigerVNC Viewer 64-bit v1.8.0 in Windows 7 through Cygwin database. I am trying to call it from Cygwin terminal by vncviewer command as:

vncviewer -via gatewayAddress 127.0.0.1::5901

However, I get the following message:
TigerVNC Viewer 64-bit v1.8.0
Built on: 2017-12-30 22:04
Copyright (C) 1999-2017 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Can't open display:


After searching a bit, I concluded in starting Xming server and seting DISPLAY variable in Cygwin: export DISPLAY=localhost:0

With those actions it worked like a charm.

However, when I do it through vncviewer.exe executable (note that previously I have performed local port forwarding in another terminal as GUI it doesn't seem to provide an analogous option as vncviewer in command line by "-via" option) it doesn't need Xming server.

So, the question is, since VNC use another protocol than X, why should I need Xming server? Is there a way to run from terminal without it? I tried "-display=1" option but with no luck.

VNC server is running like this on a server where I don't have root permissions: /usr/bin/Xvnc :1 -desktop desktopName -auth /usr/local/desktopName/.Xauthority -geometry 1500x1000 -rfbwait 30000 -rfbauth /usr/local/desktopName/.vnc/passwd -rfbport 5901 -fp catalogue:/etc/X11/fontpath.d -pn nolisten tcp -localhost -SecurityTypes None -AlwaysShared

Last, an another question. How to make vncviewer to connect to remote desktop without typing every time my password. I found some info in Arch linux wiki (https://wiki.archlinux.org/index.php/TigerVNC):

"Passwordless authentication
The -passwd switch allows one to define the location of the server's ~/.vnc/passwd file. It is expected that the user has access to this file on the server through SSH or through physical access. In either case, place that file on the client's file system in a safe location, i.e. one that has read access ONLY to the expected user.

$ vncviewer -passwd /path/to/server-passwd-file"

Though, I am not sure what "place that file on the client's file system" action serves. Could you please help?


Thank you in advance,
Chris

Pierre Ossman

unread,
Mar 25, 2019, 10:31:03 AM3/25/19
to chr.asim...@gmail.com, TigerVNC User Discussion/Support
On 07/03/2019 12:19, chr.asim...@gmail.com wrote:
>
> So, the question is, since VNC use another protocol than X, why should I need Xming server? Is there a way to run from terminal without it? I tried "-display=1" option but with no luck.
>

There seems to be a bit of confusion on how Unix programs work here.
Graphical Unix programs use X11 to display things on screen. VNC is for
transferring things over the network and can not fulfil this.

In your case you were running the Unix version of vncviewer, and hence a
X11 server is needed for it to display things.

But this is a bit cumbersome on Windows as we already have a Windows
version of vncviewer. And being a Windows version, it uses the Windows
graphical API and does not need X11.

So please try to use the Windows version on Windows and not the Unix
version. :)

>
> Last, an another question. How to make vncviewer to connect to remote desktop without typing every time my password. I found some info in Arch linux wiki (https://wiki.archlinux.org/index.php/TigerVNC):
>
> "Passwordless authentication
> The -passwd switch allows one to define the location of the server's ~/.vnc/passwd file. It is expected that the user has access to this file on the server through SSH or through physical access. In either case, place that file on the client's file system in a safe location, i.e. one that has read access ONLY to the expected user.
>
> $ vncviewer -passwd /path/to/server-passwd-file"
>
> Though, I am not sure what "place that file on the client's file system" action serves. Could you please help?
>

You have a file on the server that contains the password for the server
(/usr/local/desktopName/.vnc/passwd). You need to copy that file over to
the client and specify where you've put it using the -passwd argument to
vncviewer.

Regards
--
Pierre Ossman Software Development
Cendio AB https://cendio.com
Teknikringen 8 https://twitter.com/ThinLinc
583 30 Linköping https://facebook.com/ThinLinc
Phone: +46-13-214600

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
Reply all
Reply to author
Forward
0 new messages