Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some CLI features require x11 #17

Open
phrack opened this issue Apr 3, 2019 · 11 comments
Open

Some CLI features require x11 #17

phrack opened this issue Apr 3, 2019 · 11 comments

Comments

@phrack
Copy link

phrack commented Apr 3, 2019

This seems like a bug. On a headless Ubuntu 18.04 server if I try to run certain commands I get the following output:

"Cannot autolaunch D-Bus without X11 $DISPLAY"

Specifically I got this when trying to run sync and test. This is just a test install so I went ahead and installed a GUI to be able to complete what I was testing. It turns out that I didn't have a username/password configured. It seems however this message is displayed (perhaps the way it's set to be bold and red?) requires x11.

This makes it hard to impossible to use the CLI feature on headless systems.

@kspearrin
Copy link
Member

Looks like it is related to libsecret, which we use for storing directory secrets: https://stackoverflow.com/questions/52181225/git-with-libsecret-throws-cannot-autolaunch-d-bus-without-x11-display

@robin-wittler
Copy link

I installed libsecret but the Error remained. I could work around it with using xvfb but then gnome-keyring-daemon has some problems together with dbus. That was the point where I stopped and decided to take a look to other password management tools.

I think you should write a secure cli tool which does not need a running X-Server Session or interactive input. I want to run the sync job within a docker container - without any human interaction needed.

@ggiesen
Copy link

ggiesen commented May 15, 2019

Have the same issue on CentOS 7

@darkyat
Copy link

darkyat commented Jun 7, 2019

I have stumbled upon the same issue trying to dockerize the application using ubuntu/debian images. For me the solution was to install, export and launch dbus, as well as manually starting and unlocking the gnome-keyring-daemon afterwards:

apt-get update
apt-get install -y libsecret-1-0 dbus-x11 gnome-keyring
export $(dbus-launch)
dbus-launch
gnome-keyring-daemon --start --daemonize --components=secrets
echo '<RANDOM-PASSPHRASE>' | gnome-keyring-daemon -r -d --unlock

Also, if you are trying to use a docker container, you ned to add --cap-add=IPC_LOCK when launching the container. Otherwise gnome-keyring-daemon will fail with:

/bin/sh: 1: gnome-keyring-daemon: Operation not permitted

Hope this helps!

@espoelstra
Copy link

You may be able to work around this using the suggestions from the Python keyring library.

https://keyring.readthedocs.io/en/latest/#using-keyring-on-headless-linux-systems

@dorianim
Copy link

Any updates on this?
Will there be a simpler way anytime soon?

@pduchnovsky
Copy link

pduchnovsky commented Mar 31, 2021

I personally kind of work around this issue with this:

bwdc login $bwlogin $bwpassword
BITWARDENCLI_CONNECTOR_PLAINTEXT_SECRETS=true bwdc sync
bwdc logout

Yes it's a bit of overhead but what can we do.
The AD secret isn't as sensitive to stay in the file since it's ro and very limited/specific access anyway.
It would be really awesome if a cli version would not be dependent on x11 tbh..

@bitwarden-bot
Copy link

bitwarden-bot commented Apr 12, 2022

Hi @phrack,
We're cleaning up our repositories in preparation for a major reorganization. Issues from last year will be marked as stale and closed after two weeks. If you still need help, simply clear the label and we'll look into it.
Thanks!

@dorianim
Copy link

This is still an issue.

@phrack
Copy link
Author

phrack commented Apr 12, 2022

Agreed that this is still an issue. I'd love to clear the label as the bot suggests, but I don't have the necessary privileges.

@bert2002
Copy link

bert2002 commented May 9, 2023

This is still a major issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests