docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.96k forks source link

create with driver hyperv gets stuck on ssh due to ssh private key permissions #4879

Open Alveel opened 3 years ago

Alveel commented 3 years ago

When running docker-machine create -d hyperv on a Windows machine, the process eventually gets stuck:

Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...

The reason is that ssh expects the private key to have a limited amount of permissions, but the responsible function doesn't deal with permissions at all on Windows, so the file will be created with default permissions, which will break the flow. This may work on barebones/basic installations of Hyper-V, but it definitely doesn't work as soon as you modify where VM's are saved.

A manual fix/workaround is to manually fix the permissions as described here.

I would like to propose/suggest using something like go-acl.

Note: I doubt this will ever get fixed in this repo, but it's good to document it for any passersby anyway.