Score:0

Not at home after login

us flag

I have installed Ubuntu 22.04 in WSL2. I expect that the bash shall be started in the home directory that I find in /etc/passwd as

harper:x.1000:1000:,,,,:/home/harper:/bin/bash

But after starting wsl -d Ubuntu-22.04 the bash is somewhere in the Windows tree: /mnt/c/WINDOWS/system32. I only need to issue the cd command to get into home. And I could add this in a last line of ~/.bashrc. I already checked that this file is executed while starting bash.

But why do I see this strange behavior that the home directory is not the current directory?

Edit: I have also found a workaround. I can start wsl -d Ubuntu-22.04 --cd ~. But this doesn't explain, why it's necessary.

vanadium avatar
cn flag
That is likely related to the tool `wsl`, not to the Ubuntu system. You indeed can adjust the command line of the tool to land in the directory you want as you found out.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.