What are the limitations of the Windows Subsystem for Linux?

17,720

Solution 1

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.

Solution 2

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 ;) ).

Share:
17,720
David A. French
Author by

David A. French

Updated on September 18, 2022

Comments

  • David A. French
    David A. French over 1 year

    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?

  • ravery
    ravery over 6 years
    the limitation is on a deeper level. Since there isn't a Linux kernel, things that use kernel modules, like VirtualBox, won't work. Note; I haven't tested myself so correct me if my assumption is incorrect.
  • Rinzwind
    Rinzwind over 6 years
    Vbox is a bit of a stretch yes. But even then I had the idea it might be possible to do; it would need lots of reworking of the code but I would assume it might be possible to pass all what is needed from the kernel to Windows and have that one handle it. You sort of emulate a kernel on the WSL side that would send to and receive from windows and report that back to vbox. Just rambling though ;)
  • David A. French
    David A. French over 6 years
    I'd seen the FAQ you pointed to but the neural network tools I'm using are CLI and don not have GUIs or and are not graphical programs. I got an answer from the official WSL github though. WSL does not yet support CUDA or OpenCL which are necessary to use GPU with the neural networks. Even if I could get it to run, CPU only would be basically useless. Guess I'm installing Linux on a partition again!
  • Simon
    Simon about 5 years
    regarding your last point about permissions, is that only true for files saved/edited in the Linux home directory? what if you symlink to a Windows directory and edit those files?
  • John Cowan
    John Cowan about 5 years
    Simon: that is perfectly fine. In the latest WSL release you can also access Linux filesystems from Windows as \wsl$\<distro>\home\<username>\<filename> or whatever you like. However, this works by talking to the Linux, so only if the distro is actually running.
  • David A. French
    David A. French about 5 years
    To add to what John said, I believe that they have enabled explorer.exe access to WSL in the most recent Windows Insider edition.