Questions tagged [windows-subsystem-for-linux]

The Windows Subsystem for Linux (WSL) lets users run a GNU/Linux environment on top of the Windows operating system. It includes support for Linux-based command-line tools ELF-64 binaries, and more.

Stack Overflow welcomes programming-related questions regarding the Windows Subsystem for Linux (WSL) according to our normal on-topic/off-topic Help Center guidance.

When determining the appropriate site on which to ask a WSL question, first consider whether your issue can be reproduced without code. If so, then it is likely not "programming related." It may be more appropriate for another Stack Exchange site (see below).

Some common types of WSL questions that may be "general computing" even though you first found them in your code:

  • Running graphical applications under WSL: Some versions of WSL may require special configuration for graphical applications. If you are attempting to write a Linux application which uses X, Wayland, SDL, or another graphical library (vs. the console), then try installing and running a simple application like xterm first. If you aren't able to run xterm, then you are likely experiencing a "General Computing" issue that may be more appropriate elsewhere.

  • Accessing your application over the network or Accessing network services running in Windows from WSL: Again, attempt to reproduce the problem using standard tools such as netcat (nc), ping, etc.

    To run a simple web server under most Linux distributions out-of-the-box, use:

    python3 -m http.server 3000 # or another port
    

    If you have trouble connecting using standard tools, then your code is likely experiencing the same issue. In that case, we can assume the root issue is not your code, and your question may be more suited for another, non-programming Stack Exchange site.

Other non-programming WSL questions may include (but are not limited to):

  • Installing or running WSL itself.
  • Installing or running a Linux distribution under WSL.
  • General Linux or Windows functionality.
  • Accessing files or filesystems (unless the issue can only be reproduced with a code example).
  • Issues with or questions about Linux commands under WSL (unless the issue can only be reproduced as part of a larger script).
  • Running non-programming Linux applications or tools under WSL.
  • Configuring your shell or terminal.

Consider the following sites for non-programming WSL questions:

  • Superuser for general-computing questions, especially those that touch on Windows-specific functionality.

  • Ask Ubuntu if your question is specific to running Ubuntu on WSL.

  • Unix & Linux Stack if you believe your question is best answered by someone with Linux expertise, and the question is more related to Linux functionality than Windows.

4426 questions
682
votes
11 answers

Disable beep in WSL terminal on Windows 10

How to disable visual and audio bell/beep in WSL on Windows 10?
Andrea Tulimiero
  • 17,693
  • 5
  • 21
  • 28
308
votes
9 answers

WSL Redis encountered System has not been booted with systemd as init system (PID 1). Can't operate

I'm trying to follow the Redis installation process that was discuss in this article of digital ocean, for in WSL(Windows Sub-System for Linux). The Ubuntu version installed is Ubuntu 18.04. Everything in redis installation is fine but when I tried…
Fil
  • 8,225
  • 14
  • 59
  • 85
268
votes
13 answers

Copy Paste in Bash on Ubuntu on Windows

How to execute a copy paste operation from Windows 10 to the Bash on Ubuntu on Windows environment? I tried the following: ctrl + shift + v right click to paste Any suggestions?
234
votes
21 answers

Docker - failed to compute cache key: not found - runs fine in Visual Studio

I've generated a Dockerfile with Visual Studio. It runs in Visual Studio just fine and now I'm trying to build it from Windows itself (docker build ., and I tried many combinations). Yet I get the following error: > [build 3/7] COPY…
207
votes
21 answers

No internet connection on WSL Ubuntu (Windows Subsystem for Linux)

Recently I installed WSL Ubuntu 18.04 on my Windows machine, but nothing seems to work properly, because I have no internet access. I tried a few commands and sudo apt update says 'Connection failed' and ping google.com literally takes forever as…
garzj
  • 2,427
  • 2
  • 8
  • 15
185
votes
2 answers

Copy Files from Windows to Windows Subsystem for Linux (WSL)

I have enabled developer mode and installed Bash on Ubuntu on Windows. My home directory can be found under %localappdata%\Lxss\home\\, i have created a sub-directory called Pictures such that the full path should be on windows:…
JordanGS
  • 3,966
  • 5
  • 16
  • 21
182
votes
23 answers

How to set up working X11 forwarding on WSL2

When moving from WSL1 to WSL2 many things change; apparently this applies to X11 forwarding as well. What steps do I need to make in order to use X11 forwarding with WSL2 on Windows 10 as I did with WSL1?
whme
  • 4,908
  • 5
  • 15
  • 28
153
votes
23 answers

Ubuntu WSL with docker could not be found

The command $ docker could not be found in this WSL 1 distro. We recommend to convert this distro to WSL 2 and activate the WSL integration in Docker Desktop settings. See https://docs.docker.com/docker-for-windows/wsl/ for details. Not able to…
suki
  • 1,531
  • 2
  • 6
  • 4
142
votes
18 answers

Connecting to WSL2 server via local network

I'm developing a rails app using WSL2/Ubuntu on my Windows 10 machine, which is great! The problem is I can't connect to my server from another computer in the same network. For further clarity, I am running a Puma server on localhost:3000 I have…
Sebastian Rivas
  • 1,700
  • 2
  • 13
  • 15
139
votes
16 answers

WSL2 Clock is out of sync with Windows

WSL2 clock goes out of sync after resuming from sleep/hibernate. A workaround was shared on GitHub sudo hwclock -s to resync clock in WSL, but you have to do this every time you resume from sleep/hibernate.
piouson
  • 3,328
  • 3
  • 29
  • 29
135
votes
25 answers

Trying to use bash on Windows and got no installed distributions message

I am trying to use bash on Windows 10, but I'm getting this message when tried to run bash: Windows Subsystem for Linux has no installed distributions. Distributions can be installed by visiting the Windows Store: https://aka.ms/wslstore Press…
ddieppa
  • 5,866
  • 7
  • 30
  • 40
129
votes
5 answers

Move WSL (Bash on Windows) root filesystem to another hard drive?

I've just upgraded the Windows 10 in my laptop to Redstone 1. So I had a test of the Linux subsystem (aka. WSL, LXSS or Bash on Windows). Basically, everything is fine, but there is a problem that the RootFS of WSL is located in the %LocalAppData%…
Jackson Ming Hu
  • 1,681
  • 2
  • 14
  • 23
118
votes
9 answers

Show matplotlib plots (and other GUI) in Ubuntu (WSL1 & WSL2)

So it seems on ubuntu for windows (windows subsystem for linux) people are suggesting we need to use Agg backend and just save images, not show plots. import matplotlib matplotlib.use('Agg') # no UI backend import matplotlib.pyplot as plt import…
AwokeKnowing
  • 7,728
  • 9
  • 36
  • 47
113
votes
13 answers

How to use Git credential store on WSL (Ubuntu on Windows)?

I've tried following these instructions: https://stackoverflow.com/a/40312117/21728 which basically do this: sudo apt-get install libsecret-1-0 libsecret-1-dev cd /usr/share/doc/git/contrib/credential/libsecret sudo make git config --global…
Borek Bernard
  • 50,745
  • 59
  • 165
  • 240
112
votes
6 answers

Is it possible install Ubuntu in Windows 10 WSL without Microsoft Store?

On my work are not allowed to install apps from the Microsoft Store. Yes, this is a bank, that not supported Windows 10 (it's hell). Is it possible to install Ubuntu in WSL without downloading it from the app store? Or is it possible to download…
bigspawn
  • 1,727
  • 3
  • 16
  • 16
1
2 3
99 100