Sabrina Pereira
Posted on February 13, 2023
Download VirtualBox's latest version for Windows and its extension pack from here.
After installing VirtualBox, install the pack by going into tools > extensions then clicking install:
Install vagrant according to their instructions for Linux. All you have to do is to runt he following command in WSL:
wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor | sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update && sudo apt install vagrant
Export some global variables to be able to run vagrant (these need to be reset each time you open a new terminal):
export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
export PATH="$PATH:/mnt/c/Program Files/Oracle/VirtualBox"
You also have to add the folder where your project is located:
export VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH="/mnt/c/<path-to-folder-where-Vagrantfile-is>"
And you have to ssh from PowerShell 🫠
ssh vagrant@127.0.0.1 -p 2222
Add this line to your Vagrantfile
to be able to have a project in your ubuntu file system:
config.vm.synced_folder '.', '/vagrant', disabled: true
For more info on WSL installs, click here.
Posted on February 13, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.