What are the limitations of the Windows Subsystem for Linux? [duplicate]

I played around with the WSL last year, but at the time it was not capable of running the neural network project that I wanted to try on it. Apparently had something to do with it having an outdated kernel or something of the sort.

Since then, there's been a lot of updates to the WSL. What are the limitations of running programs that works on Ubuntu on the WSL? Are they essentially equivalent? Is there some piece of information that I can use to determine this ahead of time?


Solution 1:

From the WSL FAQ:

Can I run ALL Linux apps in WSL?

No! WSL is a tool aimed at enabling users who need them to run Bash and core Linux command-line tools on Windows.

WSL does not aim to support GUI desktops or applications (e.g. Gnome, KDE, etc.)

Also, even though you will be able to run many popular server applications (e.g. Redis), we do not recommend WSL for server scenarios – Microsoft offers a variety of solutions for running production Ubuntu workloads in Azure, Hyper-V, and Docker.

There is also the official test for the Linux Test Program that provides some insight on pieces of software and if they work or come close to working.


The 2 links above are the official stance. One of the things Microsoft notes is that WSL does not aim to support a graphical interface. Users though have been able to run xfce and unity.

When someone can get unity to work on WSL I doubt there are any limitations. Lots of WSL is unproven ground so to get something to work might be up to the user (ie. in this case you ;) ).

Solution 2:

Since this original question was asked things have settled down a bit with WSL and I'd like to pass along the information.

I can report it is basically possible to do any normal Linux task in WSL that requires only the CPU. That means you can easily run GUI apps, and even entire desktop environments, but it also means that running neural networks is more of an exercise in wasting electricity. (WSL also lacks CUDA drivers though there are CUDA drivers for Ubuntu that could possibly be used if WSL actually could get GPU access)

GUI apps

You can get GUI apps the following way:

All you have to do is:

  1. Install a Windows X server. I use VcXsrv
  2. Add the routing information to bash using the following command:
    echo "export DISPLAY=localhost:0.0" >> ~/.bashrc
    
    If you run zsh, just add the export display info to your .zshrc file.

If you run zsh, just add the export display info to your .zshrc file.

I solved the wanting to run neural networks issue by... just installing Linux on my desktop, haha. It's much easier that way.

To answer the question more broadly

The most significant limitation of WSL is that the Linux and Windows filesystems are not really compatible. Linux files use a different permissions scheme than Windows files, and when you edit or save a file in the WSL home folder ~/ you save it with metadata that will make Windows just show an empty file in Notepad. There are also some problems with the difference in line endings (LF on Linux vs CRLF on Windows) but this is much less of an issue, especially since Microsoft has enabled VS Code and Notepad to use either line ending.

The Linux filesystem can technically be accessed from Windows Explorer but it's highly inadvisable and you couldn't really do anything with it if you wanted.