Unable to set up TigerVNC server on Kubuntu :(

427 views
Skip to first unread message

ars.ig...@gmail.com

unread,
Oct 31, 2018, 3:04:26 AM10/31/18
to TigerVNC User Discussion/Support
Hi,.
I have tried to set up tigervnc server on Ubuntu 18.04 to no avail. When typing for example "vncserver :50", I get the output:

------------------
New 'host:50 (profitus)' desktop at :50 on machine host

Starting applications specified in /home/profitus/.vnc/xstartup
Log file is /home/profitus/.vnc/cubit:50.log

Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/profitus/.vnc/passwd :50 to connect to the VNC server.
------------------

But I CANNOT connect to it from the outside. There are no errors reported in the log when trying to connect (located as stated in the output above). The command 'netstat -tpln' shows:

------------------
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
...
tcp 0 0 127.0.0.1:5950 0.0.0.0:* LISTEN 7449/Xtigervnc
...
tcp6 0 0 ::1:5950 :::* LISTEN 7449/Xtigervnc
...
------------------

My current ~/.vnc/xstartup looks like:

------------------
#!/bin/bash
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &

xrdb $HOME/.Xresources
startkde &
------------------

I even tried using lines such as

------------------
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc
------------------

instead of 'startkde &', but that didn't work.

I have tried other VNC servers such as x11vnc by Karl Runge. That server does properly start up and I can access it from the outside through port 5950. But it only hooks me up with screen :0 and it is pretty buggy.

I also tried tightvnc to port 50 and it only works if I accept its "default" screen resolution at 800x600 and it only hooks me up with screen :0. If I try something else I only get a gray screen with a mouse pointer. I get similar results with vnc4server too with the difference that I only get a gray screen no matter what I do and I get some checkboxes at the upper left corner on the gray screen.

Pierre Ossman

unread,
Oct 31, 2018, 11:38:08 AM10/31/18
to ars.ig...@gmail.com, TigerVNC User Discussion/Support
On 31/10/2018 08:04, ars.ig...@gmail.com wrote:
>
> But I CANNOT connect to it from the outside. There are no errors reported in the log when trying to connect (located as stated in the output above). The command 'netstat -tpln' shows:
>
> ------------------
> Active Internet connections (only servers)
> Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
> ...
> tcp 0 0 127.0.0.1:5950 0.0.0.0:* LISTEN 7449/Xtigervnc
> ...
> tcp6 0 0 ::1:5950 :::* LISTEN 7449/Xtigervnc
> ...
> ------------------
>

The problem is shown here. The server is started in a way that nothing
external can connect to it. This is not the default behaviour for our
code, but I know Red Hat has changed that, and Debian/Ubuntu might have
as well.

The idea from their side is that VNC is usually unencrypted, so you
should be using some VPN to reach your server first (e.g. vncviewer's
-via function).

If you want to enable outside access then you'll have to look at any
Debian/Ubuntu documentation. They have their own startup script for
TigerVNC so I'm afraid I'm not familiar with how it works.

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 https://plus.google.com/+CendioThinLinc

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?

ars.ig...@gmail.com

unread,
Nov 1, 2018, 4:43:58 AM11/1/18
to TigerVNC User Discussion/Support
I followed these instructions on the DigitalOcean page to set up an ssh tunnel:

---

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04

---

I essentially wrote:

sh -L 5950:127.0.0.1:5950 -C -N -l profitus <my_ip> -p 222

Where 222 is my ssh port. But when I try start vnserver after running this command,, vncserver complains that another vncserver is already running. netstat shows that ssh is running.

If I otoh run vncserver before, then ssh will fail to bind the port.

ars.ig...@gmail.com

unread,
Nov 1, 2018, 5:16:34 AM11/1/18
to TigerVNC User Discussion/Support
I also tried the following setup:

---------
ssh -L 5920:127.0.0.1:5950 -C -N -l profitus <my_ip> -p 222
vncserver -geometry 1920x1080 -depth 24 :20
---------

but that also fails. It doesn't matter which order I execute these commands. I still fail to login.

ars.ig...@gmail.com

unread,
Nov 1, 2018, 5:34:31 AM11/1/18
to TigerVNC User Discussion/Support
This is the output log file from vncserver when trying to run it on port 20:

https://pastebin.com/A5gAneRW


I also tried the flag '-rfbport 5920' instead of ':20' and also in conjunction with :20.

Pierre Ossman

unread,
Nov 1, 2018, 10:31:13 AM11/1/18
to ars.ig...@gmail.com, TigerVNC User Discussion/Support
That command should be run on your client, not on the server. That's why
you are getting a port conflict.

I would also recommend against -C as it will just slow things down.

ars.ig...@gmail.com

unread,
Nov 2, 2018, 8:47:46 AM11/2/18
to TigerVNC User Discussion/Support
Ok, so I tried what I did with my first reply but executed the ssh command on the client side instead. It still failed.

Pierre Ossman

unread,
Nov 5, 2018, 10:24:15 AM11/5/18
to ars.ig...@gmail.com, TigerVNC User Discussion/Support
On 02/11/2018 13:47, ars.ig...@gmail.com wrote:
> Ok, so I tried what I did with my first reply but executed the ssh command on the client side instead. It still failed.
>

What error did you get in that case?
Reply all
Reply to author
Forward
0 new messages