cannot keep vncserver alive

2,097 views
Skip to first unread message

hakayova

unread,
Oct 6, 2016, 7:30:35 PM10/6/16
to TigerVNC User Discussion/Support
Hi all,

Until recently I was able to get remote connection to my home PC via a combination of xrdp and tigervnc (manjaro linux which is an archlinux derivative). Recently, something broke down. I am not sure what exactly broke, but my first step in the troubleshooting is vncserver; I cannot seem to keep it alive for some reason. Here is the output:

sudo systemctl start vncserver@:10.service
systemctl status -l vncserver@:10.service
vncserver@:10.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2016-09-29 15:52:23 CDT; 1s ago
Process: 3613 ExecStop=/usr/bin/vncserver -kill %i (code=exited, status=2)
Process: 3620 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Main PID: 3629 (perl)
Tasks: 0 (limit: 4915)
CGroup: /system.slice/system-vncserver.slice/vncserver@:10.service
⣠3629 perl /usr/bin/vncserver -geometry 1440x900 -alwaysshared -fg :10

Just a few seconds later issue the same command again:

systemctl status -l vncserver@:10.service
â vncserver@:10.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2016-09-29 15:52:31 CDT; 3s ago
Process: 3673 ExecStop=/usr/bin/vncserver -kill %i (code=exited, status=2)
Process: 3629 ExecStart=/usr/bin/vncserver -geometry 1440x900 -alwaysshared -fg %i (code=exited, status=0/SUCCESS)
Process: 3620 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Main PID: 3629 (code=exited, status=0/SUCCESS)

Sep 29 15:52:23 semazen systemd[1]: Starting Remote desktop service (VNC)...
Sep 29 15:52:23 semazen systemd[3620]: pam_unix(login:session): session opened for user mancar by (uid=0)
Sep 29 15:52:23 semazen systemd[1]: Started Remote desktop service (VNC).
Sep 29 15:52:23 semazen systemd[3629]: pam_unix(login:session): session opened for user mancar by (uid=0)
Sep 29 15:52:31 semazen systemd[3673]: pam_unix(login:session): session opened for user mancar by (uid=0)
Sep 29 15:52:31 semazen systemd[1]: vncserver@:10.service: Control process exited, code=exited status=2
Sep 29 15:52:31 semazen systemd[1]: vncserver@:10.service: Unit entered failed state.
Sep 29 15:52:31 semazen systemd[1]: vncserver@:10.service: Failed with result 'exit-code'.

I am not sure what is failing here from the error messages. I could not locate the vncserver log file under /var/log directory.

# journalctl --system produces this output:

Sep 29 15:52:22 semazen systemd[1]: Starting Remote desktop service (VNC)...
Sep 29 15:52:22 semazen systemd[3593]: pam_unix(login:session): session opened for user mancar by (uid=0)
Sep 29 15:52:22 semazen systemd[1]: Started Session c756 of user mancar.
Sep 29 15:52:22 semazen systemd[1]: Started Remote desktop service (VNC).
Sep 29 15:52:22 semazen sudo[3557]: pam_unix(sudo:session): session closed for user root
Sep 29 15:52:22 semazen dbus[610]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.3184" (uid=1000 pid=3595 comm="(sd- ") interface="org.fre
Sep 29 15:52:22 semazen systemd[3600]: pam_unix(login:session): session opened for user mancar by (uid=0)
Sep 29 15:52:22 semazen systemd[1]: Started Session c757 of user mancar.
Sep 29 15:52:23 semazen sudo[3610]: mancar : TTY=pts/2 ; PWD=/home/mancar ; USER=root ; COMMAND=/usr/bin/systemctl restart vncserver@:10.service
Sep 29 15:52:23 semazen sudo[3610]: pam_unix(sudo:session): session opened for user root by mancar(uid=0)
Sep 29 15:52:23 semazen systemd[1]: Stopping Remote desktop service (VNC)...
Sep 29 15:52:23 semazen systemd[3613]: pam_unix(login:session): session opened for user mancar by (uid=0)
Sep 29 15:52:23 semazen systemd[1]: Started Session c758 of user mancar.
Sep 29 15:52:23 semazen systemd[1]: vncserver@:10.service: Control process exited, code=exited status=2
Sep 29 15:52:23 semazen systemd[1]: Stopped Remote desktop service (VNC).
Sep 29 15:52:23 semazen systemd[1]: vncserver@:10.service: Unit entered failed state.
Sep 29 15:52:23 semazen systemd[1]: vncserver@:10.service: Failed with result 'exit-code'.
Sep 29 15:52:23 semazen dbus[610]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.3187" (uid=1000 pid=3615 comm="(sd-pam) ") interface="org.fre
Sep 29 15:52:23 semazen systemd[1]: Starting Remote desktop service (VNC)...
Sep 29 15:52:23 semazen dbus[610]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.3188" (uid=1000 pid=3604 comm="(sd-pam) ") interface="org.fre
Sep 29 15:52:23 semazen systemd[3620]: pam_unix(login:session): session opened for user mancar by (uid=0)
Sep 29 15:52:23 semazen systemd[1]: Stopped Remote desktop service (VNC).
Sep 29 15:52:23 semazen systemd[1]: vncserver@:10.service: Unit entered failed state.
Sep 29 15:52:23 semazen systemd[1]: vncserver@:10.service: Failed with result 'exit-code'.
Sep 29 15:52:23 semazen dbus[610]: [system] Rejected send message, 2 matched rules; type="method_call", sender=":1.3187" (uid=1000 pid=3615 comm="(sd-pam) ") interface="org.fre

Any pointers will be greatly appreciated!

Pierre Ossman

unread,
Oct 7, 2016, 4:06:07 AM10/7/16
to hakayova, TigerVNC User Discussion/Support
On 07/10/16 01:30, hakayova wrote:
>
> I am not sure what is failing here from the error messages. I could not locate the vncserver log file under /var/log directory.
>

The log file ends up in ~/.vnc. Please check there for any errors.

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?

hakayova

unread,
Oct 7, 2016, 4:30:23 PM10/7/16
to TigerVNC User Discussion/Support
On Friday, October 7, 2016 at 3:06:07 AM UTC-5, Pierre Ossman wrote:

> The log file ends up in ~/.vnc. Please check there for any errors.

Here is the output of semazen\1:.log

Thu Oct 6 18:11:08 2016
vncext: VNC extension running!
vncext: Listening for VNC connections on local interface(s), port 5901
vncext: created VNC server for screen 0
/usr/bin/vncconfig: unable to open display "semazen:1"
xrdb: Connection refused
xrdb: Can't open display 'semazen:1'
/etc/X11/xinit/xinitrc: line 52: xclock: command not found
xterm: Xt error: Can't open display: semazen:1
xterm: Xt error: Can't open display: semazen:1
xterm: Xt error: Can't open display: semazen:1
twm: unable to open display "semazen:1"

I am not sure why this file is named as semazen\:1.log, since I the command to start vncserver is

sudo systemctl start vncserver@:10.service

Therefore the display number is supposed to be 10 not 1.

I am also puzzled with the lines that report problem with xrdb. Is this a typo? Does it mean xrdp instead?

So complicated...

hakayova

unread,
Oct 8, 2016, 1:43:54 PM10/8/16
to TigerVNC User Discussion/Support
Hate to reply to my own post but I got a little bit of more informative log file when I deleted the following line from my /etc/systemd/system/vncserver@.service file:

PAMName=login

Please see below the new log file, still named as semazen:1.log since vncserver seems to ignore my setting to open display 10 instead of 1 for some reason:


Xvnc TigerVNC 1.7.0 - built Sep 8 2016 19:36:24
Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11804000, The X.Org Foundation


Sat Oct 8 12:36:25 2016


vncext: VNC extension running!
vncext: Listening for VNC connections on local interface(s), port 5901
vncext: created VNC server for screen 0
/usr/bin/vncconfig: unable to open display "semazen:1"
xrdb: Connection refused
xrdb: Can't open display 'semazen:1'

Failed to connect to bus: No such file or directory
dbus-update-activation-environment: error: unable to connect to D-Bus: /usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

/etc/X11/xinit/xinitrc: line 52: xclock: command not found
xterm: Xt error: Can't open display: semazen:1

twm: unable to open display "semazen:1"

xterm: Xt error: Can't open display: semazen:1
xterm: Xt error: Can't open display: semazen:1

Looks like there seems to be a connection problem to D-Bus. This seems reasonable to me since my original working system failed after a KDE update. Any thoughts?

Thanks!

Pierre Ossman

unread,
Oct 17, 2016, 2:44:33 AM10/17/16
to hakayova, TigerVNC User Discussion/Support
On 07/10/16 22:30, hakayova wrote:
>
> I am not sure why this file is named as semazen\:1.log, since I the command to start vncserver is
> sudo systemctl start vncserver@:10.service
> Therefore the display number is supposed to be 10 not 1.
>

Odd. Does things work for you if you choose a lower display number?

> I am also puzzled with the lines that report problem with xrdb. Is this a typo? Does it mean xrdp instead?

Nope, xrdb is a different thing.

Ben Hildred

unread,
Oct 17, 2016, 5:51:17 AM10/17/16
to Pierre Ossman, hakayova, TigerVNC User Discussion/Support
On Mon, Oct 17, 2016 at 12:44 AM, Pierre Ossman <oss...@cendio.se> wrote:
On 07/10/16 22:30, hakayova wrote:

I am not sure why this file is named as semazen\:1.log, since I the command to start vncserver is
sudo systemctl start vncserver@:10.service
Therefore the display number is supposed to be 10 not 1.


Odd. Does things work for you if you choose a lower display number?

I am also puzzled with the lines that report problem with xrdb. Is this a typo? Does it mean xrdp instead?

Nope, xrdb is a different thing.

um, not exactly. xrdb is a rdp to vnc shim that uses Xvnc for its Xserver. if you are serving both rdp and vnc clients the errors can be quite confusing if you don't take into account that multiple servers are involved. 


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?

--
You received this message because you are subscribed to the Google Groups "TigerVNC User Discussion/Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tigervnc-users+unsubscribe@googlegroups.com.
To post to this group, send email to tigervn...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tigervnc-users/e5e73f5b-b0c3-17f5-6cb8-b785ad5e29b8%40cendio.se.

For more options, visit https://groups.google.com/d/optout.



--
--
Ben Hildred
Automation Support Services

Pierre Ossman

unread,
Oct 17, 2016, 6:12:43 AM10/17/16
to Ben Hildred, hakayova, TigerVNC User Discussion/Support
On 17/10/16 11:51, Ben Hildred wrote:
>>
>> I am also puzzled with the lines that report problem with xrdb. Is this a
>>> typo? Does it mean xrdp instead?
>>>
>>
>> Nope, xrdb is a different thing.
>
>
> um, not exactly. xrdb is a rdp to vnc shim that uses Xvnc for its Xserver.
> if you are serving both rdp and vnc clients the errors can be quite
> confusing if you don't take into account that multiple servers are
> involved.
>

xrd*B* has nothing to do with RDP. It's an X11 thing that's been around
for ages.

Ben Hildred

unread,
Oct 17, 2016, 6:16:45 AM10/17/16
to Pierre Ossman, hakayova, TigerVNC User Discussion/Support
On Mon, Oct 17, 2016 at 4:12 AM, Pierre Ossman <oss...@cendio.se> wrote:
On 17/10/16 11:51, Ben Hildred wrote:

I am also puzzled with the lines that report problem with xrdb. Is this a
typo? Does it mean xrdp instead?


Nope, xrdb is a different thing.


um, not exactly. xrdb is a rdp to vnc shim that uses Xvnc for its Xserver.
if you are serving both rdp and vnc clients the errors can be quite
confusing if you don't take into account that multiple servers are
involved.


xrd*B* has nothing to do with RDP. It's an X11 thing that's been around for ages.

sorry, dyslexia sucks. 

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?

hakan...@gmail.com

unread,
Feb 13, 2017, 10:58:46 AM2/13/17
to TigerVNC User Discussion/Support, oss...@cendio.se, hakan...@gmail.com
I still can't get the vncserver alive (see below). Any suggestions on this will be greatly appreciated. I am more than happy to provide further information as needed.

This is on Manjaro Linux (an Arch linux based distribution), and tigervnc 1.7.1-1 is the current version installed.

Hakan

hakan...@gmail.com

unread,
Feb 13, 2017, 10:59:30 AM2/13/17
to TigerVNC User Discussion/Support, oss...@cendio.se, hakan...@gmail.com
Sorry, I forgot to paste the output:

[mancar@semazen etc]$ sudo systemctl status vncserver
[sudo] password for mancar:
â vncserver.service - Remote desktop service (VNC)
Loaded: loaded (/usr/lib/systemd/system/vncserver.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sun 2017-02-12 23:06:25 CST; 10h ago
Process: 817 ExecStop=/usr/bin/vncserver -kill %i (code=exited, status=2)
Process: 795 ExecStart=/usr/bin/vncserver -fg %i (code=exited, status=2)
Process: 752 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i >/dev/null 2>&1 || true (code=exi
Main PID: 795 (code=exited, status=2)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
[mancar@semazen etc]$ sudo systemctl start vncserver
[mancar@semazen etc]$ sudo systemctl status vncserver
â vncserver.service - Remote desktop service (VNC)
Loaded: loaded (/usr/lib/systemd/system/vncserver.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2017-02-13 09:41:28 CST; 4s ago
Process: 3372 ExecStop=/usr/bin/vncserver -kill %i (code=exited, status=2)
Process: 3370 ExecStart=/usr/bin/vncserver -fg %i (code=exited, status=2)
Process: 3365 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i >/dev/null 2>&1 || true (code=ex
Main PID: 3370 (code=exited, status=2)

Pierre Ossman

unread,
Feb 27, 2017, 6:47:37 AM2/27/17
to hakan...@gmail.com, TigerVNC User Discussion/Support
On 13/02/17 16:59, hakan...@gmail.com wrote:
> On Monday, February 13, 2017 at 9:58:46 AM UTC-6, hakan...@gmail.com wrote:
>> I still can't get the vncserver alive (see below). Any suggestions on this will be greatly appreciated. I am more than happy to provide further information as needed.
>>
>> This is on Manjaro Linux (an Arch linux based distribution), and tigervnc 1.7.1-1 is the current version installed.
>>
>> Hakan
>
> Sorry, I forgot to paste the output:
>
> Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.
> [mancar@semazen etc]$ sudo systemctl start vncserver
> [mancar@semazen etc]$ sudo systemctl status vncserver
> â vncserver.service - Remote desktop service (VNC)
> Loaded: loaded (/usr/lib/systemd/system/vncserver.service; enabled; vendor preset: disabled)
> Active: failed (Result: exit-code) since Mon 2017-02-13 09:41:28 CST; 4s ago
> Process: 3372 ExecStop=/usr/bin/vncserver -kill %i (code=exited, status=2)
> Process: 3370 ExecStart=/usr/bin/vncserver -fg %i (code=exited, status=2)
> Process: 3365 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i >/dev/null 2>&1 || true (code=ex
> Main PID: 3370 (code=exited, status=2)
>

Hmmm... How did you set up this service? This is a dynamic service that
can be launch multiple copies. As such it should not be called just
vncserver.service.

hakan...@gmail.com

unread,
Mar 1, 2017, 11:36:06 PM3/1/17
to TigerVNC User Discussion/Support, hakan...@gmail.com
On Monday, February 27, 2017 at 5:47:37 AM UTC-6, Pierre Ossman wrote:

> >
>
> Hmmm... How did you set up this service? This is a dynamic service that
> can be launch multiple copies. As such it should not be called just
> vncserver.service.

Following is the systemd service file named vncserver@:10.service

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=simple
User=mancar
PAMName=login


ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'


ExecStart=/usr/bin/vncserver -geometry 1440x900 -alwaysshared -fg %i

ExecStop=/usr/bin/vncserver -kill %i

[Install]
WantedBy=multi-user.target

This is the file generated after service fails to stay alive, named ~/.vnc/localhost:3.log

_XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed
_XSERVTransMakeAllCOTSServerListeners: server already running
(EE)
Fatal server error:
(EE) Cannot establish any listening sockets - Make sure an X server isn't already running(EE)

Well the X server is already running when I attempt to start the service by issuing the command sudo systemctl start vncserver@:10.service. VNC server on the other hand starts but does not stay alive at the boot with the error I posted in my previous message, showed as a response to the sudo systemctl status vncs...@10.service command.

I hope this is clear enough. If not, please let me know I am more than happy to experiment to solve this problem.

Hakan

Pierre Ossman

unread,
Mar 30, 2017, 8:30:22 AM3/30/17
to hakan...@gmail.com, TigerVNC User Discussion/Support
On 02/03/17 05:36, hakan...@gmail.com wrote:
> On Monday, February 27, 2017 at 5:47:37 AM UTC-6, Pierre Ossman wrote:
>
>>>
>>
>> Hmmm... How did you set up this service? This is a dynamic service that
>> can be launch multiple copies. As such it should not be called just
>> vncserver.service.
>
> Following is the systemd service file named vncserver@:10.service
>

I'm not that familiar with systemd, but I believe this is wrong. The
service file should just be called vncserver@.service, and the @
triggers the magic to allow you to create multiple instances.
Reply all
Reply to author
Forward
0 new messages