0

For example, I want to run minikube start.

First I created the following minikube.service file:

[Unit]
Description=Runs minikube on startup
After=vboxautostart-service.service vboxballoonctrl-service.service vboxdrv.service vboxweb-service.service

[Service]
Type=forking
ExecStart=/usr/local/bin/minikube start

[Install]
WantedBy=multi-user.target

Then I enabled it and on the next reboot the systemd framework attempted to run it. However, it failed because apparently the minikube start command is not supposed to run as root:

The "virtualbox" driver should not be used with root privileges.

How can I run it under a non admin user?

mark
  • 691
  • 2
  • 14
  • 31
  • This should be a `oneshot`, not a `forking` type, with `RemainAfterExit=yes`, and should have an `ExecStop=` defined to stop minikube. – Michael Hampton Sep 25 '20 at 17:31
  • This is fantastic input. Could you answer here - https://serverfault.com/questions/1035376/how-to-run-minikube-start-as-a-linux-service-on-startup so I could credit you? – mark Sep 25 '20 at 18:08

1 Answers1

0

You can define which user have to be used bu the service. For example:

[Unit]
...

[Service]
Type=forking
ExecStart=/usr/local/bin/minikube start
User=user1
Group=group1

...
kofemann
  • 4,308
  • 1
  • 21
  • 27