Configure browserpass with WSL

January 05, 2020


Introduction

To manage my passwords, I use pass. There is an extension called browserpass that allows to fill the passwords by retrieving it from the store. There is a Windows compatible version, but as I am using WSL, I didn't want to have two copies of my password store (it would have been annoying to sync the two stores each time). Below are the steps that I've followed to make this works!

WSL part

First, you have to install browserpass-native, the host that will communicate with the browser to exchange the pass. You can download the latest release from here. I've extracted the file to ~/browserpass/.

My password store is protected by a passphrase. To allow Windows to load the gpg-agent with the passphrase so it can access to your password store, you have to configure a pinentry program. The following script called pinentry-wsl-ps1 perflecty does the trick!

  • Copy pinentry-wsl-ps1.sh somewhere.
  • Give this read + execute rights (chmod ug=rx pinentry-wsl-ps1.sh)
  • Create or edit ~/.gnupg/gpg-agent.conf to add the following line:
pinentry-program /path/to/your/pinentry-wsl-ps1.sh

Windows part

Download browserpass-native for Windows from here. Run the .msi, it will copy the appropriate files to C:/Program Files/Browserpass (It looks like nothing happened, just check if the folde is created after the installation process).

  • Create browserpass-wsl.bat to C:/Program Files/Browserpass with the following content:
@echo off
bash -c 'cd /your/home; ~/browserpass/browserpass-linux64'
  • Update the *-host.json which corresponds to your Browser (For Chrome/Brave, I've updated chromimum-host.json) and modify the path:
{
  ...
  "path": "C:\\Program Files\\Browserpass\\browserpass-wsl.bat"
  ...
}
  • Install browserpass extension for your browser and enjoy!