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

kvm2: Cannot open boot2docker.iso: permission denied #5950

Closed
lounicotra opened this issue Nov 19, 2019 · 3 comments
Closed

kvm2: Cannot open boot2docker.iso: permission denied #5950

lounicotra opened this issue Nov 19, 2019 · 3 comments
Labels
co/kvm2-driver KVM2 driver related issues kind/support Categorizes issue or PR as a support question.

Comments

@lounicotra
Copy link

I have also tested this with a couple of previous releases, same results and also your latest beta. I own the .minikube dir under my home directory, so there should not be any permission issues downloading and placing files in the right dirs.

Seems that the boot2docker ISO never gets downloaded or placed in the correct place. Here's a listing of the dir structure after executing "minikube start":

lnicotra@tiger18 .minikube# du
16 ./certs
0 ./machines/minikube
0 ./machines
147212 ./cache/iso
341740 ./cache/images/k8s.gcr.io
500 ./cache/images/gcr.io/k8s-minikube
500 ./cache/images/gcr.io
342240 ./cache/images
489452 ./cache
0 ./config
0 ./addons
0 ./files
0 ./logs
14200 ./bin
4 ./profiles/minikube
4 ./profiles
503672 .

Deleting via "minikube delete" does not change the outcome...

Also, should you be providing a basic config.json file? That is also not being created. Please provide a link to a downloadable one if necessary so the user can at least start minikube.

Thanks.

The full output of the command that failed:

lnicotra@tiger18 ~# minikube start
minikube v1.5.2 on Centos 7.3.1611
Automatically selected the 'kvm2' driver (alternates: [none])
Downloading driver docker-machine-driver-kvm2:
> docker-machine-driver-kvm2.sha256: 65 B / 65 B [-------] 100.00% ? p/s 0s
> docker-machine-driver-kvm2: 13.87 MiB / 13.87 MiB [----] 100.00% ? p/s 0s
Downloading VM boot image ...
> minikube-v1.5.1.iso.sha256: 65 B / 65 B [--------------] 100.00% ? p/s 0s
> minikube-v1.5.1.iso: 143.76 MiB / 143.76 MiB [-] 100.00% 42.13 MiB p/s 4s
Creating kvm2 VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
Retriable failure: create: Error creating machine: Error in driver during machine creation: error creating VM: virError(Code=1, Domain=10, Message='internal error: qemu unexpectedly closed the monitor: 2019-11-19T16:08:16.757609Z qemu-kvm: -drive file=/home/lnicotra/.minikube/machines/minikube/boot2docker.iso,format=raw,if=none,id=drive-scsi0-0-0-2,readonly=on: could not open disk image /home/lnicotra/.minikube/machines/minikube/boot2docker.iso: Could not open '/home/lnicotra/.minikube/machines/minikube/boot2docker.iso': Permission denied')
Deleting "minikube" in kvm2 ...
Retriable failure: Error loading existing host. Please try running [minikube delete], then run [minikube start] again.: filestore "minikube": open /home/lnicotra/.minikube/machines/minikube/config.json: no such file or directory
Retriable failure: Error loading existing host. Please try running [minikube delete], then run [minikube start] again.: filestore "minikube": open /home/lnicotra/.minikube/machines/minikube/config.json: no such file or directory
Retriable failure: Error loading existing host. Please try running [minikube delete], then run [minikube start] again.: filestore "minikube": open /home/lnicotra/.minikube/machines/minikube/config.json: no such file or directory

X Unable to start VM: Error loading existing host. Please try running [minikube delete], then run [minikube start] again.: filestore "minikube": open /home/lnicotra/.minikube/machines/minikube/config.json: no such file or directory

Sorry that minikube crashed. If this was unexpected, we would love to hear from you:

The output of the minikube logs command:
lnicotra@tiger18 ~# minikube logs
*
X api load: filestore "minikube": open /home/lnicotra/.minikube/machines/minikube/config.json: no such file or directory
*

The operating system version: CentOS 7.3.1611

@tstromberg tstromberg changed the title Issue while installing minikube v1.5.2 on Centos 7.3 kvm2: Cannot open boot2docker.iso: permission denied Nov 20, 2019
@tstromberg tstromberg added co/kvm2-driver KVM2 driver related issues kind/support Categorizes issue or PR as a support question. labels Nov 20, 2019
@tstromberg
Copy link
Contributor

tstromberg commented Nov 20, 2019

I suspect this may be an issue with how libvirt is configured on this machine: I suspect that it may be running qemu as another user that does not have access to your ISO.

Do you mind sharing the output of the following command:

  • id
  • id libvirt-qemu
  • file /home/lnicotra/.minikube/machines/minikube/boot2docker.iso
  • ls -lad /home/lnicotra/
  • ls -lad /home/lnicotra/.minikube
  • grep "user =" /etc/libvirt/qemu.conf

I am no KVM expert, but I suspect the solution will be:

  • Find the user that libvirt is starting QEMU as. On my system, it's libvirt-qemu.
  • Make sure that the user has access to traverse your home directory. For me, I ended up with chmod 0711 $HOME.

Alternatively:

  • You could change QEMU to run as your user or root. See /etc/libvirt/qemu.conf
  • Set MINIKUBE_HOME to be in a directory where the qemu user has access

@lounicotra
Copy link
Author

Thanks for your reply... Here's what I found...

It seems that the permission error is due to our home dirs being auto-mounted from a central server via nfs. Looks like it does not like to write across NFS mounts even though that is the current config for all our processing (DNN training)

Once I defined MINIKUBE_HOME to a local file system, everything started to work correctly

So, the issue is considered resolved...

Thanks!

@peterbecich
Copy link
Contributor

home dirs being auto-mounted from a central server via nfs.

Similar case here. I believe same error caused by MINIKUBE_HOME=/var/lib/docker/minikube, where this is a virtual partition. Despite it having the same permissions/ownership as my home folder.

peterbecich added a commit to peterbecich/minikube that referenced this issue Sep 2, 2024
Error message was
"Ensure that the user listed in /etc/libvirt/qemu.conf has access to your home directory"

It is not always the home directory

related issue: kubernetes#5950

I have not translated this correctly.
peterbecich added a commit to peterbecich/minikube that referenced this issue Sep 2, 2024
Error message was
"Ensure that the user listed in /etc/libvirt/qemu.conf has access to your home directory"

It is not always the home directory

related issue: kubernetes#5950

I have not translated this correctly.
peterbecich added a commit to peterbecich/minikube that referenced this issue Sep 2, 2024
Error message was
"Ensure that the user listed in /etc/libvirt/qemu.conf has access to your home directory"

It is not always the home directory

related issue: kubernetes#5950

I have not translated this correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/kvm2-driver KVM2 driver related issues kind/support Categorizes issue or PR as a support question.
Projects
None yet
Development

No branches or pull requests

3 participants