I'm trying to start VNC server in systemd in user mode automatically after boot. Using Arch Linux running as virtual machine.
VNC server is Tiger VNC:
$ pacman -Qs vnc
local/tigervnc 1.9.0-1
Suite of VNC servers and clients. Based on the VNC 4 branch of TightVNC.
/home/raspi/vnc.service
:
[Unit]
Description=Remote desktop service (VNC)
[Service]
Type=simple
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill :1 > /dev/null 2>&1 || :'
ExecStart=/usr/bin/vncserver :1 -geometry 1920x1080 -alwaysshared -fg -name remote
ExecStop=/usr/bin/vncserver -kill :1
[Install]
WantedBy=default.target
Linger is enabled:
$ loginctl show-user raspi | grep -i linger
Linger=yes
Installed with:
$ systemctl --user enable /home/raspi/vnc.service
Created symlink /home/raspi/.config/systemd/user/default.target.wants/vnc.service → /home/raspi/vnc.service.
Created symlink /home/raspi/.config/systemd/user/vnc.service → /home/raspi/vnc.service.
Started with:
$ systemctl --user start vnc.service
I can start it and connect to it but it doesn't automatically start when system boots. I have to log in and run systemctl --user start vnc.service
manually. What I'm missing?