Forum Discussion

greysave's avatar
greysave
New Contributor
1 year ago

Linux 1password CLI annot connect to the desktop app

The server is running Ubuntu 22.04 and I get the following error:
op vault list
[ERROR] 2024/04/05 09:54:38 connecting to desktop app: cannot connect to 1Password app, make sure it is running

I followed the directions on the 1Password developer site. I have tried uninstalling and reinstalling both 1password and 1passord cli.


1Password Version: 8.10.24
Extension Version: Not Provided
OS Version: Ubuntu 22.04
Browser: Not Provided

6 Replies

  • thecatfix's avatar
    thecatfix
    Dedicated Contributor

    OMG....did you discover 1password not cross distro compatible. This changes everything. i am using arch and have had same issues

    • Michael_Mercuri's avatar
      Michael_Mercuri
      Dedicated Contributor

      thecatfix​, I'm curious, in your case are you using X11 or Wayland? 

      Are you able to use `op` command manually from your shell to interact with 1Password Desktop App (e.g. to read items)? 

  • Michael_Mercuri's avatar
    Michael_Mercuri
    Dedicated Contributor

    There appears to be more going on than just setting the environment variable that impacts how the 1Password CLI is allowed to talk to the 1Password Desktop app.

    Just setting the environment variable is not enough. 

    I have my Wayland GNOME desktop configured to set both of these environment variables using ~/.config/environment.d/00-env.conf:

    OP_BIOMETRIC_UNLOCK_ENABLED=true
    OP_LOAD_DESKTOP_APP_SETTINGS=true

    If I launch WezTerm directly from the desktop launcher, WezTerm is unable to access the 1Password Desktop App using the 1Password CLI: 

    19:57:39.250 ERROR logging > lua: Failed to get password: [ERROR] 2026/03/24 19:57:39 error initializing client: connecting to desktop app: connection reset, make sure 1Password CLI is installed correctly, then open the 1Password app, select 1Password > Settings > Developer and make sure the 'Integrate with 1Password CLI' setting is turned on. If you're still having trouble connecting, visit https://developer.1password.com/docs/cli/app-integration#troubleshooting for more help.

    I'm able to verify that the WezTerm process does indeed have the environment variables set using `ps` or checking /proc/pid/environ. 

    However, if I first launch another terminal program and then launch WezTerm from there, WezTerm is able to use 1Password CLI to interact with 1Password Desktop App and read my vault. 

    What is the difference between launching `op` from an interactive shell in a terminal vs from another process launched directly by the desktop launcher? 

    And what do the `OP_BIOMETRIC_UNLOCK_ENABLED` and `OP_LOAD_DESKTOP_APP_SETTINGS` environment variables do? 

    And why would this behavior be different on Ubuntu 22 under X11 compared to Ubuntu 24 under Wayland?

  • Michael_Mercuri's avatar
    Michael_Mercuri
    Dedicated Contributor

    So... after reading this suggestion in other similar posts I tried setting the environment variable:

    OP_LOAD_DESKTOP_APP_SETTINGS=true

    Now this is working. Why? What does this do? I found no reference to it in 1Password CLI documentation:

    https://developer.1password.com/docs/cli/environment-variables/

     

  • Michael_Mercuri's avatar
    Michael_Mercuri
    Dedicated Contributor

    Anyone? I'm also seeing errors like this on Pop!_OS 24.04 based on Ubuntu 24.04. 

    What's weird is that I regularly use `op` daily and it runs fine from the command line.

    However, when attempting to use Wezterm  https://github.com/dfaerch/passrelay.wezterm plugin that uses the 1Password CLI, when the plugin get a "connect reset" error:

    [ERROR] 2026/03/19 16:54:50 connecting to desktop app: connection reset, make sure 1Password CLI is installed correctly, then open the 1Password app, select 1Password > Settings > Developer and make sure the 'Integrate with 1Password CLI' setting is turned on. If you're still having trouble connecting, visit https://developer.1password.com/docs/cli/app-integration#troubleshooting for more help.

    All of the `op` commands that the plugin uses such as `op item list` and `op item get` work fine when executed manually from my shell. But when run from the Wezterm plugin, it gets these error.

    When I check the 1Password CLI activity log from the Developer Settings, it shows no activity from Wezterm, desite the error message obviously coming from `op` .

    The only activity that ever shows up is when I manually invoke `op` from my shell. 

    Lastly... this all works flawlessly on macOS. 

    I'm using 1Password version 8.12.8 and op version 2.33.0. 

    • Michael_Mercuri's avatar
      Michael_Mercuri
      Dedicated Contributor

      Weird. I just tried this on my older Pop!_OS 22.04 laptop based on Ubuntu 22.04 and it works perfectly fine there. Same version of 1Password app and op installed. One other difference is that the older Ubuntu 22.04 is using X11 and the new Ubuntu 24.04 is using Wayland.