-
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
Use Linux Subsystem on Windows #7731
Comments
+1 |
@thany Install Mingw64's ssh and place it on the path (which is an option in git for windows install). You can also use any ssh client (PuTTY, Powershell, Bash on Ubuntu), on port 2222 (or a different one set in the VagrantFile). The username/password is vagrant/vagrant and the generated key file can be found on .vagrant folder. Related but out of the scope: installing Vagrant + VirtualBox is a no on Ubuntu on WSL. |
I also prefer Git for Windows with SSH in path. But Windows 10 is becoming a weird melting point with Windows, Linux, Docker, etc. If someone wants to try it, first check if Running the first bash it asks to download Ubuntu
Files from the Windows machine can be reached in the subsystem with To check if bash is installed and ssh is available in the subsystem you could check for
But if that is installed, it is possible to call ssh from a Windows process
|
And |
I wonder what would be possible to install Vagrant in the Linux subsystem. At least for remote (cloud) providers like aws, do, vcloud, ... it should work. At least the installation works pretty well:
As I said, with Windows 10 crazy things are possible :-) |
In Linux, you'd also need to check if all the required components are installed. At any rate, not having ssh is only half an installation of vagrant. It's kind-of-required to work with a box, and requiring ssh to be installed is all fine and dandy. But, you're already allowing all kinds of ways to get ssh running on Windows - Ming, Cygwin, Git, PuTTY. Why not add WLS? SSH in WLS is probably the most native and well-maintained SSH you're ever going to encounter on Windows. So if it's there, use it. If not - try the other options. There's no need to check for developer options, Bash installed or not, Ubuntu installed or not. Just check if the ssh executable exists, and if it does, use it. |
@StefanScherer WSL is enabling windows to expand its flexibility by allowing us to have choice about what software to run independently of the OS. Like WINE does on Linux. About running Vagrant on WSL it will nevever be possible since the scope of the project is to enable only User Level Apps, since virtualization requires thorough kernel access, it will never be available. The Microsoft team working on this has already commented on the limitations of WSL. Although, not as capable as virtualization, running linux software directly on windows is great. And for most purposes userspace is enough. |
About running SSH on windows, the dev team is working on porting the whole Open SSH so it can run natively on windows. I think this will be a better choice in the future than running WSL > Bash > SSH or any of the current alternatives like Cygwyn, Putty. See more on https://github.com/PowerShell/Win32-OpenSSH |
Note that I am able to install Vagrant in the WSL through apt or through the .deb packages, and run commands like When I try bringing up a box, I get "No usable default provider could be found for your system." (Even if VirtualBox is installed in Windows). |
A big +1 for this issue. Currently I am using the ssh command installed under WSL. If Vagrant had the option to specify which ssh to use, I could just create a simple alias and be done with it. |
Since latest versions of WSL allows to run native windows programs, i'd just to happy to use vagrant from WSL with windows providers (either virtualbox or hyperv). |
Yes, completely agree with @hdave and @asvetliakov WSL works quite well and microsoft is investing a lot in making it work better. With WSL working Ansible setups via Vagrant on Windows should finally work quite well, since Ansible can be run directly in WSL. This seems like a no brainer... Microsoft is making Windows 10 into a nice developer friendly environment, would be nice for Vagrant to be a part of that. |
I'm currently trying to convince my colleagues to use a vagrant/ansible dev environment. It works great for the OSX users, but windows is a sore point since ansible doesn't play well natively on windows. If Vagrant-on-windows could use the Ansible-on-linux-subsystem it would make me soooo happy. |
@ryanerwin @morgajel You can't provision thorugh ansible directly yet, since ansible is not available on windows. And virtualbox is not able to run in WSL. I've managed to run virtualbox at WSL by adding it to the PATH thanks to the recent update that allows calling windows native executables from bash. |
@ricardowong - IIRC, that feature is only available to those in the Insider Preview program at this time, as it's not in the Anniversary Update. That said, is there a way to get that feature running on the non-insider build at this time? |
@geerlingguy not that I know of sorry. It's available from build 14951 There is this project that allows running windows native executables, it may be of your interest https://github.com/xilun/cbwin |
@geerlingguy the anniversary release of Windows 10 already includes WSL, and big WSL improvements will be available in the two Windows 10 releases that come out in 2017. Personally I'm a sysadmin that's been using a Mac since 2000, and am very happy with WSL as a development environment, already more convenient than Darwin in many ways though not yet feature complete - MSFT is improving it very quickly. |
@ricardowong no need for cbwin since few releases now. vagrant.exe can be issued directly from under WSL. |
@krzysztofantczak - So far the integration that allows calling out to the windows environment from WSL is only in the Insider Preview program, it seems... meaning most users can't rely on it yet (until the next major public Windows 10 update)—and I can't point my project's users to that as a solution yet. Once it's publicly available, it will be awesome :) |
@geerlingguy latest version of WSL is far more stable and feature complete then the one published with anniversary update. I wouldn't recommend any user to use this version TBH. But of course i understand many people have many different needs ;) |
Although right now i'm on the latest build, I've had trouble once when the microsoft team was forcing users to update to the latest version or the system would become unusable. I would have updated but Windows Update was broken so I was stuck with an older build and microsoft would randomly shut down the computer ( as an antipiracy measure, ironically as insider it wouldn't detect my own W10 valid license saved on my microsoft account ). Since the newest build was not provided for manual download, I had to spend hours editing registry keys until I managed to get windows detect the newer build. So... I love being on the latest build, but Anniversary Update should be the only place anything you work on. I'm looking forward to step down the slow ring as soon as possible. About running vagrant, it can't run natively on WSL since virtualbox can't be installed, you can reference the windows executable but then you can't run ansible. You can install vagrant on WSL and have it call window's virtualbox, here's a small guide: |
@ricardowong like i said, different people, expect different things. Also, "but Anniversary Update should be the only place anything you work on", no. Like i said, it is too far behind. Perhaps its enough for people looking for linux'a'like experience ;) But when You find out, that pretty much anything related to networking is pure nightmare i think You will understand ;) Btw. latest build still lacks of stability in this regard but its far more usable. As for Your update problems, well... One thing i learned over the years watching people using windows (i'm not windows fan, i'm just stucked with it atm.), it works like russian roulette - personally i didn't encounter anything You described while updating. Also, when running things under WSL You just can't use the same mindset as on linux. It's not fully working operating system. And i didn't said anything about running vagrant natively :) Nice trick to cheat vagrant with symlink thought.... |
I'm solving this problem by using a simple six line Grab |
@leighmcculloch this solution is ok except that it still requires password during ssh connect :( |
Yeah unfortunately this is because the SSH agent isn't running. This could be resolved by running the SSH agent in the bat and adding keys. I could add that. |
@leighmcculloch it will be 100% workable solution then, thanks! |
I don't feel this issue is drawing towards a solution. As it stands, vagrant requires ssh to be installed magically. It doesn't include it, it doesn't look for and use ssh from WLS. It requires the user to install a crappy half-arsed implementation like cygwin, mingw, or whatever some other Linux-based tools on Windows come with. I thought using WLS was a great solution, because it's so much closer to what the folks behind Vagrant seem to love so much. But I'm tasting a bit of unwillingness together with confusion and perhaps a hint of false assumptions. The real problem is simple: |
@kirugan: It's updated and will use the SSH agent.
@thany: I agree it'd be great if it automatic, and I'd prefer it to be. But using WSL is still pulling in something that isn't there by default. WSL has to be manually enabled and then the first time you run bash it has to setup Ubuntu. This whole process is as difficult as any other ssh installation and comes with it's own mix of issues since a new shell is being started the SSH-agent has to be setup, keys added for forwarding, etc. |
WSL is a first-party component that'll be the same for everyone, and it's closest to the real thing. |
@leighmcculloch unfortunately now it's not working, i think cause one of arguments is |
I've been tooling around with hack after hack to see if I can get I think it may be in Vagrant's best interest to get things working somehow between Windows/WSL—the Creator's edition update (which allows calling out to Windows executables) drops this week, and it will be the first time there's a first party solution (much nicer than Cmder, Cygwin, Git Bash, etc.) to the whole "how do you For myself, there are currently two blockers that keep me using Cmder:
Note that you can run |
Also, my best instructions currently for using only Ubuntu Bash (no Cmder, cygwin, Git Bash, etc. required) to work with Vagrant are here: geerlingguy/drupal-vm#1012 (comment) |
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 1.8.5
Host operating system
Windows 10.0.14393
Guest operating system
Ubuntu 14.04.5 LTS
Expected behavior
Vagrant should be able to use Linux Subsystem on Windows 10 😎
Instead, it expects cygwin/mingw/git-bash. It's much more awesome, more up-to-date, more native, and well integrated. It makes total sense to use it when installed, especially considering Vagrant appears to be made exclusively for Linux and then ported (or something) to Windows.
Actual behavior
This error ☹
Steps to reproduce
vagrant ssh
on any vagrant box. It doesn't matter at all which one.References
Just to be absolutely clear, here's how to get Linux Subsystem (commonly referred to as Bash for Windows) and to clarify which is the one I mean:
http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/
The text was updated successfully, but these errors were encountered: