Skip to content

Could not access starting directory \\wsl$\Ubuntu\home error 0x8007010bΒ #6995

Closed

Description

@SGrima1

Windows Build Number

Version 10.0.19041.985

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.4.72

Distro Version

20.04

Other Software

Visual Studio Code 1.51.1 connected to Ubuntu

Repro Steps

opening ubuntu on windows terminal preview

Expected Behavior

access to wsl

Actual Behavior

[error 0x8007010b when launching `wsl.exe -d Ubuntu']
Could not access starting directory "//wsl$/Ubuntu/home/SAGRI"

Diagnostic Logs

No response

Activity

  1. SGrima1 commented on May 26, 2021

    @SGrima1
    Author

    image

  2. cggonzal commented on May 27, 2021

    @cggonzal

    similar problem on 18.04:
    Screenshot 2021-05-26 201934

  3. cggonzal commented on May 27, 2021

    @cggonzal

    I was able to solve this by going into the windows terminal settings, going to the ubuntu profile, and ticking the "Use parent process directory" box. No idea why that worked. It's also worth noting that this occurred to me right after a reboot.

  4. hi7ee5h commented on May 27, 2021

    @hi7ee5h

    Just to reiterate, I was having the same issue. This is specific to terminal right now. Running just wsl.exe on powershell works fine and ticking the "Use parent process directory" box in terminal settings seems to have fixed it for me too.

  5. seapagan commented on May 27, 2021

    @seapagan

    I was able to solve this by going into the windows terminal settings, going to the ubuntu profile, and ticking the "Use parent process directory" box. No idea why that worked. It's also worth noting that this occurred to me right after a reboot.

    Perfect, just had the same issue and the above worked for me - either run in cmd prompt or tick the above setting. Lifesaver!!

    I have several WSL distributions, need to tick this for all of them if using Windows Terminal. Must have been some sneaky stealth update last night?

    Edit again: This seems to happen if you have a custom startup directory - I did since I don't want to start my Linux in the windows %USERPROFILE% every time. However, If I tick the box, then untick and set the "\\wsl$\Ubuntu\blahblah\home" path to my home directory manually again it all works as before, and I start up in the correct (Linux) home dir.

  6. pradoz commented on May 27, 2021

    @pradoz

    Edit again: This seems to happen if you have a custom startup directory - I did since I don't want to start my Linux in the windows %USERPROFILE% every time. However, If I tick the box, then untick and set the "\wsl$\Ubuntu\blahblah\home" path to my home directory manually again it all works as before, and I start up in the correct (Linux) home dir.

    Thanks. This worked for me.

    I added a few lines to my .zshrc/.bashrc that references my %USERPROFILE% variable. If we end up there, navigate to where we want the default to be instead. Replace ~ with your desired start directory.

    if [[ $(pwd) == /mnt/c/Users/mostlikely-your-pc-name ]]
    then
        cd ~
    fi
    
  7. mhbig commented on May 28, 2021

    @mhbig

    I had the same problem.
    It seems that the directory path notation has changed from slash to backslash.
    Before: //wsl$/linux-distro/home/user
    After: \\wsl$\linux-distro\home\user

  8. freekvh commented on May 28, 2021

    @freekvh

    I had the same issue, ticking "Use parent process directory" indeed fixes the described error but starts my shell in /mnt/c/WINDOWS/system32 which I don't like. Manually setting it to:

    //wsl$/Ubuntu-20.04/home/linuxUsername

    Sets the start dir to my Linux user's home dir ~/ as it should be.

  9. mohlatif227 commented on May 28, 2021

    @mohlatif227

    I was able to solve this by going into the windows terminal settings, going to the ubuntu profile, and ticking the "Use parent process directory" box. No idea why that worked. It's also worth noting that this occurred to me right after a reboot.

    Thanks a lot, it did work for me.

  10. nikoandpiko commented on May 28, 2021

    @nikoandpiko

    I was able to solve this by going into the windows terminal settings, going to the ubuntu profile, and ticking the "Use parent process directory" box. No idea why that worked. It's also worth noting that this occurred to me right after a reboot.

    Worked for me, but it started me on System32. Went back into settings and unchecked "User parent process directory". Loaded another tab and it is back to working normally as it did previously with the correct profile loaded.

  11. ssaroshhasan commented on May 28, 2021

    @ssaroshhasan

    Just go to Windows Terminal>Settings>Ubuntu and replace the starting directory field with Z:\home\username (replace Z: with whatever drive your WSL is mapped on and username with the relevant username/folder name).

  12. jespadas commented on May 29, 2021

    @jespadas

    Edit again: This seems to happen if you have a custom startup directory - I did since I don't want to start my Linux in the windows %USERPROFILE% every time. However, If I tick the box, then untick and set the "\wsl$\Ubuntu\blahblah\home" path to my home directory manually again it all works as before, and I start up in the correct (Linux) home dir.

    Thanks. This worked for me.

    I added a few lines to my .zshrc/.bashrc that references my %USERPROFILE% variable. If we end up there, navigate to where we want the default to be instead. Replace ~ with your desired start directory.

    if [[ $(pwd) == /mnt/c/Users/mostlikely-your-pc-name ]]
    then
        cd ~
    fi
    

    This one works for me, better to start at home directory.

  13. alecthegeek commented on May 29, 2021

    @alecthegeek

    I ticked "Use parent process directory" but left command line as wsl.exe ~ -d Debian and no further changes were required.

    Thanks for the info

  14. bn-l commented on May 29, 2021

    @bn-l

    I was able to solve this by going into the windows terminal settings, going to the ubuntu profile, and ticking the "Use parent process directory" box. No idea why that worked. It's also worth noting that this occurred to me right after a reboot.

    Just adding another voice here. Had the same problem and this worked for me.

  15. 127 remaining items

  16. DHowett commented on Dec 8, 2022

    @DHowett
    Member

    Happy to help! Let me make sure that we don't have the version in our documentation that is busted. 😁

  17. darkvertex commented on Dec 8, 2022

    @darkvertex

    Something else I've noticed when using OSC9 codes is if I was on a WSL shell and ssh somewhere where I've configured my PS to use OSC9 also, is that when I kill Windows Terminal and it comes back, it remembers and it tries to cd into the path that only existed remotely, and so it errors.

    I guess I need to disable OSC9 on remote shells on my setup. πŸ€”

  18. DHowett commented on Dec 16, 2022

    @DHowett
    Member

    Igor Nikiforov (@Kolobamanacas) thanks again for pointing this one out; I fixed our documentation up in MicrosoftDocs/terminal#623 πŸ˜„

    Alan Fregtman (@darkvertex) Alas, that's one of the worst parts of this whole "working directory" thing. I wish we could restore remote working directories!

  19. douglasg14b commented on Feb 19, 2023

    @douglasg14b

    Yeha, startup directory works till you actually want to access the non-wsl filesystem,

    \\\\wsl$\\Ubuntu-22.04\\mnt works but \\\\wsl$\\Ubuntu-22.04\\mnt\\c causes it to crash with [process exited with code 4294967295 (0xffffffff)]

    No suggestions actually seem to work here, or anywhere.

    There are so many threads, and no one in any of them has a solid answer to how to change the startup directory. Just piles of "try this" changes that don't actually work.

    The docs should really be covering this.

  20. oniubi commented on Apr 3, 2023

    @oniubi

    I had the same problem. It seems that the directory path notation has changed from slash to backslash. Before: //wsl$/linux-distro/home/user After: \\wsl$\linux-distro\home\user

    I also encountered the same problem. How did you finally solve it?

  21. digininja commented on Apr 3, 2023

    @digininja
  22. AlexMAS commented on Aug 22, 2023

    @AlexMAS

    The easiest way is to specify the starting directory using ~/.bashrc.

    Just open Terminal and define your path:

    echo cd /your/start/directory > ~/.bashrc

    Then restart it and ejoy.

  23. BtbN commented on Aug 22, 2023

    @BtbN

    The easiest way is to specify the starting directory using ~/.bashrc.

    Just open Terminal and define your path:

    echo cd /your/start/directory > ~/.bashrc

    Then restart it and ejoy.

    Again, that will completely break the ability to open your terminal in any other starting directory than your homedir.
    So that's not a good solution. And it'll potentially also break other tools/scripts that source bashrc.

  24. RedBaron1918 commented on Nov 3, 2023

    @RedBaron1918

    i found one way to change starting directory for Ubuntu. first open Json file in settings, and then add this line:

    "commandline": "wsl.exe --cd C:/Users/yourProfile -d Ubuntu-22.04"
    
  25. BtbN commented on Dec 1, 2023

    @BtbN

    Doesn't that again break the ability to "Open Terminal here" from the context menu of directories?

  26. Gab01230 commented on Jul 9, 2024

    @Gab01230

    I had a similar problem.
    I went to the settings.json file et it appears that the good and available Ubuntu had the parameter "hidden: true,".
    I just turned it to false and everything went fine.

  27. RollsChris commented on Dec 10, 2024

    @RollsChris

    Hi, I'm trying to split pane in windows terminal from my WSL Ubuntu, and I'm getting:

    [error 2147942667 (0x8007010b) when launching `ubuntu.exe']
    Could not access starting directory "/home/rollschris"
    

    Only happens when trying to split pane.

    Anybody have any ideas?

    Thans

  28. DanielAtCosmicDNA commented on Jun 20, 2025

    @DanielAtCosmicDNA

    Christopher Rollings (@RollsChris) , here is what worked for me:

    in .zshrc:

    precmd() {
      print -Pn "\e]9;9;$PWD\e\\"
    }

    In Windows Terminal settings, configured these attributes as:

    {
        "commandline": "wsl.exe -d Debian",
        "startingDirectory": "~",
    }
  29. DHowett commented on Sep 17, 2026

    @DHowett
    Member

    (I have reported Vectle (@VectleAgent) and would encourage anybody else who they have spammed to do the same thing.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions