dhiltgen / docker-machine-kvm

KVM driver for docker-machine
Apache License 2.0
377 stars 117 forks source link

dial tcp: missing address #13

Open padcom opened 8 years ago

padcom commented 8 years ago

Error while creating KVM-based machine using docker-machine 0.6.0

$ docker-machine create --driver kvm -v node01 dial tcp: missing address

Using v0.6.0 for both kvm plugin and docker-machine on Linux Mint 17.3 (based on Ubuntu 14.04.4).

Is there anything else I should specify or is this a bug?

dhiltgen commented 8 years ago

I'm not sure, but that might be a case of missing permissions on the libvirt socket. I'd like to improve the driver to verify permissions and what not, and provide better error messages when things aren't quite set up properly. Until then, you should try to use another libvirt client to make sure you can create a VM first using your account (not sudo'd) You can try virsh, or the virt-manager GUI.

If you're able to successfully create a VM with other tools, and the driver still doesn't work, try running a create with debug enabled and post the results on this issue.

ogrisel commented 8 years ago

I had the same issue. I could fix it by adding my user id to the libvirtd group in /etc/group and creating a new session with that user on the machine (either via a new ssh connection to localhost or by logging out and logging in again from my desktop environment).

R-omk commented 8 years ago

I want to run docker machine with kvm driver inside a docker container, but "dial tcp: missing address". I need to run docker machine for ci.

ekuefler commented 8 years ago

My situation is the same as @R-omk's in that I'm trying to run inside of a docker container, so logout/login is trickier. In case anyone wants to try and reproduce this, the following commands will do it on my Ubuntu machine:

$ docker run --privileged -it debian
root@22567f5ad1d7:/# apt-get update && apt-get install libvirt-bin qemu-kvm curl wget
root@22567f5ad1d7:/# curl -L https://github.com/docker/machine/releases/download/v0.8.0-rc2/docker-machine-`uname -s`-`uname -m` >/usr/local/bin/docker-machine &&   chmod +x /usr/local/bin/docker-machine
root@22567f5ad1d7:/#  wget https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm && chmod +x docker-machine-driver-kvm && mv docker-machine-driver-kvm /usr/local/bin/
root@22567f5ad1d7:/# docker-machine create -d kvm myengine0
dial tcp: missing address
phillipp commented 8 years ago

I have the exact same problem. Debugging said:

() DBG | Failed to connect to libvirt: [Code-38] [Domain-7] Failed to connect socket to '/var/run/libvirt/libvirt-sock': No such file or directory

What I don't know is: what/who should be creating said socket?

karora commented 8 years ago

I am seeing the same symptoms, but I think the underlying issue is different. This is on Debian Sid:

If I run the docker-machine-driver-kvm as myself, I get: Failed to connect to libvirt: [Code-89] [Domain-47] error from service: CheckAuthorization: Message recipient disconnected from message bus without replying

As root, things work as expected.

However, as my own user I can happily use (e.g.) virsh create ... to create a VM, a network, etc. This is using the qemu:///session connection rather than qemu:///system and if I change:

connectionString   = "qemu:///session"

and now when I run docker-machine-driver-kvm as myself, I get:

This is a Docker Machine plugin binary. Plugin binaries are not intended to be invoked directly. Please use this plugin through the main 'docker-machine' binary. (API version: 1)

Yay! :-)

Hope this helps...

Note that my ~/.config/libvirt/libvirt.conf

uri_default = "qemu:///session"

And my environment also has:

LIBVIRT_DEFAULT_URI=qemu:///session

So neither of those are being used, although strace does show the ~/.config/libvirt/libvirt.conf being opened, which was how I discovered the file in the first place.

Thanks, Andrew McMillan

jgedarovich commented 7 years ago

I had same issue as phillipp on fedora 24 - fixed with a restart.

paoloantinori commented 7 years ago

On Fedora 24, I'm seeing the same issue discussed here, but nothing worked so far.

Not working even for root user and strace does not suggest what the problem might be.

gliptak commented 7 years ago

On Red Hat Enterprise Linux Server release 7.1 (Maipo) after a reboot

docker-machine create -d kvm myengine0
Creating CA: /home/user/.docker/machine/certs/ca.pem
Creating client certificate: /home/user/.docker/machine/certs/cert.pem
Running pre-create checks...
Error with pre-create check: "[Code-43] [Domain-19] Network not found: no network with matching name 'default'"
gliptak commented 7 years ago

http://wiki.libvirt.org/page/Networking

# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 docker-machines      active     yes           yes

Is there a (command line) override available? Thanks

ceridwen commented 7 years ago

Was #18 supposed to have fixed all instances of this issue? I ran into this problem while trying to get Minikube running inside a Docker container (https://github.com/kubernetes/minikube/issues/927 and https://github.com/kubernetes/minikube/issues/278). The container is Debian Jessie, freshly downloaded from Dockerhub, Docker version 17.03.1-ce build c6d412e, docker-machine version 0.12.0 build 45c69ad, docker-machine-vm 10.0. Running docker-machine create --driver kvm dev while logged into the container as root gives dial tcp: missing address. The outer Docker version is the same. It's running on MacOS 10.12.5 (16F73).

insidewhy commented 7 years ago

Getting this problem on archlinux with the latest version of everything. Whether I am root or not I get this error and nothing suggested helps.

diegom626 commented 7 years ago

For anyone who is having troubles with this error. if you're trying to install the plugin under Debian 8 the last release of this plugin uses a recent version of "libvirt.so.0" library, Debian Jessie use the libvirt.so.0.1002.9, so you have to install an older release of this plugin like docker-machine-kvm "v0.6.0". it should work that way.

anjannath commented 7 years ago

@ohjames I too had the issue, starting the libvirtd service fixed it. sudo systemctl start libvirtd But other errors starts to show up. like: Requested operation is not valid: network 'default' is not active

To fix the second error, you have to set the default network interface to active, to fix it sudo virsh net-start deafult active you can list the network cards by sudo virsh net-list --all

zchef2k commented 6 years ago

Not sure if its relevant here or better suited for the Rancher folks, but trying to import the driver into a Rancher container running docker-machine yields the same result.

Error dialing to plugin server's address(), err=dial tcp: missing address

tariksimsek commented 8 months ago

anyone solved this for rancher?