0

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?

3

1 Answer 1

0

You are missing that your per-user service management does not itself start at bootstrap in the default configuration. It starts when you first log on, the consequence of a hook by the service manager into the login system.

Further reading

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .