Sample Header Ad - 728x90

How to run VNC as a System Service on 64-bit Arm?

1 vote
0 answers
1367 views
I'm following this guide to setup VNC server in my Ubuntu arm64 machine (specifically, armbian 64-bit). There's one problem I found with it so far. When I start the VNC server using vncserver :1 -localhost no command, it didn't work and crashed after I tried to access the session from a VNC client. But, when I tried with LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 vncserver :1 -localhost no command I found here , it's started to work. Now I want to manage this as system service using systemctl command. So, I have this unit file: [Unit] Description=Start TightVNC server at startup After=syslog.target network.target [Service] Type=forking User=zulh Group=zulh WorkingDirectory=/home/zulh PIDFile=/home/zulh/.vnc/%H:%i.pid ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1 ExecStart="LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.so.1 /usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost no :%i" ExecStop=/usr/bin/vncserver -kill :%i [Install] WantedBy=multi-user.target Now when I ran... $ sudo systemctl daemon-reload $ sudo systemctl enable vncserver@1.service $ vncserver -kill :1 $ sudo systemctl start vncserver@1 ...I got this: $ sudo systemctl status vncserver@1 ● vncserver@1.service - Start TightVNC server at startup Loaded: bad-setting (Reason: Unit vncserver@1.service has a bad unit file setting.) Active: failed (Result: timeout) since Sat 2022-04-16 17:34:44 +08; 3min 42s ago Apr 16 17:33:13 armbian gnome-session: gnome-session-binary: CRITICAL: We failed, but the fail whale is dead. Sorry.... Apr 16 17:33:13 armbian gnome-session-binary: WARNING: App 'org.gnome.Shell.desktop' respawning too quickly Apr 16 17:33:13 armbian gnome-session-binary: CRITICAL: We failed, but the fail whale is dead. Sorry.... Apr 16 17:34:41 armbian systemd[1] : vncserver@1.service: start operation timed out. Terminating. Apr 16 17:34:44 armbian systemd[1] : vncserver@1.service: Failed with result 'timeout'. Apr 16 17:34:44 armbian systemd[1] : Failed to start Start TightVNC server at startup. Apr 16 17:34:49 armbian systemd[1] : /etc/systemd/system/vncserver@.service:13: Neither a valid executable name nor an absolute path: LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.s> Apr 16 17:34:49 armbian systemd[1] : vncserver@1.service: Unit configuration has fatal error, unit will not be started. Apr 16 17:38:00 armbian systemd[1] : /etc/systemd/system/vncserver@.service:13: Neither a valid executable name nor an absolute path: LD_PRELOAD=/lib/aarch64-linux-gnu/libgcc_s.s> Apr 16 17:38:00 armbian systemd[1] : vncserver@1.service: Unit configuration has fatal error, unit will not be started. What should I do to fix this?
Asked by Zulhilmi Zainudin (111 rep)
Apr 19, 2022, 01:51 AM