startingDirectory not honored while distro is in stopped state #11380

Closed
opened 2026-01-31 02:46:06 +00:00 by claunia · 3 comments
Owner

Originally created by @CoolCat64 on GitHub (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

Originally created by @CoolCat64 on GitHub (Nov 12, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # 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](https://github.com/microsoft/terminal/files/5533251/config_files.zip)
claunia added the Resolution-Duplicate label 2026-01-31 02:46:06 +00:00
Author
Owner

@zadjii-msft commented on GitHub (Nov 12, 2020):

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

@zadjii-msft commented on GitHub (Nov 12, 2020): 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
Author
Owner

@ghost commented on GitHub (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 commented on GitHub (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!
Author
Owner

@CoolCat64 commented on GitHub (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.

@CoolCat64 commented on GitHub (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: ```# Mount the Ubuntu filesystem to the wsl share directory (tmpfs is lost every reboot) 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#11380