For some reason, I can't for the life of me cannot start vncserver to start at boot. I'm using this guide and as per the link, here's my constructed systemd file for it
[Unit]
Description=Start TightVNC server at startup
After=syslog.target network.target
[Service]
Type=forking
User=
Group=
WorkingDirectory=/home/
PIDFile=/home//.vnc/%H:%i.pid
ExecStartPre=/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost no :%i
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
trying to start it via systemctl fails and checking the status shows this:
× vncserver@1.service - Remote desktop service (VNC)
Loaded: loaded (/etc/systemd/system/vncserver@1.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2024-05-09 15:57:31 PDT; 11s ago
Process: 64087 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill 1 > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
Process: 64091 ExecStart=/usr/bin/vncserver -geometry 1800x1000 -depth 16 -dpi 120 -alwaysshared -localhost no 1 (code=exited, status=1/FAILURE)
CPU: 234ms
Also, it says:
> vncserver@1.service: Failed with result 'exit-code'.
Journalctl says this:
░░ An ExecStart= process belonging to unit vncserver@1.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
May 09 15:57:31 MBP systemd[1] : vncserver@1.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit vncserver@1.service has entered the 'failed' state with result 'exit-code'.
May 09 15:57:31 MBP systemd[1] : Failed to start Remote desktop service (VNC).
░░ Subject: A start job for unit vncserver@1.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit vncserver@1.service has finished with a failure.
░░
░░ The job identifier is 6471 and the job result is failed.
Asked by Skegg
(121 rep)
May 9, 2024, 11:10 PM
Last activity: May 10, 2024, 03:50 AM
Last activity: May 10, 2024, 03:50 AM