TransWikia.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 vncserver@:1, the VNC server doesn’t respond, and actually, the Xvnc process isn’t even running.

I tried troubleshooting this, first with systemctl status vncserver@:1 which gave me this:

● vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@: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]: vncserver@:1.service: Control process exited, code=exited status=2
Oct 10 20:57:46 JUHANPELIKONE-L systemd[1]: vncserver@: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!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP