Azure / vagrant-azure

Enable Vagrant to manage virtual machines in Microsoft Azure
MIT License
315 stars 112 forks source link

SOLVED: private_key_path file must exist: ~/.ssh/id_rsa #234

Open mloskot opened 5 years ago

mloskot commented 5 years ago

I'm using the v2.0.0 on Windows 10. I am following the steps in the current README.md, having now all az set up, logged in and environment variables set.

Now, using the sample/default Vagrantfile from the README for config.vm.box = 'azure' fails for me with this:

PS D:\_\vagrant\vagrant-azure> vagrant up --provider=azure
There are errors in the configuration of this machine. Please fix
the following errors and try again:

SSH:
* `private_key_path` file must exist: ~/.ssh/id_rsa

PS D:\_\vagrant\vagrant-azure>
mloskot commented 5 years ago

I will answer my own questions:

Is there anything missing from the docs about the SSH private key and ~/.ssh/id_rsa path?

Yes, mention that the ~/.ssh/id_rsa is nothing default to copy from somewhere but a key that user needs to generate.

Is user supposed to ssh-keygen-generate it prior provisioning the VM? It is the host location, isn't it?

Yes.

$ cd vagrant-azure
$ ssh-keygen -t rsa  -f azure_private_key.id_rsa

and then update the line in the Vagrantfile to read

config.ssh.private_key_path = File.join(File.dirname(__FILE__), 'azure_private_key.id_rsa')
dikkedimi commented 4 years ago

yay, this solved my issue :D was trying to get FlatCAMworking on macOS Catalina using Jay Wiggins' guide and got stuck at vagrant up --provision

leaving this comment as a breadcrumb for others attempting the same (and myself, if i ever forget)