Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The "kvm2" driver should not be used with root privileges. #5801

Closed
sprabhakaran opened this issue Oct 31, 2019 · 9 comments
Closed

The "kvm2" driver should not be used with root privileges. #5801

sprabhakaran opened this issue Oct 31, 2019 · 9 comments
Labels
kind/support Categorizes issue or PR as a support question.

Comments

@sprabhakaran
Copy link

Hi, I am trying to start the minikube with kvm2 driver. I getting the below while starting the minikube.

minikube start --vm-driver kvm2
😄  minikube v1.4.0 on Ubuntu 18.04
🛑  The "kvm2" driver should not be used with root privileges.
💡  If you are running minikube within a VM, consider using --vm-driver=none:
📘    https://minikube.sigs.k8s.io/docs/reference/drivers/none/

I have used the below wiki for setting up the minikube.

https://kubernetes.io/blog/2019/03/28/running-kubernetes-locally-on-linux-with-minikube-now-with-kubernetes-1.14-support/

Any help would be appreciated.

@nanikjava
Copy link
Contributor

Try sudo minikube start --vm-driver=kvm2

@sprabhakaran
Copy link
Author

sprabhakaran commented Oct 31, 2019

Try sudo minikube start --vm-driver=kvm2

Facing the same error.

@medyagh
Copy link
Member

medyagh commented Oct 31, 2019

Thank you for creating this issue. I am curious are you running kvm inside a VM or a cloud VM?

If yes for that you would need to have a VM that supports nested virtualization.

Alternatively inside a VM you could use the none driver instead of kvm (which skips vm and installs on baremetal)

@nanikjava
Also the only place you need sudo is none driver. All other drivers don't need sudo. We are trying to make none driver also not use sudo soon

@tstromberg
Copy link
Contributor

tstromberg commented Oct 31, 2019

🛑 The "kvm2" driver should not be used with root privileges.

The answer is to not run minikube as the root user. If you note, https://kubernetes.io/blog/2019/03/28/running-kubernetes-locally-on-linux-with-minikube-now-with-kubernetes-1.14-support/ does not do so.

If minikube continues to fail as a non-root user, I encourage you to update to the latest minikube and provide the output of minikube start --alsologtostderr -v=1. Thank you!

@tstromberg tstromberg added the kind/support Categorizes issue or PR as a support question. label Oct 31, 2019
@tstromberg tstromberg changed the title Unable to start minikube with kvm2 driver in ubuntu 18.04 The "kvm2" driver should not be used with root privileges. Oct 31, 2019
@AsherShoshan
Copy link

But how to run WITH root privileges?
Should I create non-root user for this?

@tstromberg
Copy link
Contributor

tstromberg commented Dec 10, 2019 via email

@girishell
Copy link

You need to run libvirt as ur user..Then this error will go away.
sudo getent group | grep libvirt
sudo getent group | grep libvirtd
If it doesn’t exist, add it as system group.
sudo groupadd --system libvirt
sudo usermod -a -G libvirt $(whoami) << admin
newgrp libvirt
Open the file /etc/libvirt/libvirtd.conf for editing.
unix_sock_group = "libvirt"
unix_sock_rw_perms = "0770"
sudo systemctl restart libvirtd.service

@mdmustafa1
Copy link

Yes. Alternatively you may pass --force, but in general it is not recommended to execute programs as root unless required.

On Tue, Dec 10, 2019, 2:46 AM AsherShoshan @.> wrote: But how to run WITH root privileges? Should I create non-root user for this? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#5801?email_source=notifications&email_token=AAAYYMBINSCVE3MB7EVGI6TQX5XRRA5CNFSM4JHFLJB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGOZSWI#issuecomment-563976537>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAYYMBXJRZR3UFJ6LZ5YF3QX5XRRANCNFSM4JHFLJBQ . On Tue, Dec 10, 2019, 2:46 AM AsherShoshan @.> wrote: But how to run WITH root privileges? Should I create non-root user for this? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#5801?email_source=notifications&email_token=AAAYYMBINSCVE3MB7EVGI6TQX5XRRA5CNFSM4JHFLJB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGOZSWI#issuecomment-563976537>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAYYMBXJRZR3UFJ6LZ5YF3QX5XRRANCNFSM4JHFLJBQ .

thanks it worked for me, before i was tried with lot of different vms, but after all we was found that same error. but after using, --force flage. i got solved.
but please explain me once, why we shouldn't use this service as a root?

@afbjorklund
Copy link
Collaborator

but please explain me once, why we shouldn't use this service as a root?

Please continue the conversion in #8257 instead of this old issue, thanks.

The issue is not running the VM as root (that is a requirement for libvirt),
it is about running minikube and kubectl and handling the files as root...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

8 participants