6

Ok so I read in Microsoft documentation about WSL https://learn.microsoft.com/en-us/windows/wsl/about.

The first paragraph says

The Windows Subsystem for Linux lets developers run Linux environments -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a virtual machine.

My question is; In what conditions I, as a Developer would want to run Linux Environment in my windows? Probably when I develop something for the Linux Operating system and don't have the Linux operating system at my disposal? Or there is more to it?

I am new to the subsystem so any guidance would be appreciated.

Vivek Shukla
  • 767
  • 6
  • 21
  • I don't understand it either. If I wanted to run Linux on a machine I would install Linux in the first place, not Windows. YMMV. – Mark Setchell Jul 24 '18 at 15:32
  • 2
    At work we used WSL for porting code that was interfacing with the linux kernel. While I could have re-written the program it's just easier to run it in WSL. – Seabass77 Jul 24 '18 at 16:32
  • 1
    I think of it as a lightweight introduction to Linux although that may not be what it was meant for. This way, I can learn about a specific subset of things more easily available on Linux and use them without setting up a virtual machine, having a dual boot clutter up my hard drive or going full Linux. E.g., it started with me wanting to trim white space around figures, which is surprisingly easy on the shell and _so hard_ on Windows, but now I'm also using it to host jupyter notebooks, connect to a cluster, git MATLAB files while developing code in the editor..., and I can still use OneNote! – Franz Wurst Jul 26 '18 at 07:40

3 Answers3

2

This question borders on "primarily opinion-based," except that I think the folks at Microsoft had particular uses in mind.

If you have a project on Linux, and you want to move it to Windows with minimum friction, then you probably want WSL. Your code can continue to use Linux APIs, and your build scripts can run in a bash shell and use all the typical Unix commandline tools. If you require Linux-only tools, you can run those, too. Otherwise, to port a project to Windows, you'd have to do a lot of work.

And from Ars Technica:

Microsoft is positioning WSL strictly as a tool for developers, with a particular view to supporting Web developers and the open source software stacks that they depend on. Many developers are very familiar with the bash shell, with building software using make and gcc, and editing text in vi or emacs. WSL will give these developers versions of these tools that are equal in just about every regard to the ones you get on Linux, because they'll be the ones you get on Linux running unmodified on Windows.

Yun
  • 3,056
  • 6
  • 9
  • 28
Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
  • Cygwin has existed since... Well for as long as i can remember. Its basically the same, except for the filesystem being a mounted tarball. Cygwin is however, limited compared to .deb / .rpm etc - ports must be made to .exe for each package. As for myself, it comes in Very handy when developing and with a unix repository manager handling installs, its very fast to setup a platform with all those capabilities we're used to on a linux host. Some things are not available on Windows (.so vs .dll) and vice versa. Just my 50 cents – mschr Dec 30 '21 at 19:06
0

WSL can run anything developed in Linux on Windows, and interact with Windows files.

Microsoft said that interaction between Linux and Windows processes are made possible. I don't know how.

What I did use WSL successfully is to run a bash script written and tested in Linux, in Windows to rename files in Windows to my specification for example. The description of that script as a use case is available in the 5-minute video here ( https://youtu.be/gzcIi31AszA ) and downloadable for your own test.

Oracle
  • 1
0

The Windows Subsystem for Linux comes very handy when you want to build a project on Windows which requires some Linux-specific build commands (like rm). In this case you can easily run a full Ubuntu (or other supported Linux distributions) behind the scenes while keeping coding in Windows.

In Visual Studio Code this is realized through the WSL Remote extension. I find it so cool, that I made a full tutorial about it: https://www.youtube.com/watch?v=bRW5r7TK6KM

Benny Code
  • 51,456
  • 28
  • 233
  • 198