5

Using this guide: https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/infrastructure-services/TigerVNC/#TigerVNC.adoc#configuring-vncserver

It is a single user setup, at the systemctl start vncserver@:display_number.service step, and changing display_number appropriately, I get this message:

Job for vncserver@:0.service failed because the control process exited with error code.

See "systemctl status vncserver@:0.service" and "journalctl -xeu vncserver@:0.service" for details.

After running the first command:

× vncserver@:0.service - Remote desktop service (VNC)

Loaded: loaded (/etc/systemd/system/[email protected]; disabled; vendor preset: disabled)

Active: failed (Result: exit-code) since Mon 2022-01-24 04:09:20 CET; 10s ago

Process: 7899 ExecStart=/sbin/runuser -l (MY USERNAME HERE, REMOVED FOR PRIVACY) -c /usr/bin/vncserver :0 -geometry 1920x1080 (code=exited, status=203/EXEC)

CPU: 1ms


Jan 24 04:09:20 fedora systemd[1]: Starting Remote desktop service (VNC)...

Jan 24 04:09:20 fedora systemd[7899]: vncserver@:0.service: Failed to execute /sbin/runuser: Permission denied

Jan 24 04:09:20 fedora systemd[7899]: vncserver@:0.service: Failed at step EXEC spawning /sbin/runuser: Permission denied

Jan 24 04:09:20 fedora systemd[1]: vncserver@:0.service: Control process exited, code=exited, status=203/EXEC

Jan 24 04:09:20 fedora systemd[1]: vncserver@:0.service: Failed with result 'exit-code'.

Jan 24 04:09:20 fedora systemd[1]: Failed to start Remote desktop service (VNC).

What should I do? I have seen others with similar issues, but none are exactly like this, regarding this specific file.

  • What happens if you try display number 1 (rather than 0)? – rickhg12hs Jan 24 '22 at 17:51
  • @rickhg12hs same thing unfortunately –  Jan 24 '22 at 19:39
  • Does `sudo runuser -c whoami` work? – rickhg12hs Jan 24 '22 at 19:56
  • @rickhg12hs yup, output is root –  Jan 24 '22 at 21:20
  • As regular user, does running `/usr/bin/vncserver :0 -geometry 1920x1080` work or provide any useful error messages? – rickhg12hs Jan 25 '22 at 14:49
  • @rickhg12hs sorry for the late reply, this doesn't work when using :0 because of tmp/. X0-lock, other ports work, although it complains that I should've used systemd. The vncserver is running but I always get timeouts when trying to connect to them. –  Feb 09 '22 at 03:49
  • I appear to have the same problem here. Using systemctl to start the service gives the above complaint about permissions for runuser. I'm using '1' not '0'. This is on Fedora 36. There don't appear to be any lock files in /tmp, and sudo runuser -c whoami says 'root'. – mderouss Jun 22 '22 at 14:00

1 Answers1

3

I went through the same issue as you in Fedora 36, when following same guide

https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/infrastructure-services/TigerVNC/#TigerVNC.adoc#configuring-vncserver

To make it work, first undid the changes done to the file copied over to /etc/systemd/system/[email protected]. Basically issue again

# cp /lib/systemd/system/[email protected] /etc/systemd/system/[email protected]

Then also you will need to do the following

vi ~/.vnc/config
# create new
# session=(display manager you use)
# securitytypes=(security options)
# geometry=(screen resolution)

session=gnome
securitytypes=vncauth,tlsvnc
geometry=800x600 

And

vi /etc/tigervnc/vncserver.users
# add to the end
# specify [:(display number)=(username] as comments
# display number 1 listens port 5901
# display number n + 5900 = listening port
#
# This file assigns users to specific VNC display numbers.
# The syntax is <display>=<username>. E.g.:
#
# :2=andrew
# :3=lisa
:1=fedora
:2=redhat

For more info see https://www.server-world.info/en/note?os=Fedora_34&p=desktop&f=6

Now, when doing sudo systemctl status vncserver@:1.service, I can see the following:

● vncserver@:1.service - Remote desktop service (VNC)
     Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: disabled)
     Active: active (running) since Wed 2022-06-22 22:56:07 CEST; 18s ago
    Process: 7877 ExecStartPre=/usr/libexec/vncsession-restore :1 (code=exited, status=0/SUCCESS)
    Process: 7890 ExecStart=/usr/libexec/vncsession-start :1 (code=exited, status=0/SUCCESS)
   Main PID: 7897 (vncsession)
      Tasks: 0 (limit: 9190)
     Memory: 1.0M
        CPU: 48ms
     CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
             ‣  7897 /usr/sbin/vncsession USER :1