vagrant (2.1.2) crashes if used with WSL and hyper-v provider

Created on 3 Jul 2018  ยท  4Comments  ยท  Source: hashicorp/vagrant

Vagrant version

2.1.2

Host operating system

Windows 10 (1803) / WSL (Ubuntu 16.04)

config for WSL (besides installed vagrant)

export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
export PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin"
export VAGRANT_DEFAULT_PROVIDER=hyperv
alias docker=docker.exe
alias docker-compose=docker-compose.exe

Guest operating system

any

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "centos/7"
  config.vm.provider "hyperv" do |h|
    h.vm_integration_services = {
      guest_service_interface: true,
      CustomVMSRV: true
    }
  end  
end

Debug output

vagrant up

Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
/opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/util/platform.rb:395:in `wsl_to_windows_path': undefined method `match' for #<Pathname:0x000000000333a538> (NoMethodError)
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/plugins/providers/hyperv/driver.rb:224:in `execute_powershell'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/plugins/providers/hyperv/driver.rb:47:in `execute'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/plugins/providers/hyperv/action/check_enabled.rb:15:in `call'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/action/warden.rb:34:in `call'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/action/builder.rb:116:in `call'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/action/runner.rb:66:in `block in run'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/util/busy.rb:19:in `busy'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/action/runner.rb:66:in `run'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/machine.rb:239:in `action_raw'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/machine.rb:208:in `block in action'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/environment.rb:598:in `lock'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/machine.rb:194:in `call'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/machine.rb:194:in `action'
        from /opt/vagrant/embedded/gems/2.1.2/gems/vagrant-2.1.2/lib/vagrant/batch_action.rb:82:in `block (2 levels) in run'

Expected behavior

bringing up the guest

Actual behavior

see above. i just receive that error message

Steps to reproduce

  1. Install latest vagrant
  2. enable hyper-V as default provider (or use --provider=hyperv)
  3. add user to hyper-v administrator group at Host OS
  4. change into folder with vagrant file and try a vagrant up
WSL hoswindows

Most helpful comment

hi! any temporal solution while 2.1.3 is released?

All 4 comments

hey guys,

just in case i double checked on a second machine (in a complete different environment)
an also there i get the exact error as you see above.

Cheers!

I've just stumbled over the same issue, Windows 10 build 17134 with Ubuntu 16.04 in WSL.

VagrantFile

ruby Vagrant.configure("2") do |config| config.vm.box = "generic/ubuntu1804" end

Relevant Environment Variables

VAGRANT_DEFAULT_PROVIDER=hyperv
VAGRANT_WSL_DISABLE_VAGRANT_HOME=1
VAGRANT_WSL_ENABLE_WINDOWS_ACCESS=1
VAGRANT_HOME=/mnt/h/Vagrant/
VAGRANT_WSL_WINDOWS_ACCESS_USER_HOME_PATH=/mnt/h/Vagrant/

hi! any temporal solution while 2.1.3 is released?

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

janw-me picture janw-me  ยท  3Comments

cbednarski picture cbednarski  ยท  3Comments

OtezVikentiy picture OtezVikentiy  ยท  3Comments

Cbeck527 picture Cbeck527  ยท  3Comments

hesco picture hesco  ยท  3Comments