4

Having a bit of an issue with a TightVNC server.

Just installed tightvncserver package on Ubuntu 18.04 but it crashes immediately upon launching a session:

06/11/19 18:40:25 Xvnc version TightVNC-1.3.10
06/11/19 18:40:25 Copyright (C) 2000-2009 TightVNC Group
06/11/19 18:40:25 Copyright (C) 1999 AT&T Laboratories Cambridge
06/11/19 18:40:25 All Rights Reserved.
06/11/19 18:40:25 See http://www.tightvnc.com/ for information on TightVNC
06/11/19 18:40:25 Desktop name 'X' (srv:1)
06/11/19 18:40:25 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
06/11/19 18:40:25 Listening for VNC connections on TCP port 5901
Font directory '/usr/share/fonts/X11/75dpi/' not found - ignoring
Font directory '/usr/share/fonts/X11/100dpi/' not found - ignoring
/etc/X11/Xvnc-session: 6: /etc/X11/Xvnc-session: vncconfig: not found
Killing Xtightvnc process ID 2428

the /etc/X11/Xvnc-session seems pretty standard:

#! /bin/sh

test x"$SHELL" = x"" && SHELL=/bin/bash
test x"$1"     = x"" && set -- default

vncconfig -iconic &
$SHELL -l <<EOF
exec /etc/X11/Xsession "$@"
EOF
vncserver -kill $DISPLAY

I tried reinstalling the TightVNC server, that didn't help.

What is vncconfig? Isn't it supposed to be the part of TightVNC package? If not, where can I can it be found?

Regs
  • 143
  • 1
  • 1
  • 4

2 Answers2

8

You probably installed tigervnc first which modifies and creates a couple of files in /etc/X11. I don't know which these are but your .vnc/xstartup will not work any more. You need to create a new /etc/X11/Xvnc-session which has the same content as your xstartup.

Felix Pfeifer
  • 96
  • 1
  • 3
  • Thanks for this - should be marked as the correct answer! – Dave Martorana May 11 '20 at 15:39
  • how do we create a new Xvnc-session ? – Erik May 13 '20 at 08:48
  • Just copy your ~/.vnc/xstartup to /etc/X11/Xvnc-session and edit to your needs. – Felix Pfeifer May 14 '20 at 09:50
  • @FelixPfeifer THANK YOU for being literally the first correct answer I have found in 3 days of trying to get a linux server set up. This is the very first thing anybody has said that actually worked, in 3 days of googling for solutions to every aspect of getting this beast running. – John Smith May 25 '20 at 22:19
  • @JohnSmith This is really a tricky one. I ran into the same problem and googled it without any hint. Regs question describes the problem exactly but it had no solution. The only hint I had was that it was working on my box. It then stopped working after I installed Tigervnc. When I reinstalled tightvnc it just did not work any more. So I figured there must be any files left which were not removed together with Tigervnc. It would be probably worth to report this as a bug to the ubuntu team. I guess when installing tightvnc it should check for any leftovers from tigervnc and move them. – Felix Pfeifer May 27 '20 at 06:55
  • 2
    Is there any way to revert this? I'd much prefer to use the one in my ~/.vnc folder – Jared Beach Dec 17 '20 at 15:58
  • 1
    I am using the vnc but can't rung vncconfig. I don't know how to install vncconfig. I'm using tightvnc on ubuntu 20.04, arm64 machine. 'apt-cache search vncconfig' shows I need tigervnc-common package. Can I just install it without breaking current tightvnc-server setup? – Chan Kim Sep 30 '21 at 13:49
  • @Chan Kim, thanks this was the real answer for me. I had to install tigervnc-common to get vncconfig installed. – user3817445 Dec 19 '21 at 15:43
3

I think the original contents of /etc/X11/Xvnc-session got lost, at least that's likely what happened in my case. I'm using vnc4server, but it is likely the same for other VNC implementations. Something like this is probably what should be in Xvnc-session, only with more defaults for when your xstartup is missing. I set Xvnc-session to this on my personal ubuntu 18.04 computer and can now set my vcnserver up using my local .vnc/xstartup. I would like it if someone could post the original correct contents of /etc/X11/Xvnc-session (or at least one plausible version of that).

#!/bin/bash
exec $HOME/.vnc/xstartup

I don't use it outside my home and I use ssh tunneling to map the 590x port thru my localhost from the client and ufw is set to not allow 590x on my Linux target. So I don't mind the poor security, short password and "unencrypted connection" (it is encrypted by the ssh tunnel).

Kulfy
  • 17,416
  • 26
  • 64
  • 103
John
  • 31
  • 1