Overview:
Part 1 of this article explains the setup for Vagrant in WSL – Bash on Ubuntu on Windows
If you’ve got Vagrant up and running, then setting up VVV is the same as in Linux. However, I had a lot of issues with SSH. And vagrant ssh would just hang in my case. I was finally able to log into the vagrant box using the ssh command with the vagrant ssh-config configuration.
Here are the steps to get VVV working:
Step 1: Vagrant up
- Run your WSL – Bash as Administrator. You could try running vagrant up as a regular user (non admin) but it didn’t work for me.
2. Download VVV (Varying-Vagrant-Vagrants) to your system using git or manually and navigate to the directory.
3. Assuming you’ve added symbolic links you can run vagrant up from here. In case you haven’t you need to run vagrant.exe up
4. Test that it’s running with vagrant status
Step 2: Setting up the host entries
- If you were not able to open vvv.dev in your browser but can open 192.168.50.4 you will need to add the host entries in your Windows hosts file. The Windows hosts file is located under c:\Windows\System32\Drivers\etc\hosts
- In my case I have setup another vagrant instance – sandbox.dev which is why you will see an additional entry below
Step 3: Vagrant ssh
Now run vagrant ssh or vagrant.exe ssh. If it worked for you, great! If it didn’t here’s how I got mine to work as vagrant ssh would just hang.
Note: I was able to putty the VVV instance using this approach but I wanted ssh to work from the SHELL. If you have a better way do let me know.
- Run vagrant ssh-config from withing your vvv directory
- Create a new file under the hidden .ssh directory in your Home directory.
- Make sure it has permissions 600 only by using the chmod command as below
>chmod 600 ~/.ssh/config
- Copy the contents of vagrant ssh-config to ~/.ssh/config
- Alter the IdentityFile path using the UNIX path notation
6. Now run ssh as below. It will prompt you for a password. The default password is vagrant
>ssh vagrant@127.0.0.1 -p 2222
That’s it.
We have VVV running from within BASH on Windows 10.
Leave a Reply