WSL run linux from windows without spawning a cmd-window

Here’s a simpler solution, which, however, requires a WSH-based helper script, runHidden.vbs (see bottom section): wscript .\runHidden.vbs bash -c “DISPLAY=:0 xmessage ‘hello, world'” To apply @davv’s own launch-in-background technique to avoid creating a new bash instance every time: One-time action (e.g., at boot time): launch a hidden, stay-open bash window. This spawns 2 bash processes: … Read more

Volume mounts not working Kubernetes and WSL 2 and Docker

According to the following thread, hostPath volumes are not officially supported for wsl2, yet. They do suggest a workaround, though I had trouble getting it to work. I have found that prepending /run/desktop/mnt/host/c seems to work for me. // C:\someDir\volumeDir hostPath: path: /run/desktop/mnt/host/c/someDir/volumeDir type: DirectoryOrCreate Thread Source: https://github.com/docker/for-win/issues/5325 Suggested workaround from thread: https://github.com/docker/for-win/issues/5325#issuecomment-567594291

How to check if a program is run in Bash on Ubuntu on Windows and not just plain Ubuntu?

The following works in bash on Windows 10, macOS, and Linux: #!/bin/bash set -e if grep -qEi “(Microsoft|WSL)” /proc/version &> /dev/null ; then echo “Windows 10 Bash” else echo “Anything else” fi You need to check for both “Microsoft” and “WSL” per this comment by Ben Hillis, WSL Developer: For the time being this is … Read more

How to remove the Win10’s PATH from WSL

For Windows builds HIGHER than 17713: WSL uses the file /etc/wsl.conf inside each Linux VM’s filesystem to configure its behavior. Add the following configuration settings (explained here) to /etc/wsl.conf, creating that file if necessary: [interop] appendWindowsPath = false Note that appendWindowsPath must be under [interop] for this to work. You may need to shutdown the … Read more

Why is WSL extremely slow when compared with native Windows NPM/Yarn processing?

Since you mention executing the same files (with proper performance) from within Git Bash, I’m going to make an assumption here. Correct me if I’m wrong on this, and I’ll delete the answer and look for another possibility. This would be explained (and expected) if your files are stored on /mnt/c (a.k.a. C:, or /C … Read more

Running graphical Linux desktop applications from WSL 2 – “Error E233: cannot open display” [closed]

The networking subsystem in WSL2 is different than the used in WSL1. You must consider the differences to access networking apps running on Windows and on Linux: In WSL1, Linux uses the same IP addresses than the Windows host, then, you can access the applications using localhost or 127.0.0.1 In WSL2, Linux runs on a … Read more

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

The reason this error occurs is because Windows automatically generates resolv.conf file with wrong nameserver. To resolve this issue, follow the following steps. Locate the file by running the following command: sudo nano /etc/resolv.conf You will see the following in the file: # This file was automatically generated by WSL. To stop automatic generation of … Read more

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

Instead, use: sudo service redis-server start I had the same problem, stopping/starting other services from within Ubuntu on WSL. This worked, where systemctl did not. And one could reasonably wonder, “how would you know that the service name was ‘redis-server’?” You can see them using service –status-all

Access a localhost running in Windows from inside WSL2? [closed]

Short answer for most recent Windows versions mDNS has been a feature of WSL2 for a while now. Concatenating your WSL2 hostname (or the equivalent command/function in your programming/language environment) with “.local” should get you access. For example, from Bash, try: ping “$(hostname).local” For instance, if your hostname is “MyComputer”, then the mDNS should be … Read more