Open audriusk opened 7 years ago
@audriusk I figured this one out: it is due to ~/.docker/machine/machines/myvm1
not having enough executable bit for group:
...
(docker-machine-01) DBG | Verifying executable bit set on /home/zakame/.docker/machine/machines/docker-machine-01
(docker-machine-01) DBG | Setting executable bit set on /home/zakame/.docker/machine/machines/docker-machine-01
(docker-machine-01) DBG | Verifying executable bit set on /home/zakame/.docker/machine/machines
(docker-machine-01) DBG | Verifying executable bit set on /home/zakame/.docker/machine
(docker-machine-01) DBG | Verifying executable bit set on /home/zakame/.docker
(docker-machine-01) DBG | Verifying executable bit set on /home/zakame
(docker-machine-01) DBG | Verifying executable bit set on /home
...
[zakame:~] 5s 1 % ls -l .docker/machine/machines/
total 0
drwx-----x 1 zakame users 126 Jul 19 18:06 docker-machine-01
Adding the group execute bit on the machine-specific directory (in my case, docker-machine-01
) will make it work:
[zakame:~] % chmod g+x .docker/machine/machines/docker-machine-01/
[zakame:~] % docker-machine -D start docker-machine-01
Docker Machine Version: 0.12.0, build 45c69ad
Found binary path at /home/zakame/src/go/bin/docker-machine-driver-kvm
Launching plugin server for driver kvm
Plugin server listening at address 127.0.0.1:46441
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
command=start machine=docker-machine-01
Starting "docker-machine-01"...
(docker-machine-01) Calling .GetState
(docker-machine-01) DBG | Getting current state...
(docker-machine-01) DBG | Fetching VM...
(docker-machine-01) Calling .Start
(docker-machine-01) DBG | Starting VM docker-machine-01
...
(docker-machine-01) DBG | GetIP called for docker-machine-01
(docker-machine-01) DBG | Failed to retrieve dnsmasq leases from /var/lib/libvirt/dnsmasq/docker-machines.leases
(docker-machine-01) DBG | IP address: 192.168.42.209
(docker-machine-01) DBG | Unable to locate IP address for MAC 52:54:00:99:e8:b0
(docker-machine-01) Calling .GetState
(docker-machine-01) DBG | Getting current state...
Machine "docker-machine-01" was started.
...
Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.
Making call to close driver server
(docker-machine-01) Calling .Close
Successfully made call to close driver server
Making call to close connection to plugin binary
[zakame:~] 40s %
Will post a PR in a bit.
Thanks for the fix @zakame and sorry for long delay. I decided to go with (slightly modified version of) it and submitted a build script to SlackBuilds.org, even though I'm not feeling comfortable changing the default behavior on directory permissions. Still think it's better than having non-functional docker-machine-kvm on Slackware.
minikube's kvm2 driver also exhibits this issue.
I intend to publish Slackware build script for docker-machine-kvm so that other Slackware users could benefit from it. I have the script written, but I'm experiencing permission problems when trying to use docker-machine-kvm.
docker-machine version is 0.11.0, libvirt is 3.2.0, qemu is 2.8.1. libvirt is built using
--with-qemu-group=users
, in/etc/libvirt/qemu.conf
group is set tousers
as well, the line where user is set is commented. qemu is built to set/dev/kvm
group tousers
. Let me know if you need additional information.When trying to create VM the following happens:
The permissions of VM files:
I've found that the only way to make it work is to set user to myself (
audrius
) and group tousers
in/etc/libvirt/qemu.conf
, but setting it like this causes permission problems with existing regular VMs in/var/lib/libvirt/images/
and doesn't feel right in general.