I'm trying to login to GitHub on VS Code on Ubuntu, but I'm getting the error:
You're running in a GNOME environment but the OS keyring is not available for encryption. Ensure you have gnome-keyring or another libsecret compatible implementation installed and running.
After waiting for a bit, my GitHub still logs in, however if I open a new VS Code page I have to go through this login process again.
Moreover, the GitHub login popup doesn't appear when I try to sign in with VS Code; instead, I have to sign in with a code, which is frustrating. Not sure if these two things are related or not.
Do you happen to know what I can do such that I can login to GitHub on VS Code without these problems appearing?
This error in Visual Studio Code occurs because the GNOME keyring, which is used to store credentials securely, is not available or is not running correctly. You can get more context on this known issue at: https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues
Anyway, in my case it was from Linux. So, start approaching it as follows until you get it resolved:
code --verbose --vmodule="/components/os_crypt/=1" (This for the diagnosis)
Check if gnome-keyring is installed
sudo apt update
sudo apt install gnome-keyring
Make sure gnome-keyring is running:
ps aux | grep gnome-keyring
If not running:
gnome-keyring-daemon --start --components=pkcs11,secrets,ssh,gpg
Check if the libsecret library is installed:
sudo apt install libsecret-1-0 libsecret-1-dev
Configure VSCode to use gnome-keyring:
Once gnome-keyring is installed and running, open VSCode and find the configuration file (settings.json) and add the following configuration to enable GNOME Keychain storage.:
> "security.workspace.trust.enabled": true
Hope it helps someone else!
I just installed Ubuntu 25.04 and ran into the same issue.
In my case, the GNOME keyring wasn’t starting automatically. I noticed this when I searched for “Password and Keys” in the application menu – it failed to open properly.
Here's how I fixed it:
Open the Startup Applications menu.
Click Add.
Add this command:
/usr/bin/gnome-keyring-daemon --start --components=ssh

Note: You can use
ssh,pkcs11, orsecretsin--components=depending on your needs.
Restarted the computer.
After this, VS Code correctly detected the GNOME keyring, and GitHub login started working as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With