Is there a way to use the protonvpn-cli v3 in linux without x11 server?

Hi,

After following the istructions at https://protonvpn.com/support/linux-vpn-tool/ I installed the protonvpn cli3 tool (there is not v4 yet). There , a video is showing that when I run
protonvpn-cli login username
I get asked for a poswrod and can start using the tool. But that is not true, when I run the command inside a remote computer without gui, I get the following error related to not being able to launch the x11 server. Is there a way to use the CLI tool without an x11 server?
Proton VPN CLI v3.13.0 (protonvpn-nm-lib v3.16.0; proton-client v0.7.1)

Traceback (most recent call last):

File “/usr/lib/python3/dist-packages/secretstorage/init.py”, line 47, in dbus_init
return dbus.SessionBus()
File “/usr/lib/python3/dist-packages/dbus/_dbus.py”, line 212, in new
return Bus.new(cls, Bus.TYPE_SESSION, private=private,
File “/usr/lib/python3/dist-packages/dbus/_dbus.py”, line 102, in new
bus = BusConnection.new(subclass, bus_type, mainloop=mainloop)
File “/usr/lib/python3/dist-packages/dbus/bus.py”, line 124, in new
bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ExecFailed: /usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/keyring/linuxkeyring.py”, line 21, in getitem
stored_data = self.__keyring_backend.get_password(
File “/usr/lib/python3/dist-packages/keyring/backends/SecretService.py”, line 64, in get_password
collection = self.get_preferred_collection()
File “/usr/lib/python3/dist-packages/keyring/backends/SecretService.py”, line 46, in get_preferred_collection
bus = secretstorage.dbus_init()
File “/usr/lib/python3/dist-packages/secretstorage/init.py”, line 51, in dbus_init
raise SecretServiceNotAvailableException(
secretstorage.exceptions.SecretServiceNotAvailableException: /usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/bin/protonvpn-cli”, line 11, in
load_entry_point(‘protonvpn-cli==3.13.0’, ‘console_scripts’, ‘protonvpn-cli’)()
File “/usr/lib/python3/dist-packages/protonvpn_cli/main.py”, line 21, in main
ProtonVPNCLI()
File “/usr/lib/python3/dist-packages/protonvpn_cli/cli.py”, line 65, in init
res = getattr(self, args.command)()
File “/usr/lib/python3/dist-packages/protonvpn_cli/cli.py”, line 162, in login
return self.cli_wrapper.login(args.username)
File “/usr/lib/python3/dist-packages/protonvpn_cli/cli_wrapper.py”, line 63, in login
if self.protonvpn.check_session_exists():
File “/usr/lib/python3/dist-packages/protonvpn_nm_lib/api.py”, line 356, in check_session_exists
return self._env.api_session.is_valid
File “/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/environment.py”, line 56, in api_session
self.__api_session = APISession()
File “/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/session/session.py”, line 264, in init
self.__keyring_load_session()
File “/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/session/session.py”, line 293, in __keyring_load_session
keyring_data_user = ExecutionEnvironment().keyring[
File “/usr/lib/python3/dist-packages/protonvpn_nm_lib/core/keyring/linuxkeyring.py”, line 32, in getitem
raise exceptions.KeyringError(e)
protonvpn_nm_lib.exceptions.KeyringError: /usr/bin/dbus-launch terminated abnormally with the following error: Autolaunch error: X11 initialization failed.

No, even though it’s supposed to be a cli tool it requires X11. See https://www.reddit.com/r/ProtonVPN/s/kblyiYBgFg (note that the community cli recommended here no longer works) or more recently some discussion of it in the comments of this https://www.reddit.com/r/ProtonVPN/s/Hapl9ZO3Ho

I have a headless server and I just manage the wireguard conf directly with wg-quick.

Note: As an alternative I have been trying to use the open vpn per region config (so I can connect randomly to a server in the given region), and it does not work reliably. I followed https://protonvpn.com/support/linux-openvpn/ , and It keeps givinf me AUTH_FAILED and just some times it works (which shows I am giving it the right credentials). Using wireguard is not possible since it work per server, not per region.

xvfb allows you to run X11 programs without an X server by simulating one, might be worth a try.

For now the latest community version works. It was released two weeks ago. But the proton team have been saying that it is not supported and will certainly break in the future, so I was trying the official solution which does not work as cli even though that is shown in the official web page.
I will need to find a way to download tenths of wireguard configs to just be able to connect to a random server in a given country…

Interesting, will try it as a workaround for now. Thanks