Comments (8)
but not when passing commands directly as an argument.
That's the expected behavior according to #816 (comment) (unless it was changed later, the comment is from 2017):
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 true for the new wsl.exe binary (with the exception that wsl launches your user's default shell as a login shell).
from wsl.
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
Closed similar issues:
- bash is not a login shell (#167), similarity score: 0.71
Note: You can give me feedback by thumbs upping or thumbs downing this comment.
from wsl.
I don't see what you see when I test. Can you post your ~/.wslconfig
& /etc/wsl.conf
Typically, we like logs from here: https://github.com/Microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method
from wsl.
Sorry, I was going to include them but forgot.
~/.wslconfig
[wsl2]
memory=16GB
processors=4
[experimental]
autoMemoryReclaim=gradual
sparseVhd=true
/etc/wsl.conf:
[boot]
systemd=true
[user]
default=alexey
Logs: WslLogs-2024-02-14_01-15-52.zip.
from wsl.
For me, it works when I open a "normal" interactive shell,
> wsl.exe -d Ubuntu
$ shopt login_shell
login_shell on
$ whereis vlc
vlc: /snap/bin/vlc
but not when passing commands directly as an argument.
> wsl.exe -d Ubuntu -- shopt login_shell
login_shell off
> wsl.exe -d Ubuntu -- whereis vlc
vlc:
> wsl.exe -d Ubuntu -- vlc
/bin/bash: line 1: vlc: command not found
I installed VLC as a snap to reproduce the issue. Snaps are installed within /snap/bin/
$ sudo snap install vlc
vlc 3.0.19 from VideoLAN✓ installed
from wsl.
@alexeyr-ci Thanks for the info. I guess it makes sense, as it seems to match the behavior of sshd
.
$ ssh 172.31.192.139 shopt login_shell
login_shell off
Unfortunately, in my case with NixOS, the distro is not using the standard paths, so I end up with almost nothing in the PATH, not even bash
or ls
. 😆 (I am not sure how they fixed the initial environment when connecting over ssh.) I cannot help you with your issue then.
from wsl.
I indeed cannot reproduce the issue:
wsl --shell-type login
$ shopt login_shell
login_shell on
@alexeyr-ci: Can you share details about your distro and default shell ?
from wsl.
The distro is Ubuntu, and the shell is bash
. Nothing special here.
from wsl.
Related Issues (20)
- Running WSL results in Wsl/CallMsi/ERROR_PATH_NOT_FOUND HOT 13
- On every wsl command I am getting 'Error code: Wsl/CallMsi/ERROR_PATH_NOT_FOUND' HOT 5
- wsl2 install ubuntu failed : error code 0x80070520 HOT 5
- Limit size of wsl disk HOT 4
- Get the full version from WSL HOT 2
- WSL writes to mounted windows drive increases wsl drive size HOT 6
- Very high CPU usage HOT 4
- Mounting UNC path via `/etc/fstab` doesn't work HOT 6
- Cannot connect Hyper-V VMs(Default Switch) from wsl2 HOT 4
- Windows Insider Preview update causes WSL to fail to run and prevents reinstallation [Version 10.0.26100.1] HOT 2
- Error code: Wsl/CallMsi/REGDB_E_CLASSNOTREG HOT 9
- mirrored Network looks fine! but threre have some error in log. HOT 4
- wsl2 beth won't allow for lan connections or changes to the wsl.conf. HOT 2
- WSL error Wsl/0x80070422 (still not working after tried sc.exe config LxssManager start=auto) HOT 5
- WSL2 not connecting to internet without VPN (with VPN, it connects) HOT 5
- `f2fs` support HOT 3
- several DCP_WATCHDOG_VIOLATIONS Blue-Screens-of-Death since installing WSL2 - when NOT using it HOT 7
- git clone with proxy encountered bug HOT 3
- 用作为当前目录的以上路径启动了 CMD.EXE。 UNC 路径不受支持。默认值设为 Windows 目录。 HOT 6
- WSL2 gives HYPERVISOR_ERROR BSOD but WSL1 works okay HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wsl.