Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

startingDirectory not honored while distro is in stopped state #8251

Closed
CoolCat64 opened this issue Nov 12, 2020 · 3 comments
Closed

startingDirectory not honored while distro is in stopped state #8251

CoolCat64 opened this issue Nov 12, 2020 · 3 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@CoolCat64
Copy link

CoolCat64 commented Nov 12, 2020

Environment

Windows build number: Microsoft Windows [Version 10.0.19042.630]
Windows Terminal version (if applicable): 1.3.2651.0
uname -mrs: Linux 4.19.128-microsoft-standard x86_64
lsb_release -a:
No LSB modules are available.
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2020.4
Codename: kali-rolling

Any other software?
I have installed Ubuntu-20.04 and kali-linux from the Windows Store.

Steps to reproduce

0.) Use the config files included in this PR
1.) Set the settings.json kali-linux entry with startingDirectory to any of the following:
//wsl$/kali-linux/home/<username>
\\wsl$\kali-linux\home\<username>
2.) Verify kali-linux is in a "Stopped" state via wsl -l -v
3.) Open a new Windows Terminal tab with kali-linux

Expected behavior

I expect the starting directory to be //wsl$/kali-linux/home/<username> per documentation

https://docs.microsoft.com/en-us/windows/terminal/customize-settings/profile-settings#starting-directory

Actual behavior

The starting directory is the default %USERPROFILE%.
When, according to wsl -l -v, the kali-linux instance is already 'Running', then opening a tab for kali-linux does set the directory to //wsl$/kali-linux/home/<username> as expected.

I tried enabling the automount option, I tried setting the mountFsTab to false, and commenting out all automount options. The behavior is the same, so long as the kali-linux instance is stopped before opening the tab.

config_files.zip

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 12, 2020
@zadjii-msft
Copy link
Member

Thanks for the great writeup! I think largely, we're tracking this issue over at #7197 - feel free to follow that discussion for updates on this bug.

/dup #7197

@ghost
Copy link

ghost commented Nov 12, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Nov 12, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Nov 12, 2020
@CoolCat64
Copy link
Author

CoolCat64 commented Nov 13, 2020

I don't get it. I can no longer reproduce the problem and I am not sure why. I updated some files, clone'd some repos, and ran rsync a couple of times to my backup drive. The most destructive thing I did was run the optimize-vhd cmdlet on my Ubuntu-20.04 and kali-linux VHDs (that is a Win10 Pro Hyper-V cmdlet for optimizing virtual disk size).

The one difference I noticed was that both Ubuntu-20.04 and kali-linux would run when I opened a kali-linux tab, where before, Ubuntu-20.04 was "Stopped". I assume that Ubuntu-20.04 should be in a "Running" state when I open an instance of kali because I have this mount command in my .bashrc:

if [ ! -d /mnt/wsl/Ubuntu-20.04 ]; then
   mkdir /mnt/wsl/Ubuntu-20.04
   wsl.exe -d Ubuntu-20.04 -u root mount --bind / /mnt/wsl/Ubuntu-20.04
fi

But this mount command is in the .bashrc file that I submitted with this PR. The mount command was being run when I opened an instance of kali-linux before, and the Ubuntu-20.04 in the wsl -l -v output would show "Stopped"...now it shows "Running." I am very confused.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

2 participants