-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
VMware Desktop Plugin in WSL (maybe some useful info) #9628
Comments
Hi there, Thanks for opening this issue, the info, and the offer to help test out support. I have been spending some time working on this and am close to having it working. Working within the WSL can be challenging when due to a POSIX like environment that's really Windows, and proper path conversions in the correct locations to achieve the expected results. As soon as I have things working as expected I will push a new release. Again, thanks for all the information, and I hope to have support out very soon. Cheers! |
Hi there, Today a colleage asked me how to use Vagrant VMware in WSL. He has a brand new business notebook with Windows 10, so he wants to go with WSL. He started to install it, but had troubles. The following steps describe our environment with Vagrant 2.0.4, Vagrant VMware Desktop plugin 1.0.3 and the Vagrant VMware Utility 1.0.1 and VMware Workstation 14.1.1. Steps on Windows 10
(New choco package is still pending in review, otherwise just skip the -version and -pre options)
Steps in Ubuntu WSL
#!/bin/bash
if [ "$1" == "list" ]; then
"/mnt/c/Program Files (x86)/VMware/VMware Workstation/vmrun.exe" $1 | sed 's/C://' | sed 's/\\/\//g'
elif [ "$1" == "addSharedFolder" ]; then
"/mnt/c/Program Files (x86)/VMware/VMware Workstation/vmrun.exe" $1 $2 $3 C:${4//\//\\}
elif [ "$1" == "setSharedFolderState" ]; then
"/mnt/c/Program Files (x86)/VMware/VMware Workstation/vmrun.exe" $1 $2 $3 C:${4//\//\\} $5
else
"/mnt/c/Program Files (x86)/VMware/VMware Workstation/vmrun.exe" $*
fi Edit: Updated the helper script to fix shared folders as well.
This was lot of fun to find out the tweaks. I know this isn't officially supported, but it helped us to get started with our new Windows 10 machines. I hope an upcoming version of the Vagrant Desktop plugin work more smoothly in WSL. |
@StefanScherer That is amazing! I'm doing windows work currently (getting hyper-v and the vmware providers working properly in WSL being part of the list) and having the existing release working with those tweaks is fantastic. |
Thanks @chrisroberts |
Interesting...nice work! |
If there's anything we can do here I'd be happy to have our engineering teams investigate. |
At least this approach running Linux Vagrant in WSL is much much better than my first approach in November last year. I tried to use Windows Vagrant in WSL which then totally failed using |
@StefanScherer What Windows build number are you using for those tweaks? |
@DarthSpock We made the tweaks with Win10 Release 16299.15.amd64fre.rs3_release.170928-1534 |
Interesting. Very cool to know. So I have a strong feeling build 17134 (SCU) and up will require less hacking for it. See the WSL Release Notes for why I believe this to be the case. |
Also, validation was asked for in microsoft/WSL#2406 (comment) for builds 17627+ that |
Thanks @DarthSpock for that info. Our machines are still at Windows 10 1709 for a while. @chrisroberts I did some more testing with the tweaks. I have problems with the shared folders. Tried it with an When I edit the share manually to either The Vagrant VMware plugin should be improved that it uses the Windows path for the Vagrant shared folder. A second problem I found is that General notice: I've moved the whole |
Why don't you spin up a VM with build 17655. It's free as long as you have a license for stable, which you do (I'm also assuming you have Enterprise license).
So pretty sure you tried this but since I don't see it mentioned, Edit: I just remembered that wouldn't work since you can't start Windows RDP with
I would hazard a guess and say this is due to Windows environmental variables not being fed into Path within WSL. This situation is improved with |
Linux files should NOT be manipulated by Windows in any way, shape, or form for the time being. I believe there is work being done to improve this scenario but good news you can do the reverse (run Windows or Linux services from Linux as background tasks with 17134.1+) |
Thanks @DarthSpock I've opened PR #9758 to add the Windows RDP client which is the most native RDP client. Running a newer Windows 10 is not an option as I'm investigating WSL for our Windows 10 laptops. We had Ubuntu Desktop VM's on our Windows 7 machines (Win 7 -> Vagrant VMware -> Ubuntu Desktop) to have a proper dev environment and could do that again on Windows 10. |
Cool, must of had blank moment not thinking of simply adding the code used by Windows Vagrant to the Linux variant.
You might be doing yourself an injustice. As much as things improved with FCU, there's so much more features and interoperability between WSL and Windows in SCU, you might be best upgrading from 7 to SCU. Either way, I think you'll find VMs will be needed for very little in your dev environment with WSL if at all. |
@DarthSpock I also run the latest Windows 10 1803 in a VM on my MacBook, all good. But on company laptops we suffer from rollout policies that delay such short term updates. I just don't want to suggest our team to run Windows 10 1709 -> Vagrant VMware -> Windows 10 1803 -> WSL do work there. I could use the Ubuntu Desktop VM instead or just "buy me a MacBook" :-) |
Yes we all know Iterm2 is a better terminal at this point but with every release, the Windows Console is getting better and better. So for awareness purposes, they are working on ridding themselves of that old UTF-16 code and moving to UTF-8 (a very long and painful endeavor for them with the thousands upon thousands of code relying on UTF-16) and are implementing
I wouldn't either. Perhaps your org needs to become more Agile. Of course that's assuming good IT management practices are already in place...coughs ITIL, COBIT, Lean Six Sigma, ISO 27001, etc. coughs |
I've updated the https://github.com/StefanScherer/dotfiles/blob/c42f54d9f0fa0ee37f699bdfacb2decbb86d0926/bin/vmrun.exe-helper#L4-L7 |
Created PR #9759 to allow other providers than VirtualBox for commands like |
We currently run into an issue with a second network. The simple Vagrantfile looks like this and adds a private network with a static IP address: # -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "bento/ubuntu-18.04"
config.vm.network "private_network", ip: "172.16.32.3"
end After a A A look at Another look at In the Virtual Network Editor I can see that the vmnet2 does not have DHCP enabled. I think this is missing in the current Vagrant VMware Desktop plugin. |
We have enabled DHCP manually in the vmnet2 network. Alternatively we also tried to just set a fixed IP address 172.16.32.1 to the vmnet2 device. A first But after a
Seems like the plugin does not recognize the already existing vmnet2 network card. |
I've someone is interested how we got the VMware plugin working in WSL right now (with some workarounds) here are my slides how to Setup a Dev environment that feels like $HOME on Windows 10 - DevOps Meetup Bamberg, 2018-06-15 |
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. |
Vagrant version
vagrant --version
= 2.0.3vmware-desktop plugin (latest as of 3/28/2018- I already uninstalled it so I can't easily check now)
Host operating system
Windows 10 - WSL - version 1709 build 16299.309
Linux flavor - Ubuntu 16.04
VMware Workstation Windows - 12.5
Guest operating system
Ubuntu 16.04
Expected behavior
The VM boots
Actual behavior
The VMware plugin tries to run a hardcoded Windows path to
vmrun.exe
, rather than allowing either a lookup via$PATH
or converting to a WSL supported/mnt/c/path/to/vmware/vmrun.exe
pathSteps to reproduce
vagrant up --provider=vmware_desktop
It does seem to be able to successfully contact the Utility service, but fails upon attempting to execute
vmrun.exe
due to the hardcoded Windows-style path.Some general notes - I totally understand that this isn't officially supported yet, but I thought I'd open this issue in case the information is useful to you during your adding the feature for the next version.
I did also attempt to run the Linux version of the VMware utility in a foreground process from another tab, but that fails with an "unable to locate executables" error (which is almost certainly because it doesn't know how to look at
/mnt/c
yet)All that said, this seems to be really close to working. Looking forward to the next release, and if you need any help testing it out, feel free to reach out. Feel free to close this issue as well, as it's just intended to be some hopefully useful info.
The text was updated successfully, but these errors were encountered: