DEV Community

Molly Crendraven
Molly Crendraven

Posted on

Generating GPG keys with Windows 11 and WSL

Are you encountering an issue where the pinentry prompt for a GPG key generation in Windows Subsystem for Linux (WSL) is stuck in a loop. Is it doing this regardless of the DISPLAY you set, or the pinentry- programs you try and install? Good news. While you still have hair (or sanity, if you are already bald), you can generate the GPG keys on the Windows side and copy them over.


  • Run the generation command in a git bash terminal
  • Copy the .gnupg directory from your Windows user directory, to your WSL user directory, using the WSL entry in the Windows Explorer. You can safely skip any conflicts.
  • Success!

Top comments (1)

ajayvishnu profile image
Ajay Vishnu V

Could you elaborate a bit? Like how exactly should I paste the .gnupg directory to WSL entry?