Skip to content

Is it possible to integrate GitHub Desktop inside WSL2 #13953

Open

Description

@TonyTheFerg

Describe the feature or problem you’d like to solve

More of a support request

Is it possible, and if so is there documentation on how to set up GitHub Desktop inside WSL2?

Activity

  1. tsvetilian-ty commented on Feb 21, 2022

    @tsvetilian-ty
    Member

    Hello @TonyTheFerg 👋

    Yes, you can 😄 There are two ways to approach the problem. You can access the subsystem fs or use your windows fs in the subsystem.

    Access Subsystem FS

    1. Open Github Desktop
    2. When you choose your "Local path," the directory you peek, should look something like this \\wsl.localhost\{DISTRO}\home (If you don't see it in the explorer, click on the address bar and paste it) after that you should see the subsystem fs and pick directory from it.

    image

    Use Windows FS from subsystem distro

    From your distro, you can access the windows fs

    1. Open your WSL distro
    2. Navigate to your system root
    cd /
    1. Open mnt directory
    cd mnt/
    1. You should be able to see your Windows FS (your drives)
  2. SharakPL commented on Mar 23, 2022

    @SharakPL

    2. When you choose your "Local path," the directory you peek, should look something like this \\wsl.localhost\{DISTRO}\home

    Actually it should be \\wsl$\{DISTRO}\.......

    But cloning this way doesn't create repo in WSL properly. When you hit Open in Visual Studio Code you don't get typical linux project with WSL server installed for it, linux filesystem, linux shell and workspace path like /home/username/github/myrepo but it's opened directly in windows with eg. powershell at \\wsl$\Ubuntu\home\username\github\myrepo and you should never access wsl files directly through windows filesystem so this is bad 😱

  3. johannesschobel commented on Mar 24, 2022

    @johannesschobel

    This does not work on Windows.
    GitHub Desktop is installed on the Host System (i.e., Windows), the Git Project itself, however, is located in the WSL2 subsystem (i.e., Ubuntu 20.x).

    When i try to add the Repository with the path

    \\wsl$\Ubuntu-20.04\home\X\projects\Y
    

    i can see all file changes and the commit history properly.
    However, when trying to commit new files, i get the following error:

    "\\wsl$\Ubuntu-20.04\home\X\projects\Y"
    CMD.EXE was started with the above path as the current directory.
    UNC paths are not supported. Defaulting to Windows directory.
    

    Mapping the \\wls$\... path to a network drive (i.e., Z:\) does not work either.. Any suggestions from your side?
    All the best,
    Johannes

  4. johannesschobel commented on May 4, 2022

    @johannesschobel

    I have found a possible solution for this issue:
    You need to manually create a new Windows registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\DisableUNCCheck
    

    with the type DWord and set the value to 1.
    This will then disable the UNC Check for paths.

    The solution worked for me, as i can not execute Husky GitHooks from within GitHub Desktop.

    Hope this helps,
    All the best,

  5. dsaints2344 commented on Nov 14, 2022

    @dsaints2344

    Hello @TonyTheFerg 👋

    Yes, you can 😄 There are two ways to approach the problem. You can access the subsystem fs or use your windows fs in the subsystem.

    Access Subsystem FS

    1. Open Github Desktop
    2. When you choose your "Local path," the directory you peek, should look something like this \\wsl.localhost\{DISTRO}\home (If you don't see it in the explorer, click on the address bar and paste it) after that you should see the subsystem fs and pick directory from it.

    image

    Use Windows FS from subsystem distro

    From your distro, you can access the windows fs

    1. Open your WSL distro
    2. Navigate to your system root
    cd /
    
    1. Open mnt directory
    cd mnt/
    
    1. You should be able to see your Windows FS (your drives)

    The first method works, but given the WSL2 implementation, whenever you have to run pre-commit script (like husky), it doesn't work through Github desktop. It works through the WSL2 terminal though

  6. hongda-zhu commented on Feb 22, 2023

    @hongda-zhu

    Hello @TonyTheFerg 👋

    Yes, you can 😄 There are two ways to approach the problem. You can access the subsystem fs or use your windows fs in the subsystem.

    Access Subsystem FS

    1. Open Github Desktop
    2. When you choose your "Local path," the directory you peek, should look something like this \\wsl.localhost\{DISTRO}\home (If you don't see it in the explorer, click on the address bar and paste it) after that you should see the subsystem fs and pick directory from it.

    image

    Use Windows FS from subsystem distro

    From your distro, you can access the windows fs

    1. Open your WSL distro
    2. Navigate to your system root
    cd /
    
    1. Open mnt directory
    cd mnt/
    
    1. You should be able to see your Windows FS (your drives)

    The first method does not work for me, I can't find the directory and also when I manually add the directory , I get the error fatal: could not create leading directories of '\wsl.localhost\Ubuntu-20.04\home\XXXX\XXXX': Permission denied

    Regards

  7. claudioantonio commented on Mar 14, 2023

    @claudioantonio

    It would be awesome to have a real integration between github desktop and wsl2...

  8. schummar commented on Mar 22, 2023

    @schummar

    I want to try to make a real integration happen. The basis for this is delegating git operations to git within WSL, which should solve some of the fundamental problems that come with the cross-filesystem workaround that people have been using. See desktop/dugite#532

    I am awaiting feedback at the moment, so we'll have to see what concerns and edge cases come up with that solution.

  9. ecwootten commented on May 12, 2023

    @ecwootten

    Any suggestions on how to solve authentication issues using Github Desktop with WSL2? I've installed it and added repos I already had cloned locally. But any attempt to fetch, etc, hits authentication errors (logs attached).

    I've set the ssh-agent running, and added my key (though no idea why it didn't find it, because it's in the default location with the default name and correct permissions). I've tried launching the github desktop .exe directly from the WSL2 terminal. I have signed out and back in again. I can fetch and so on fine from the WSL2 command line.

    Ideally I'd prefer Github Desktop to prompt for my SSH password each time. But for starters I'd just like it to work at all :)

    2023-05-12.desktop.production.log

  10. TonyTheFerg commented on May 12, 2023

    @TonyTheFerg
    Author

    Very cool to see movement on this! I am running DDEV now, so I have become accustomed to their git integration UX, but this would still be a great feature!

  11. JosephusPaye commented on May 18, 2023

    @JosephusPaye

    It's possible to use this Linux distribution of GitHub Desktop from inside WSL2 if you have setup support for WSL GUI apps.

    Here's what worked for me:

    1. First make sure you have set up WSL2 GUI support as described here: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

    2. From a WSL2 terminal, install GitHub Desktop for Linux:

      # Replace <deb_url> with latest deb download url from https://github.com/shiftkey/desktop/releases/latest
      wget <deb_url> -O github-desktop.deb
      
      # Install gdebi (a tool for installing deb files). Skip if you already have gdebi installed.
      sudo apt-get install gdebi-core 
      
      # Install the downloaded deb
      sudo gdebi github-desktop.deb
    3. After installing you can launch the app using the github-desktop command from a WSL2 terminal. I use this little snippet to launch the app in the background, and ignore all output (you can wrap this in an alias for convenience):

      nohup github-desktop > /dev/null 2>&1 &

    Caveats

    I wasn't able to get the sign in to work (the redirect from the browser was not getting back to the app running in WSL). I was able to skip the sign in step, and use the app without the features that require sign in.

  12. justinaslelys commented on Jun 6, 2023

    @justinaslelys

    Any suggestions on how to solve authentication issues using Github Desktop with WSL2? I've installed it and added repos I already had cloned locally. But any attempt to fetch, etc, hits authentication errors (logs attached).

    I've set the ssh-agent running, and added my key (though no idea why it didn't find it, because it's in the default location with the default name and correct permissions). I've tried launching the github desktop .exe directly from the WSL2 terminal. I have signed out and back in again. I can fetch and so on fine from the WSL2 command line.

    Ideally I'd prefer Github Desktop to prompt for my SSH password each time. But for starters I'd just like it to work at all :)

    2023-05-12.desktop.production.log

    The following comment helped me - basically you need to have a secondary ssh key set up on your Windows machine which can be set up using Git GUI:
    #15902 (comment)

  13. mg-coates commented on Jul 27, 2023

    @mg-coates

    Hello @TonyTheFerg 👋

    Yes, you can 😄 There are two ways to approach the problem. You can access the subsystem fs or use your windows fs in the subsystem.

    Access Subsystem FS

    1. Open Github Desktop
    2. When you choose your "Local path," the directory you peek, should look something like this \\wsl.localhost\{DISTRO}\home (If you don't see it in the explorer, click on the address bar and paste it) after that you should see the subsystem fs and pick directory from it.

    image

    Use Windows FS from subsystem distro

    From your distro, you can access the windows fs

    1. Open your WSL distro
    2. Navigate to your system root
    cd /
    
    1. Open mnt directory
    cd mnt/
    
    1. You should be able to see your Windows FS (your drives)

    Just stumbled across this post. Thanks greatly for the tip.
    I just wanted to add one additional consideration for those that come after me is how line feeds are handled.
    Github Desktop will on checkout convert unix linefeeds to windows with no option through the GUI to change this behaviour. This probably won't matter for a lot of projects, but for the project I'm working on resulted in '\r': command not found error in make.

    If you've got git on the command line, run git config --global core.autocrlf false to stop the conversion (use input rather than false if you need files converted on checkin because you're using a windows editor).
    Otherwise, edit C:\Users\USER_NAME.gitconfig & add

    [core]
        autocrlf = false
    
  14. Stanzilla commented on Oct 12, 2023

    @Stanzilla

    The thing you are going to be stuck on is the login though.

    You can use wslu (GitHub) and then set xdg-settings set default-web-browser wslview.desktop so the sign-in prompt gets opened in your Windows browser but then you are stuck on the part where it has to send the response back.

  15. rr-todd-murchison commented on Mar 5, 2024

    @rr-todd-murchison

    You know, with WSL2, you can simply install the Linux version of GitHub Desktop in your WSL2 Linux distribution. This works well if your repositories, Git config, etc. are in WSL2. No need to worry about line endings, directory paths, etc. It's all just natively in Linux with the GUI showing up like a Windows app. :-)

    https://github.com/shiftkey/desktop?tab=readme-ov-file#installation-via-package-manager

  16. 1 remaining item

  17. rr-todd-murchison commented on Mar 12, 2024

    @rr-todd-murchison

    Even though I mostly use Chrome in Windows I also installed the Chrome browser in Linux in WSL2. With Chrome installed in WSL2 as well I was able to do the normal sign in flow.

  18. quinn commented on Mar 29, 2024

    @quinn

    for me, github desktop tries to convert line endings to CRLF in the diff when i try to do it like this

  19. StrawIII commented on Jul 11, 2024

    @StrawIII

    for me, github desktop tries to convert line endings to CRLF in the diff when i try to do it like this

    This is annoying because GitHub Desktop shows no file changes, but my git in WSL shows every single line in every single file changed to CRLF. I wish there was and option for GitHub desktop to use WSL git or even better UI option to stop this from happening. But there is at least this solution:

    Add this to .gitconfig

    [core]
    	autocrlf = false
    

    You can edit your .gitconfig using
    git config --global --edit

    or you can find it here

    C:\Users\%UserProfile%\.gitconfig

  20. foxt commented on Mar 4, 2025

    @foxt

    I think the biggest problem for me is that the performance of using GitHub Desktop over the UNC path is bad, it can take 10-30 seconds to switch branches on repositories that aren't even that large. It would be really nice to see an official integration that could execute the lower level Git commands inside the WSL environment, similar to how VS Code works.

  21. hummusaki commented on Mar 4, 2025

    @hummusaki

    It's possible to use this Linux distribution of GitHub Desktop from inside WSL2 if you have setup support for WSL GUI apps.

    Here's what worked for me:

    1. First make sure you have set up WSL2 GUI support as described here: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps

    2. From a WSL2 terminal, install GitHub Desktop for Linux:

      Replace <deb_url> with latest deb download url from https://github.com/shiftkey/desktop/releases/latest

      wget <deb_url> -o github-desktop.deb

      Install gdebi (a tool for installing deb files). Skip if you already have gdebi installed.

      sudo apt-get install gdebi-core

      Install the downloaded deb

      sudo gdebi github-desktop.deb

    3. After installing you can launch the app using the github-desktop command from a WSL2 terminal. I use this little snippet to launch the app in the background, and ignore all output (you can wrap this in an alias for convenience):
      nohup github-desktop > /dev/null 2>&1 &

    Caveats

    I wasn't able to get the sign in to work (the redirect from the browser was not getting back to the app running in WSL). I was able to skip the sign in step, and use the app without the features that require sign in.

    Note: the -o used in the wget is for setting the log output file, not for filename. For the filename you will want to use -O.
    Little detail for future reference.

  22. JosephusPaye commented on Mar 5, 2025

    @JosephusPaye

    Good catch @hummusaki - I've updated my original comment.

  23. luke-pk commented on Oct 1, 2025

    @luke-pk

    Finally, after years of suffering through the 5-10 second delays on every action in the Windows version of the app (when managing repos on WSL), I finally got the Linux port working! I set up the app as @JosephusPaye suggested. Then, set up the SSH key as @justinaslelys mentioned.

    I was still having an issue where after signing into GitHub through the web browser redirect, the GitHub desktop app would hang and not sign in. I ran the following command to fix it (from this issue):
    xdg-mime default github-desktop.desktop x-scheme-handler/x-github-desktop-dev-auth.

    (Also, if you don't see your organization's repos, you likely have to allow access for the app through GitHub)

  24. MiloudiMohamed commented on Jan 11, 2026

    @MiloudiMohamed

    Does anyone know why this performance issue has been ignored for years? Is it really that difficult to fix? (VS Code and PhpStorm perform very well) if so, AI could definitely help a lot here

  25. MiloudiMohamed commented on Feb 2, 2026

    @MiloudiMohamed

    Windows Solution: #16378 (comment)

  26. AustinGrey commented on Feb 16, 2026

    @AustinGrey

    Just a note from my experience, I needed to install google chrome and some dbus extensions in order to get the authorization flow of github desktop to work inside of wsl2

  27. aleixrodriala commented on Mar 26, 2026

    @aleixrodriala

    I've been struggling with this for a while and ended up building a fork that fixes it: GithubDesktopWSL

    Think of it like the VS Code Remote WSL extension but for GitHub Desktop. It runs a small daemon inside WSL that handles git and file operations natively over TCP instead of going through 9P.

    Operation Fork Official Speedup
    git status 2 ms 43 ms 20x
    git log 2 ms 41 ms 24x
    Open repo 16 ms 173 ms 11x

    I went with a patch-based approach so it auto-syncs with upstream releases. You can just download the installer and try it, installs side-by-side with official Desktop.

    Would love if anyone here could give it a try and let me know how it goes!

  28. tidy-dev commented on Apr 14, 2026

    @tidy-dev
    Contributor

    xref as related: #9443

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions