-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Changing Ubuntu WSL starting directory keeps it set to the defualt #2743
Comments
Could you be specific which settings don't seem to work for that profile? Maybe share the profile from the |
@zadjii-msft Just checked into this & verified that, yes, specifying a Windows path does work, and for WSL distros, specifying a Windows-relative path to a distro also works. For example, |
This is a duplicate of another bug in the db somewhere. We need to clarify in the documentation that It's gotta be a Windows path. 😄 I'm re-tagging this with |
I am working on submitting a PR to add that bit of detail, if that is alright with everyone. |
Sure! |
You may want to use |
non-escaped also works: "startingDirectory" : "//wsl$/Ubuntu-18.04/home/<user>" |
The problem isn't the documentation, it's the default JSON provided. That's why everyone keeps complaining about the same thing. Here's mine:
which instead takes me to |
@Boobies weirdly enough, I've used |
I've tried all of these and it still seems to be defaulting to |
If the methods above don't work (like for me), do this: From Windows environment:
|
Reading every message here FINALLY gave me the hint #2743 (comment) why it wasn't working for me: the home directory needs to have read/execute access for group/others. Strange, because the root user should have access anyway, right? I always do Another gotcha for the docs, @DHowett ? Edit: NOPE. It seemed to have been fixed when I tried closing and reopening Windows Terminal, but when running Terminal at system boot or after a long delay between closing and reopening, it STILL starts up in /mnt/c/Users/ instead of ~. In Settings it does still say, and always has: //wsl$/Ubuntu-20.04/home/ Edit2: I found a comment #592 (comment) that says the "//wsl$/ folder is not initialized until a wsl instance is started. So the first instance wont start in ~, but the others will start in ~ because the first instance initialized the //wsl$/ folder". So there is no way to always (even the first time) start up a WSL instance in the Linux home directory?? |
This one worked for me, just editing the JSON file |
Yeah this work |
The newer windows terminal provides a UI for setting starting directory for each profile. Just go to setting > Profiles > Ubuntu-xx.xx > Starting directory. Hope it help. |
In my case, this is the starting directory. |
Same - and I presume it changed to the |
These are the same setting. You may be seeing the issue described in #11512 (comment) where the timing makes it seem as though whatever you did fixed something. |
@MEXdave1997 your settings worked perfectly for me, thanks! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Today after reinstalling Ubuntu 20.04 on Windows 10 21H2 (Build 19044.1415) "startingDirectory": "/home/<user>" Which is GREAT 👏 |
__
Thanks! |
I have Windows 10 Version 20H2 - Build 19042.1415 and had to use |
Okay lemme clear this up before there's more confusion. This ISN'T something that came with a Windows update, this is a Terminal change in 1.12. In 1.12, you should be able to use |
My work laptop just updated from 1909 to 20H2 (upgrades are controlled by policy, thus the reason for not being on a newer version or having updated sooner). Yes, these two seem basically equivalent. Yet the latter works while the former is apparently now ignored. |
@wolf99 what you're seeing is exactly what I've described in #2743 (comment) |
Mmm I'm not on 1.12 yet though as I do not use the pre release versions. I am still on 1.11. Are you saying this change was also present in 1.11 ? |
Yea, looks like we serviced #9223 to 1.11.2421 as well. |
I worked my way through this whole thread and it took me a while to realize that Windows Terminal has been updated. I added the line to the Json file and it only half worked, changing the starting directory from my Windows user folder to root. Going into the settings under Ubuntu and setting the Starting directory option to \wsl$\Ubuntu\home\username\ works but not when using / |
This worked finally! |
Something recently changed and now WSL starts with a WSL root working directory instead of the correct WSL HOME working directory. |
That worked for me! Thanks! 💖 |
A lot of the paths here didn't work for me. |
Thank you. This is what I was looking for (works well enough). |
I still can't get this to work as expected. I want the default folder to be Afaik I don't have any cd ~ in my .bashrc or equivalent Edit: always after you asked for help on the internet you find the solution yourself. For some reason my default wsl profile would use the executable |
This is what I did in windows 10 latest terminal settings - PowerShell 7.3.4
It worked like a charm both on right click menu and direct from terminal. |
|
this gave me error
Nor do any of the above strings works |
When editing the the settings, I have tried to chang the default starting directory for the Ubuntu WSL Terminal profile as follows
"startingDirectory": "/mnt/D/Folder/SubFolder/",
and while it doesnt cause any issues or causes the Terminal to resort to default configuration, it does not set the default starting directory to the specified path.
Also it seems that most settings for the profile do literally nothing when changing them, from color, to acrylic or scheme settings.
Note: changing the setting for power shell, cmd, of Kali-Linux does work and change things respectively
The text was updated successfully, but these errors were encountered: