-1

I start my VNC server via a @reboot vncserver & entry in my user's crontab.

But this seems to cause some problems since the cron environment is restricted. For examples see:

So I would like to know a better way for starting a VNC server for a user under his account.

Frank Breitling
  • 967
  • 1
  • 14
  • 28
  • 1
    you can try adding it to your systemd startup, see http://www.penguintutor.com/linux/tightvnc – Rohin Gopalakrishnan Apr 04 '17 at 16:13
  • But this seems to run vnc server as root. I want to run the vnc server for two different users under their accounts. – Frank Breitling Apr 04 '17 at 16:26
  • 1
    "this seems to run vnc server as root" -> No. Look at line 8 of the startup config file given there and see man systemd.exec. – goldilocks Apr 04 '17 at 16:41
  • Alright. It is a fixed user for a service which needs to be installed by root. So this requires a vnc-user.service for every user. I hope that with the right ownership a user could also restart his vnc.service. I prefer a method which does not involve root (like crontab) more but maybe this provides an alternative solution if cron doesn't work. – Frank Breitling Apr 04 '17 at 17:02
  • This is the same issue as discussed in your other question; probably one of these questions should be made more general and the other deleted. – cjs Apr 05 '17 at 17:36

1 Answers1

0

In your crontab, run your login shell with the option that does full login processing and have it run vncserver, e.g.:

bash -l -c vncserver

This will ensure that a) your preferred shell is used, and b) /etc/profile and your .bash_profile or .profile are read.

cjs
  • 843
  • 1
  • 6
  • 15