You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is it possible to integrate GitHub Desktop inside WSL2 #13953
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?
Reacted by Jasen Qin, Václav Brožík, Joon Park, Michael Kriese, Lorenz Leutgeb, Poroburu, Eric Hudon, André Kolmeijer, Husky, Bruno Santana Xavier and 28 more
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
Open Github Desktop
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.
Use Windows FS from subsystem distro
From your distro, you can access the windows fs
Open your WSL distro
Navigate to your system root
cd /
Open mnt directory
cd mnt/
You should be able to see your Windows FS (your drives)
Reacted by Amin Ya, Jeison Martinez, Matt Kleinsmith, ZSPFX, Richard Muvirimi, David De Los Santos, Carl Bolduc, Anubhab Majumdar, 可爱捏, GTM52 and 38 more
Reacted by Jeison Martinez, Al J Abadi, Ali Emre Aydoğmuş, Warren Arnold, Rodrigo Burgos, Hadir Garcia, Steven Kotwal, gabriellaporte-wp, Matheus Moreno Sá, Yhael S and 1 more
Reacted by ZSPFX, Al J Abadi, Ali Emre Aydoğmuş, Warren Arnold, Rodrigo Burgos, Hadir Garcia, Petr Efremov, gabriellaporte-wp and Yhael S
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 😱
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
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
Open Github Desktop
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.
Use Windows FS from subsystem distro
From your distro, you can access the windows fs
Open your WSL distro
Navigate to your system root
cd /
Open mnt directory
cd mnt/
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
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
Open Github Desktop
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.
Use Windows FS from subsystem distro
From your distro, you can access the windows fs
Open your WSL distro
Navigate to your system root
cd /
Open mnt directory
cd mnt/
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
It would be awesome to have a real integration between github desktop and wsl2...
Reacted by Adrian Bogatu, Eric Hudon, Samuel, Tao Hansen, André Kolmeijer, Gabriel Rodriguez, Chakras Kuntjoro, DivinesLight, Takis Katsanos, Ryan HY Zhang and 22 more
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.
Reacted by jpsteege and Evandro Pomatti
Reacted by Sean Casey, Rodrigo Vargas Honorato, nikkehtine, Josh Wiley, Tony Ferguson, Samuel, Tao Hansen, André Kolmeijer, Ty Schlichenmeyer, theko2fi and 5 more
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 :)
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!
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
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.
Reacted by Ty Schlichenmeyer, Pierre-Yves, René Rivas, thejjw, Georgios Diamantopoulos, Matt Visnovsky, Tim Estes, Victor Leao de Aquino Botelho and luke-pk
Reacted by Maprangsoft Develoment, luke-pk and Yug-Shah
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 :)
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)
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
Open Github Desktop
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.
Use Windows FS from subsystem distro
From your distro, you can access the windows fs
Open your WSL distro
Navigate to your system root
cd /
Open mnt directory
cd mnt/
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
Reacted by Alexandre Lima, Юрий Зубарев and Roman Seiner
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.
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. :-)
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.
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
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.
Reacted by Ben Ayles, Marcos Pereira, Fabian Meyer and c266
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
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.
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.
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
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
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!
Reacted by cvigouroux-tui, Jorrin, fangxx3863 and Mike Adelson
Activity
tsvetilian-ty commentedon Feb 21, 2022
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
\\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.Use Windows FS from subsystem distro
cd /cd mnt/SharakPL commentedon Mar 23, 2022
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/myrepobut it's opened directly in windows with eg. powershell at\\wsl$\Ubuntu\home\username\github\myrepoand you should never access wsl files directly through windows filesystem so this is bad 😱johannesschobel commentedon Mar 24, 2022
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
i can see all file changes and the commit history properly.
However, when trying to commit new files, i get the following error:
Mapping the
\\wls$\...path to a network drive (i.e.,Z:\) does not work either.. Any suggestions from your side?All the best,
Johannes
johannesschobel commentedon May 4, 2022
I have found a possible solution for this issue:
You need to manually create a new Windows registry key:
with the type
DWordand set the value to1.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,
dsaints2344 commentedon Nov 14, 2022
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
hongda-zhu commentedon Feb 22, 2023
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
claudioantonio commentedon Mar 14, 2023
It would be awesome to have a real integration between github desktop and wsl2...
schummar commentedon Mar 22, 2023
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.
ecwootten commentedon May 12, 2023
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
TonyTheFerg commentedon May 12, 2023
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!
JosephusPaye commentedon May 18, 2023
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:
First make sure you have set up WSL2 GUI support as described here: https://learn.microsoft.com/en-us/windows/wsl/tutorials/gui-apps
From a WSL2 terminal, install GitHub Desktop for Linux:
After installing you can launch the app using the
github-desktopcommand 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):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.
justinaslelys commentedon Jun 6, 2023
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)
mg-coates commentedon Jul 27, 2023
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
Stanzilla commentedon Oct 12, 2023
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.desktopso 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.rr-todd-murchison commentedon Mar 5, 2024
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
1 remaining item
rr-todd-murchison commentedon Mar 12, 2024
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.
quinn commentedon Mar 29, 2024
for me, github desktop tries to convert line endings to CRLF in the diff when i try to do it like this
StrawIII commentedon Jul 11, 2024
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
You can edit your .gitconfig using
git config --global --editor you can find it here
C:\Users\%UserProfile%\.gitconfigfoxt commentedon Mar 4, 2025
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.
hummusaki commentedon Mar 4, 2025
Note: the
-oused in thewgetis for setting the log output file, not for filename. For the filename you will want to use-O.Little detail for future reference.
JosephusPaye commentedon Mar 5, 2025
Good catch @hummusaki - I've updated my original comment.
luke-pk commentedon Oct 1, 2025
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)
MiloudiMohamed commentedon Jan 11, 2026
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
MiloudiMohamed commentedon Feb 2, 2026
Windows Solution: #16378 (comment)
AustinGrey commentedon Feb 16, 2026
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
aleixrodriala commentedon Mar 26, 2026
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.
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!
tidy-dev commentedon Apr 14, 2026
xref as related: #9443