I have been able to run Vagrant machines using
Administrator / Non Administrator with:
Vagrant 2.2.19(installed on WSL2 + Windows 10)
- Provider is
Vagrant.configure("2") do |config| config.vm.define "ubuntu2004" do |subconfig| subconfig.vm.box = "generic/ubuntu2004" subconfig.vm.hostname = "pacedge-vagrant" subconfig.vm.provider "hyperv" subconfig.vm.network "public_network", bridge: "Vagrant Switch" subconfig.vm.synced_folder "/mnt/c/Users/ME/Development/Vagrantboxes", "/vagrant" subconfig.vm.provider "hyperv" do |h| h.enable_virtualization_extensions = true h.linked_clone = true h.vmname = "ubuntu_vagrant_package" end subconfig.vm.provision "ansible" do |a| a.verbose = "v" a.playbook = "./docker-compose-playbook.yml" end end end
This seems to do all the things necessary and provides me
/vagrant directory in the VM where the files
/mnt/c/Users/ME/Development/Vagrantboxes is available.
However when I create a file in Vagrant VM within
/vagrant directory, I do not seem to see the file on the WSL2 side.
Is this not possible?
I have enabled
SMBv1 Feature in Windows 10 as well as tried to run the vagrant vm using Admin and non-Admin user via Windows Terminal
synced_folder configuration works only uni-directionally i.e. from host to VM and not the other way round