Re4son / RPi-Tweaks

GNU General Public License v3.0
215 stars 55 forks source link

Failed to start vncserver@.service #3

Closed nicholasadamou closed 6 years ago

nicholasadamou commented 6 years ago

I downloaded and enabled the vncserver@ service, however, systemctl doesn't want to start it.

After running: sudo systemctl start /ib/systemd/system/vncserver@.service I am presented with the following error:

Failed to start ib-systemd-system-vncserver\x40.service.mount: Unit ib-systemd-system-vncserver\x40.service.mount not found.

Why?

Additionally, simply running: sudo systemctl start vncserver@.service will invoke the following error:

Failed to start vncserver@.service: Unit name vncserver@.service is missing the instance name.

See system logs and 'systemctl status vncserver@.service' for details.

Running: systemctl status vncserver@.service outputs:

Failed to get properties: Unit name vncserver@.service is neither a valid invocation ID nor unit name.

Re4son commented 6 years ago

Just assign a unique ID to the instant you are starting, e.g. sudo systemctl enable vncserver@1.service && sudo systemctl start vncserver@1.service

Notice the "1" after the @? That's the ID it is expecting.

Please let me know how you go

nicholasadamou commented 6 years ago

sudo systemctl enable vncserver@1.service returns:

failed to enable unit: unit file vncserver@1.service does not exist

This does work when I type the following command:

sudo systemctl enable /lib/systemd/system/vncserver@.service.

However, I am able to start the service after typing:

sudo systemctl enable /lib/systemd/system/vncserver@.service && sudo systemctl start vncserver@1.service

Additionally, please keep in mind that on subsequent reboots, the service is never started. Is that because I am enabling vncserver@.service and not vncserver@1.service?

Re4son commented 6 years ago

Where did you put the service file?

nicholasadamou commented 6 years ago

I put it in /lib/systemd/system/

Re4son commented 6 years ago

Should work. This just worked for me without any problems:

root@kali-pi:/home/re4son# wget -O /lib/systemd/system/vncserver@.service https://github.com/Re4son/vncservice/raw/master/vncserver@.service

root@kali-pi:/home/re4son# systemctl enable vncserver@1.service && sudo systemctl start vncserver@1.service

root@kali-pi:/home/re4son#  systemctl status vncserver@1
â vncserver@1.service - VNC Service for remote desktop sharing
   Loaded: loaded (/lib/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2018-04-10 06:28:49 AEST; 26s ago
  Process: 840 ExecStart=/usr/bin/vncserver :1 (code=exited, status=0/SUCCESS)

Are you using Sticky Fingers or stock Kali?

nicholasadamou commented 6 years ago

Okay, well after re-running the below commands, everything seems to be running smoothly now. Don't know what was going wrong, but seems to work now.

  1. wget -O /lib/systemd/system/vncserver@.service https://github.com/Re4son/vncservice/raw/master/vncserver@.service

  2. systemctl enable vncserver@1.service && sudo systemctl start vncserver@1.service

neofit77 commented 4 years ago

Tnx @nicholasadamou this is solved my problem

mabmgc commented 3 years ago

Thank you, @nicholasadamou seem to work with other services as well!