Vagrant: Vagrant 1.9.5 to 2.0.0 on WSL Creators Update version (4.4.0-43-Microsoft) asking for vagrant.exe

Created on 11 Sep 2017  ·  9Comments  ·  Source: hashicorp/vagrant

Vagrant version

vagrant versions 1.9.5 to 2.0.0 show this behavior

Host operating system

Windows 10 Enterprise 1703 (OS Build 15063.540)

Guest operating system

Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

lsb_release -a:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.3 LTS
Release: 16.04
Codename: xenial

Vagrantfile


Please note, if you are using Homestead or a different Vagrantfile format, we
may be unable to assist with your issue. Try to reproduce the issue using a
vanilla Vagrantfile first.

Debug output

Gist Debug Output

Expected behavior

[jkeslin@HOSTNAME ~/tmp]$ vagrant global-status
id       name   provider state  directory
--------------------------------------------------------------------
There are no active Vagrant environments on this computer! Or,
you haven't destroyed and recreated Vagrant environments that were
started with an older version of Vagrant.

Actual behavior

[jkeslin@HOSTNAME ~/tmp]$ vagrant global-status
The executable 'vagrant.exe' 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.

Steps to reproduce

  1. Update windows 10 to 1703
  2. Install WSL 16.04
  3. Follow directions on wsl install page and install 1.9.5 or higher
  4. run vagrant global-status or any vagrant command

References

Are there any other GitHub issues (open or closed) that should be linked here?
For example:

  • GH-1234
  • ...
WSL hoswindows

Most helpful comment

@chrisroberts So, for windows 10 with WSL, is it required to have both vagrant for linux and vagrant for windows installed now? What is the correct way of running vagrant in windows 10 in WSL and is the documentation updated also?

All 9 comments

Discussion on vagrant google groups here:

google groups discussion link

https://github.com/hashicorp/vagrant/blob/acd8eb628402bc1684c3fb07193a8180769c28f0/lib/vagrant/util/platform.rb#L446-L447

Does this mean it is actually required to install both Windows and Linux versions of Vagrant? _(yes)_

I'm asking because elsewhere I see people mentioning it should work entirely as standalone in WSL and this comment above, the code and the install guide below seems to suggest the opposite?

https://www.vagrantup.com/docs/other/wsl.html#vagrant-installation

Vagrant must be installed within Ubuntu on Windows. Even though the vagrant.exe file can be executed from within the WSL, it will not function as expected.

I tried installing Vagrant on Windows meanwhile and disk is noisy now so I expect it works..

https://upl.io/vh0kkq

Seems it does.

From the top of the guide:

Installation requires WSL, Ubuntu on Windows, and Vagrant. Read on for installation instructions for each item.

Vagrant is ambigous here (Windows/Linux). Although the "Installation instructions for each item" mentions the Linux-version.

Versions

Vagrant 2.0.0 (Linux|Windows)
test-kitchen 1.18
kitchen-vagrant 1.2.1
VirtualBox 5.1.26 r1172224 (Vagrant supports VirtualBox 5.1 since 1.8.5)

Now try to run an ansible provisioning step in WSL now... does it allow you to run ansible? If you only install windows vagrant, with a windows virtualbox, and then run from wsl, then once it gets to ansible provisioning step for me it complains about not being able to run ansible as a windows host control machine. Ansible has to be run from vagrant on the wsl side which my guess is probably why the code wants it installed in both places.

That was my experience anyways.

@dezza That is only relevant if you have Vagrant installed within the Windows system _and_ within the WSL. If it is installed in both places it will require the same version be in use.

@chrisroberts please explain. I only ever installed the Windows version after numerous attempts at getting Linux-only to work and it ended up asking for vagrant.exe everytime. I never thought you should have both nor did I have before. When it should be asking for “vagrant” it was asking for “vagrant.exe” that is when only vagrant was installed in WSL.

I think I get what you mean - but since it should be possible to run vagrant standalone in WSL this function actually prevents that

https://github.com/hashicorp/vagrant/blob/acd8eb628402bc1684c3fb07193a8180769c28f0/lib/vagrant/util/platform.rb#L380

If there's a a reason behind this please explain. In what case would a user want both Windows and Linux version of Vagrant installed?

If you comment out that function it works as expected.

@dezza There was a missing check when validating versions that's fixed in PR #9107. Fix will be included in the next release.

@chrisroberts So, for windows 10 with WSL, is it required to have both vagrant for linux and vagrant for windows installed now? What is the correct way of running vagrant in windows 10 in WSL and is the documentation updated also?

@jkeslin-argonne Having the vagrant.exe installed within Windows _should not_ be a prerequisite for installing and running Vagrant within the WSL. The missing path check is what is currently requiring it to be installed, and that is only the case when windows access from the WSL is enabled (VAGRANT_WSL_ENABLE_WINDOWS_ACCESS is set). The next release will correct the behavior.

I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DreadPirateShawn picture DreadPirateShawn  ·  3Comments

mpontillo picture mpontillo  ·  3Comments

Cbeck527 picture Cbeck527  ·  3Comments

jazzfog picture jazzfog  ·  3Comments

StefanScherer picture StefanScherer  ·  3Comments