AnswerBun.com

VNC Server immediately crashes

Unix & Linux Asked by jkan5855 on October 17, 2020

So, I recently installed the tigervnc package on Arch Linux (uname -r 4.18.10-arch1-1-ARCH). I’m trying to get the VNC server to run trough SSH tunnels, so I’m starting the server on localhost only with -localhost on vncserver.

The problem is, after I start my .service file for vncserver with systemctl start [email protected]:1, the VNC server doesn’t respond, and actually, the Xvnc process isn’t even running.

I tried troubleshooting this, first with systemctl status [email protected]:1 which gave me this:

[email protected]:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/[email protected]:1.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Wed 2018-10-10 20:57:46 EEST; 10min ago
  Process: 4936 ExecStop=/usr/bin/vncserver -kill :1 (code=exited, status=2)
  Process: 4897 ExecStart=/usr/bin/vncserver :1 -fg -alwaysshared -localhost :1 (code=exited, status=0/SUCCESS)
  Process: 4891 ExecStartPre=/usr/bin/dbus-launch (code=exited, status=0/SUCCESS)
  Process: 4885 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill :1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 4897 (code=exited, status=0/SUCCESS)

Oct 10 20:57:41 JUHANPELIKONE-L systemd[1]: Starting Remote desktop service (VNC)...
Oct 10 20:57:42 JUHANPELIKONE-L systemd[4885]: pam_unix(login:session): session opened for user juha by (uid=0)
Oct 10 20:57:42 JUHANPELIKONE-L systemd[4891]: pam_unix(login:session): session opened for user juha by (uid=0)
Oct 10 20:57:42 JUHANPELIKONE-L systemd[1]: Started Remote desktop service (VNC).
Oct 10 20:57:42 JUHANPELIKONE-L systemd[4897]: pam_unix(login:session): session opened for user juha by (uid=0)
Oct 10 20:57:46 JUHANPELIKONE-L systemd[1]: [email protected]:1.service: Control process exited, code=exited status=2
Oct 10 20:57:46 JUHANPELIKONE-L systemd[1]: [email protected]:1.service: Failed with result 'exit-code'.

I then tried to diagnose it with journalctl -xe, and found some pam errors and then a segfault backtrace for Xvnc.

I’ve tried adding a dbus launch command to the service file (it’s currently there), changing the window manager, removing and adding parameters to the vncservice call in the service file, running this from the terminal emulator directly, and reinstalling tigervnc.

The .service file is up on pastebin, along with my journalctl -x output and other stuff, to prevent clutter.

One Answer

I know this is slightly old, and its absolutely possible that OP has just given up on this. But I have come across this issue as well, and I have (by trial and error) traced it back to the "-fg" (run in foreground) flag. If you run vncserver manually (or possibly via some other means on startup, the vncserver will be ok.

However, removing the fg flag does not fix the issue with systemd. I dont know what causes the segfault exactly.

To replicate the issue without systemd, you can manually run vncserver -fg and it will immediately crash giving you the same segfault issue in your vncserver log, however if you remove the fg flag and instead run vncserver without the foreground flag, the server will be fine.

Something about attempting to run a vncserver in the foreground causes Xvnc to crash. I am unsure what though.

Answered by miversen33 on October 17, 2020

Add your own answers!

Related Questions

Setting up openvpn with a killswitch in a freebsd jail

0  Asked on December 8, 2021 by openvpnwannabe

         

Play sound from Jenkins script

0  Asked on December 8, 2021

         

How can I install dpkg and aptitude on Raspbian?

1  Asked on December 8, 2021 by antonio-del-sannio

       

SSHD: Different configurations for different ports?

1  Asked on December 8, 2021 by goof

   

Mutt: how to safely store password?

6  Asked on December 6, 2021 by user2362

   

How to install libprotobuf?

2  Asked on December 6, 2021 by user1762571

     

Debian 9 VmWare Black Screen after reboot

1  Asked on December 6, 2021 by bakedpotatowithcheese

       

Why does bash’s tab completion trigger the stack protector?

1  Asked on December 6, 2021 by charles-diploma

     

Capitalise few characters in a word

0  Asked on December 6, 2021 by yuva-raj

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP