Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vagrant up (2.2.2) not working in WSL #10576

Closed
ivan-radic opened this issue Jan 9, 2019 · 6 comments
Closed

Vagrant up (2.2.2) not working in WSL #10576

ivan-radic opened this issue Jan 9, 2019 · 6 comments

Comments

@ivan-radic
Copy link

Hi there,

On fresh install of Windows 10, fresh install of latest Vagrant, trying to create Ubuntu 18.04 VM, I get:

vagrant up
/opt/vagrant/embedded/gems/2.2.2/gems/vagrant-2.2.2/lib/vagrant/util/which.rb:37: warning: Insecure world writable dir /mnt/c in PATH, mode 040777
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is not supported from WSL. Host
path of the shared folder must be located on a file system with
DrvFs type. Host path: .

Vagrant version

vagrant -v
Vagrant 2.2.2

Host operating system

Windows 10 Enterprise 1709

Guest operating system

Ubuntu 18.04
https://app.vagrantup.com/ubuntu/boxes/bionic64

Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/bionic64"
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "1024"
  # tried below line, as suggested in another bug report, but no luck
  # vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
  end
end

Debug output

https://gist.github.com/ivan-radic/9545bf66b793dff0c6794619cc7c6cd9

Expected behavior

I am looking for a workaround, if there is one.
Note that Vagrant for Windows in powershell console works fine, and successfully creates Ubuntu 18.04 machine.

If you need more info, just ask.

Thanks,
Ivan

@chrisroberts
Copy link
Member

Hi there,

This is because you are attempting to use vagrant project directory located within the WSL and synced folders with paths inside the WSL are not supported. Moving the project directory to a DrvFs mounted file system will fix the issue (this is the mounted local C:\ drive which can be found either at /c or /mnt/c). If you don't need the synced folder you can disable it by adding this to your Vagrantfile:

config.vm.synced_folder '.', '/vagrant', disabled: true

Cheers!

@ivan-radic
Copy link
Author

Hi Chris,

thanks a lot, I can confirm that both methods work.
I guess this thread can serve as documentation of sorts, but may I suggest a small improvement.

Rephrase the wording a bit:

vm:
* The host path of the shared folder is not supported from WSL. Host
path of the shared folder must be located on a file system with
DrvFs type. Host path: .
Either move your project to /mnt/C/ or disable folder synching by adding this line to your Vagrantfile:
config.vm.synced_folder '.', '/vagrant', disabled: true

... or something similar. That would be really helpful for noobs like me.

Best regards,
Ivan

@krjohnston
Copy link

krjohnston commented Nov 25, 2019

I am having this same problem but my project folder is in a directory on Host D: mounted at /d as a drvfs mount. Any help welcome.

Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end
end

/etc/wsl.conf
[automount]
enabled=true
root = /
options = "metadata,umask=0033"

Host: Windows 10.0.19030 Build 19030
Guest: Ubuntu 18.04
WSL Version 2.2.5

Output from vagrant up
kev@Kev-Asus:/d/Kev/VagrantD/w2/source$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is not supported from WSL. Host
path of the shared folder must be located on a file system with
DrvFs type. Host path: .

@brendonrapp
Copy link

brendonrapp commented Dec 10, 2019

I am having the same issue as @krjohnston, though with a /mnt/c mountpoint.

Have tried using explicit path in the Vagrantfile instead of '.', as well as moving the folder around within the C: drive tree.

Host: Windows 10 Pro build 19033.1
Guest: Ubuntu 18.04

@shadowc
Copy link

shadowc commented Jan 8, 2020

Same thing happens to me on a mnt/c mountpoint and with vagrant 2.2.6 :(

@ghost
Copy link

ghost commented Jan 28, 2020

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.

@ghost ghost locked and limited conversation to collaborators Jan 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants