10

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?

6
  • 1
    @wjandrea The question you linked was asked in July 2018 and this question was originally asked in January 2018.... unless you believe in time travel this ain't a duplicate of the linked question. – David A. French Jan 24 '19 at 20:22
  • 2
    Duplicate on SE sites means that it's answers are valid for this question as well. It doesn't have to be an exact duplicate, nor does it have to be older than the duplicate. It's merely a way of indicating that the answers to the other question will answer this one as well. – vidarlo Jan 24 '19 at 20:25
  • 2
    @David Duplicates actually aren't based on time but on quality and popularity. The linked question has more upvotes and more answers. BTW, the questions have a few differences, so maybe they're not exact duplicates, but I'll leave it to you and the community to decide. – wjandrea Jan 24 '19 at 20:27
  • 1
    Apologies, fair enough. Though, 1) my question was specifically targeted at discussing this stuff in the context of neural networks, which is more specific and not covered by the other question, and 2) while the linked question has more upvotes, the top answer is honestly kind of garbage. My updated answer below contains a lot more information. – David A. French Jan 24 '19 at 23:05
  • 1
    I have noticed primarily limitations with kernel module availability such as a missing loopback kernel module (which means no support for mounting iso files as a block device). Also direct block device access via /dev is missing for tools like dd – Jasper Jan 25 '19 at 23:13
7

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

3
  • 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. – ravery Jan 4 '18 at 21:36
  • 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 ;) – Rinzwind Jan 4 '18 at 21:59
  • 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! – David A. French Jan 6 '18 at 5:39
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.

3
  • 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? – Simon Jan 31 '19 at 12:08
  • 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. – John Cowan Mar 15 '19 at 13:48
  • To add to what John said, I believe that they have enabled explorer.exe access to WSL in the most recent Windows Insider edition. – David A. French Mar 24 '19 at 19:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.