Trying to setup vcn on display :0

Hello,

I’m trying to setup vnc to enable me to login and see what my dad sees on his computer when he’s having difficulties (i’d prefer not to use teamviewer if i don’t have to). if i run
x0vncserver -display :0 -rfbauth /home/angus/.vnc/passwd as root it works fine. but when i try to set up a systemd service i run into problems
my service details are

cat /etc/systemd/system/x0vncserver.service 
[Unit]
Description=Remote desktop service (VNC)
After=network-online.target

[Service]
Type=simple
User=root

ExecStart=/usr/bin/x0vncserver -display :0 -passwordfile /home/angus/.vnc/passwd

[Install]
WantedBy=multi-user.target

when i try to start it i get

systemctl status x0vncserver.service 
● x0vncserver.service - Remote desktop service (VNC)
     Loaded: loaded (/etc/systemd/system/x0vncserver.service; disabled; vendor preset: disabled)
     Active: failed (Result: exit-code) since Sun 2020-08-02 23:15:43 BST; 1s ago
    Process: 10992 ExecStart=/usr/bin/x0vncserver -display :0 -passwordfile /home/angus/.vnc/passwd (code=exited, status=1/FAILURE)
   Main PID: 10992 (code=exited, status=1/FAILURE)
        CPU: 6ms

Aug 02 23:15:43 john systemd[1]: Started Remote desktop service (VNC).
Aug 02 23:15:43 john x0vncserver[10992]: No protocol specified
Aug 02 23:15:43 john x0vncserver[10992]: /usr/bin/x0vncserver: unable to open display ":0"
Aug 02 23:15:43 john systemd[1]: x0vncserver.service: Main process exited, code=exited, status=1/FAILURE
Aug 02 23:15:43 john systemd[1]: x0vncserver.service: Failed with result 'exit-code'.

i’ve had a bit of a google and i turned up a couple of results that suggested wayland might be the issue. but as far as i can see, i’m using x11. i’m using kde on fedora 32 and loginctl show-session 2 -p Type shows Type=x11

i’d like to be able to run this as a service if possible. any help greatly appreciated

Try this way: Fedora 32 workstation sharing screen not working after upgrade from fedora 31

Thanks @vgaetera. I’m using KDE plasma but I found krfb which does the same thing as the gnome application you mentioned. Thanks for your help. It’s pretty much ideal for my use case

1 Like