Search code examples
powershellvagrantvirtualboxgit-bashvagrantfile

Vagrant and Virtual Box both installed still my vagrant up command giving path error


I am using git bash and vagrant file is already added to my project but when I am trying to run VAGRANT UP command it gives this error :

$ vagrant up
The executable 'powershell' Vagrant is trying to run was not
found in the %PATH% variable. This is an error. Please verify
this software is installed and on the path.

Help me to fix this.

The vagrant file contains:

Vagrant.configure("2") do |config|

Solution

  • What solved my issue was the a comment I found by antoinebou13 here

    PC: WSL ubuntu 18.04 Windows 10 with installed vagrant 2.2.7 and virtualbox 6.1

    curl -O https://releases.hashicorp.com/vagrant/2.2.7/vagrant_2.2.7_x86_64.deb
    sudo apt install ./vagrant_2.2.7_x86_64.deb
    export PATH="$PATH:/mnt/c/Program Files/Oracle/VirtualBox"
    export PATH="$PATH:/mnt/c/Windows/System32/WindowsPowerShell/v1.0"
    export PATH="$PATH:/mnt/c/WINDOWS/system32"
    export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
    

    Also put your project in the /mnt/c/ directory https://www.vagrantup.com/docs/other/wsl.html