Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
32 views

Launching Windows apps from WSL2 with foreground process control

I'm using WSL2 on Windows 11 and I'm trying to achieve the following: I want to launch Windows applications from within WSL2 and have the Bash terminal maintain a handle to the new process. ...
dewijones92's user avatar
0 votes
1 answer
57 views

Why executing 'bash' in the terminal opens wsl on Windows 10?

When I run the 'bash' command in the terminal, my console automatically switches to the 'wsl' mode. Why is this happening and how do I stop this behavior? It causes problems when I run other scripts, ...
Andrii Hnatushchenko's user avatar
1 vote
0 answers
134 views

WSL run a non-login shell even with `--shell-type login`

Previously running wsl sourced .profile for me, as expected: As of build 16188 when running bash.exe without arguments (or with the ~ argument) bash will be launched as a login shell. The same is ...
Alexey Romanov's user avatar
1 vote
1 answer
614 views

How do I change the background color for folders in PowerShell when invoking the "ls" command from WSL Interop?

I've installed the WslInterop module and exposed several commands from WSL2. I'm using Import-WslCommand "apt", "cat", "awk", "nano", "find", "...
fmotion1's user avatar
  • 127
0 votes
0 answers
81 views

Why doesn't this bash/diff command work through Neovim?

I am using WSL bash (Ubuntu distribution). From Windows command line, this works as expected: bash -c 'diff test.txt -' However when running the following through Neovim: :w !bash -c 'diff % -' This ...
Arthur F's user avatar
-1 votes
2 answers
530 views

WSL Bash: how do I get a symlink to act like a local folder

I have 2 folders set up: / folder/ subfolder/ file.txt symlink-folder/ subfolder/ -> /folder/subfolder If I cd /symlink-folder/subfolder then run ls, I see file.txt, as I expect. ...
ewok's user avatar
  • 4,291
0 votes
1 answer
2k views

Using grep to search for files with a specific extension [duplicate]

I'm trying to recursively look for C Sharp files containing specific text using a bash prompt on Windows Subsystem for Linux. If I type grep -l -i -r "public virtual List<" /mnt/c/mycode/*...
Eric's user avatar
  • 1,273
0 votes
0 answers
202 views

Connecting to X server with xming and putty: 'xterm: Xt error: Can't open display' error troubleshooting

I keep getting the xterm: Xt error: cannot connect to X server:[:0] error trying to run PGPLOT function. I am running xmings and putty with X11 forwarding enabled. I have tried echo $DISPLAY and ...
user21899643's user avatar
1 vote
1 answer
28 views

How to inject powershell computed values into bash command (ran from powershell)?

I'm trying to convert wepb images into png, using dwebp, but the parameters are from powershell: foreach($ff in $f) { bash -c "dwebp $ff.name {$ff.name -replace '(.*).webp','$1.png'}" } ...
Soleil's user avatar
  • 384
0 votes
0 answers
682 views

Valid Shell Script dosen't run in WSL

I have a simple shell script which runs completly fine on VM but gives me syntex error in WSL. insert(){ read -p "Enter Name: " name read -p "Enter Phone Number: " ...
Poojan Solanki's user avatar
0 votes
1 answer
2k views

WSL command doesn't work through CMD/PowerShell [duplicate]

I'm trying to install software to multiple WSL distros, so I'm doing this using a batch file. Here's an example command and its output: CMD> wsl -u root -d Ubuntu-22.04 "apt-get update &&...
eccentricOrange's user avatar
1 vote
1 answer
139 views

script to restart process on Debian WSL

I have amule-daemon installed on Debian 11 WSL. Process amuleweb crashes every now and then so I need to restart it. I'm trying to automate this with the following bash script: #!/bin/bash if [[ $(...
roughnecks's user avatar
1 vote
0 answers
200 views

Can't figure out how to add padding to left side of Ubuntu 20.04.5 CLI in WSL 2(On Win11)

Posting here with updated detail after posting on AskUbuntu as user @NotTheDr01ds had a great answer but unfortunately it did not accomplish what I was hoping to accomplish. I installed WSL 2 and ...
Jake's user avatar
  • 111
1 vote
1 answer
141 views

Separate file path from command in Bash under WSL2

Is there a way to separate the file path from the commandline in the Bash prompt in WSL2? For example: Current: user1@DESKTOP-RMF1234:~/mywork/helloworld/tests$ ls Expect: user1@DESKTOP-RMF1234:~/...
Jiu hong's user avatar
  • 187
13 votes
4 answers
8k views

How can I check if the environment is WSL from a shell script?

In .bashrc, I have some configuration for specific environments like this. if [ "$(uname)" = 'Linux' ]; then . "$HOME/.bash.d/ubuntu" fi if [ "$(uname)" = 'Darwin' ]; ...
ironsand's user avatar
  • 2,329
1 vote
1 answer
4k views

JAVA_HOME env var in WSL return the error "not defined correctly' when a try run a mvn command

I set the JAVA_HOME with the command export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java and tried to run an app with mvn compile jib:build. But return this message: The JAVA_HOME environment ...
Brener Augusto de Oliveira's user avatar
0 votes
0 answers
377 views

Unable to edit .bashrc with anything

I'm using bash (WSL) and VsCode to edit .bashrc, but I keep getting an error. "C:\Users\USER\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd" --file-write "c:\Users\USER\AppData\...
Somebody101's user avatar
0 votes
0 answers
40 views

Why am I getting this error with 3dDeconvolve when I run my AFNI script on an Ubuntu bash shell?

I'm trying to run a variation of the doDecon.sh AFNI script in the OpenScience_Scripts repository that will process the functional neuroimaging data for each of three tasks I am analyzing separately, ...
anamarz's user avatar
0 votes
1 answer
3k views

How to directly open the WSL bash (command line) to the current working directory from File (Windows) explorer

My question is the exact opposite of the question How to open windows explorer from current working directory of WSL shell?. When I am at specific directory in Windows explorer, typing cmd from the ...
Name's user avatar
  • 453
4 votes
2 answers
2k views

Windows: How to make cygwin bash.exe to take precedence over wsl in command line?

I have installed cygwin on Windows 11. Now, when I open the Windows command line, I want the bash.exe command to run the cygwin's bash command instead of bash linked with wsl (Windows subsystem for ...
Adam's user avatar
  • 151
0 votes
0 answers
4k views

Could not resolve host: on WSL ubuntu after trying to install anything

I am trying to set up nvim but this is a general problem with anything I attempt to install. As an example root@DESKTOP-NAME:~# git clone --depth 1 https://github.com/wbthomason/packer.nvim\ ~/.loc&...
Hydrolox's user avatar
1 vote
0 answers
85 views

running bash commands from windows command prompt working intermittently

I'm trying to run a linux executable from the windows system through bash, but am having intermittent problems. I've narrowed it down to the fact that bash itself seems to sometimes run and sometimes ...
Jan Smits's user avatar
0 votes
0 answers
1k views

Unable to install windows subsystem for linux, error 0x800f0831

When I tried to install wsl without enabling it, it gives me this error PS C:\WINDOWS\system32> wsl --install wsl : The term 'wsl' is not recognized as the name of a cmdlet, function, script file, ...
sahil's user avatar
  • 1
0 votes
1 answer
4k views

Making a bash script execute ssh

I want a bash script to start multiple SSH connections to multiple linux servers in multiple new bash windows, not for further processing, just to connect with a simple command instead of having to ...
Caeleste's user avatar
  • 831
0 votes
1 answer
7k views

Bash won't open in Windows 11

I am trying to open Bash in Windows 11. However, I can't get it to open. The best that happens is it opens and then immediately closes (in a fraction of a second). I understand there is already a ...
PainfulTruth's user avatar
2 votes
1 answer
2k views

Why is my script running if run with cli but not with crontab?

On WSL Ubuntu 20.04 I have two scripts (one sh and one python) that run perfectly if I launch them with bash, but not with cron. The second (python) script is supposed to run just if the first (bash) ...
Saverio Guzzo's user avatar
1 vote
2 answers
4k views

WSL, Graphics Applications not working- Error: Can't open display: 0.0

I am having trouble with graphical applications and WSL. I have Ubuntu 20.04.3 with X11 installed; but am getting the following issue when I try to test with xeyes (the same happens with any other ...
George's user avatar
  • 121
2 votes
1 answer
4k views

User Home in WSL 2 vs Windows User Confusion

I have a bit of a confusion using WSL 2 on my Windows 10 machine regarding user names. When I installed Windows 10 using my Microsoft Account, it created the user phili. When I am in a powershell, the ...
Phil's user avatar
  • 153
1 vote
0 answers
263 views

WSL displays lots of empty lines when running PowerShell commands

In WSL, I sometimes want to run PowerShell commands, but it weirdly creates a ton of empty lines. How do I prevent these empty lines from spamming my console or script output? # Example1 (from Ubuntu ...
YorSubs's user avatar
  • 939
2 votes
1 answer
1k views

Windows Terminal: How to create multiple profiles with different start commands on same WSL1 Ubuntu

I'm on Windows 10 and have WSL1 Ubuntu. On Windows Terminal, I have a profile for it called "Ubuntu". (For this question, assume I cannot change those tools - for instance, I can't upgrade ...
cheryllium's user avatar
1 vote
1 answer
1k views

How do I start VS Code in terminal for a different distribution in WSL2?

I've recently set a working copy of Ubuntu-20.04 WSL2 called Ubuntu-20.04-copy01 but I can't open/create files with vscode from the terminal, for example: code main.rs as with the original ...
Rogelio Lozano's user avatar
0 votes
1 answer
3k views

Slow bash under WSL

I have a Windows 10 system with WSL v2 Ubuntu enabled. If I run bash from Windows to call a programm installed on Linux, it is very slow (500-800ms) for even a trivial command. I used Measure-Command ...
tomfroehle's user avatar
0 votes
1 answer
2k views

.local/bin' which is not on PATH. Linux subsystem for Windows

in Windows/Linux subsystem/ubuntu/windows power shell/bash: pip3 install --upgrade pip ok but: WARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/chills/.local/bin' which is not on PATH....
Timer Tak's user avatar
4 votes
1 answer
4k views

Windows Subsystem for Linux shows "no installed distributions" in run-as-Administrator PowerShell window

I have successfully installed WSL 2 and Ubuntu on my Windows machine. My user account is not an administrator account. If I start PowerShell and type bash it successfully starts bash, and wsl --list ...
Markus's user avatar
  • 143
3 votes
2 answers
5k views

How can I open WSL terminal with a command without it automatically closing?

I'm running Ubuntu with WSL1, and I want to make different shortcuts in Windows to run different commands on WSL startup, e.g., one to automatically start an SSH session, another to change to a ...
NS studios's user avatar
6 votes
1 answer
6k views

Windows 10 WSL: mount creates 9p filesystem instead of drvfs

I want to mount my Windows C: Drive to /mnt/c in WSL as a drvfs file system, but if I specify drvfs as the file system type I get a 9p filesystem instead. I entered these commands: $ sudo umount /mnt/...
tonik's user avatar
  • 163
2 votes
1 answer
6k views

How to specify startup directory for WSL (Ubuntu) in ConEmu in Windows 10

I have installed WSL2 with Windows 10 and downloaded and set up Ubuntu successfully. I have installed and set up ConEmu terminal to run Ubuntu successfully. But ConEmu opens Ubuntu in C:\Users\MyUsers ...
Freelensia's user avatar
16 votes
4 answers
27k views

WSL Ubuntu bash: The operation timed out because a response was not received from the virtual machine or container

I'm on Windows 10 Pro 10.0.21337 (windows insider program) and installed WSL with Ubuntu and Windows Terminal. After a firmware update the ubuntu bash wouldn't start anymore. In a cmd.exe the response ...
user829755's user avatar
2 votes
2 answers
565 views

Windows Terminal no longer lists Ubuntu bash

I'm on Windows 10 Pro 10.0.21337 (windows insider program) and installed WSL and Windows Terminal which listed powershell, cmd.exe, Ubuntu bash and azure as profiles. I made the Ubuntu bash the ...
user829755's user avatar
0 votes
1 answer
935 views

Why does my bash script not cd correctly?

I'm using Windows Subsystem for Linux, and learning the terminal. I want to open applications on my desktop with the terminal, so I decided to make a bash script to cd to the .exe file and run it. ...
ZackT's user avatar
  • 93
1 vote
1 answer
5k views

Bash on Windows 10 does nothing and goes back to command prompt

Just today bash on my Windows 10 machine has completely stopped working. Running bash from the command prompt results in about a one second pause, and then returns immediately back to the command ...
Lemonseed's user avatar
  • 111
0 votes
0 answers
131 views

"=" is invisible in nano editor (wsl)

The problem is simple: = is invisible in WSL's nano and I don't think this should be happening: #! /usr/bin/bash STRING="e" echo "$STRING" Is there some way to turn this off?
Crabby Fish's user avatar
-1 votes
1 answer
287 views

Changing home directory on WSL gets rid of all color schemes in cmder

I'm quite used to competitive programming on linux so I was trying to set up bash in WSL. To run the executable I found out I need to type out the whole path like /mnt/e/... So I thought by changing ...
Laksh Chauhan's user avatar
0 votes
1 answer
378 views

`wsl env` gives different result to `wsl` followed by `env`

Inside WSL (i.e. by opening a cmd and then running wsl, or just running wsl straight from the start menu) I have this line at the end of ~/.bashrc: LANG=en_US.UTF-8 While still inside WSL, if I do ...
Clonkex's user avatar
  • 1,097
2 votes
1 answer
525 views

can't start docker via wsl powershell command but can start it in Ubuntu

I'm running WSL2 / Ubuntu 20.04 / Windows 10. When I type sudo bash -c 'dockerd &' in Ubuntu 20.04 / bash dockerd starts. When I type wsl sudo bash -c "dockerd &" in PowerShell ...
neubert's user avatar
  • 7,204
0 votes
1 answer
2k views

How to install fonts for all users using WSL?

Using WSL Bash, I followed both sets of the steps from this question's answer (only the first set of steps worked) but I get strange behaviour for the font. The font does show up in my text editors ...
Daniel's user avatar
  • 150
0 votes
1 answer
1k views

windows executable cannot find file under wsl path

I am running WSL1. I created a file in my home dir, ie home/username. I have a .exe file called armcc.exe in my C:\ directory. I can run something like this from the linux shell: /mnt/c/armcc.exe /mnt/...
rookie's user avatar
  • 97
0 votes
1 answer
629 views

Switch to active cmd window for typing

I've tried searching high and low for an answer by amending my title and reading questions before submission to no avail. I'm learning bash shell through Ubuntu LTS via windows cmd terminal using ...
Fartwell's user avatar
0 votes
1 answer
635 views

Bash alias to change to host user home folder in WSL2

refferencing How to get the host user home directory in WSL Bash (I don't have reputation yet to add a comment) the great answer from @felipecassiors: wslpath "$(wslvar USERPROFILE)" I am ...
Thomas Oatman's user avatar
5 votes
1 answer
721 views

Launch a WSL script through Windows Terminal: node: command not found

I am trying to run a node.js script in WSL from WT using the syntax wsl.exe <command>. However I can't get it to find Node when launched this way and get the following : PS C:\> wsl.exe -- ...
xShirase's user avatar
  • 151

1
2 3 4 5