# \[Bug\] Antigravity CLI (agy) fails to persist authentication state in WSL 2 environment

**URL:** <https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059>\
**Category:** Google Antigravity\
**Tags:** wsl2, bug\
**Created:** [May 20, 2026, 7:41am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059 "2026-05-20T07:41:56Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Alex\_Hagdahl](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/alex_hagdahl/32/31627_2.png) [@Alex\_Hagdahl](https://discuss.ai.google.dev/u/Alex_Hagdahl)\
**Post date:** [May 21, 2026, 7:54am UTC](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059/3 "2026-05-21T07:54:38Z")

</div>

I had the same issue too.

Antigravity itself told me its because WSL is headless and is missing the OS keyring to save the CLI tokens in.

I managed to fix it by installing gnome-keyring.

`sudo apt update && sudo apt install -y dbus-x11 libsecret-1-0 gnome-keyring`

And then adding this to my `.bashrc` to start the keyring service

```auto
if [-n "$BASH_VERSION"]; then
    export $(dbus-launch)
    eval "$(echo "" | gnome-keyring-daemon --unlock)"
    eval "$(gnome-keyring-daemon --start)"
    export SSH_AUTH_SOCK
fi

```

---

_[View the full topic](https://discuss.ai.google.dev/t/bug-antigravity-cli-agy-fails-to-persist-authentication-state-in-wsl-2-environment/146059)._
