The error message is shown below:
If you have encountered same problem,this solution may help you.
- Installed vagrant
- Vagrant Instance already added to VirtualBox,Vmware or any other provider you use.
- SSH on Vagrant instance set to start on boot up
Step 1: Generate ssh private and public keys using ssh-keygen command.
My vagrant appliance working directory is : ~/vagrant/centos-asterisk-server. This is the same directory that i will put my private and public keys
mkdir -p ~/vagrant/centos-asterisk-server/.ssh
Generate private/private rsa key pair with ssh-keygen
I will use following settings:
Enter file in which to save the key : /home/josepy/vagrant/centos-asterisk-server/.ssh/id_rsa
Enter passphrase (empty for no passphrase): <Press Enter/Return key>
Enter same passphrase again: <Press Enter/Return key>
It will successfully generate RSA 2048 keys. Remember i didn;t set passphrase ( just pressed enter key)
Step 2: Edit Vagrantfile and specify location of generated private key
We’ll add it just below config.vm.box = “” line.We’ll also set “config.ssh.forward_agent” to True.
My username and password that vagrant we’ll login in with are the default:
If you have different username and password, specify them on Vagrantfile
Save the changes and quit.
Step 3: Copy rsa public key to vagrant instance. We’ll start the Virtual Machine with VirtualBox directly.
Make sure ssh is running and port forwarding is configured. Follow steps below
- Open Oracle VirtualBox ( GUI)
- Right click on the name of Virtual Machine and go to settings > Network > Adapter 1 ( NAT) > Port Forwarding
Make sure SSH port forwarding is set, if not add it by clicking on + sign
Name : ssh
Host ip: 127.0.0.1
Host Port: 2200
Guest port: 22
- Copy rsa public key to Virtual Machine
- Stop Virtual Machine ( power off) and start it with vagrant
cd /home/josepy/vagrant/centos-asterisk-server/ vagrant up
You can confirm that key was copied to guest os. Do
Now start Vagrant instance using vagrant up command. It should start without any error,