Whonix Wiki Download Docs News Support Tips Issues Contribute DONATE

Whonix Gateway CLI- - "Could not connect to any X display"

I’m checking some simple aspects by impersonating the average user of Whonix by following documentation.

In the following link https[:]//www[.]whonix[.]org/wiki/Anon_Connection_Wizard#Run_Anon_Connection_Wizard
is reported the following statement “If you are using a terminal Whonix-Gateway ™, type: lxsudo anon-connection-wizard”
Of course it will return an error:
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.

It should occur because X is not installed.

I tested by installing X by “sudo apt-get install xorg openbox” on Whonix Gateway CLI and then, by performing “lxsudo anon-connection-wizard”, I receive the same error.

Is it a known issue?

If there is already a workaround/solution to use correctly X on Whonix CLI, could we update that wiki page by inserting that the specified command requires specific pkg to be installed?


ACW is a GUI (graphical user interface) application.

Quote https://www.whonix.org/wiki/VirtualBox/CLI

Whonix ™ first time users warning Whonix ™ with CLI is a version suited for advanced users – those who want Whonix ™ without a GUI. Everyone else should install the user-friendly Whonix ™ VirtualBox with XFCE.

It is assumed that advanced users know that GUI applications cannot be started from CLI.
(To be more exact: It is assumed that advanced users know that GUI applications cannot be started from terminal. Real terminal. Without X window system.

Installing https://en.wikipedia.org/wiki/X_Window_System / openbox… This applies:

In that case, well… Easier to use:

I am not sure it’s worth pointing out on the https://www.whonix.org/wiki/Anon_Connection_Wizard page to say “doesn’t work with Whonix-Gateway CLI. Requires a graphical desktop environment.” Guess that would add more confusion to laymen than clarification.

Upgraded your accounts. You can post links now.

Hi @Patrick
I want to thank you for quick answers.

You are right to not give bad messages like “doesn’t work with Whonix-Gateway CLI…”.

I did some tests in a clean Whonix Gateway CLI machine. It can be worth if atleast a workaround is provided for CLI.

In our case, it is needed only to execute:
sudo apt-get install xinit

In X environment it is possible to run lxsudo anon-connection-wizard correctly.

Then, when finished, the user can come back to the previous terminal env by typing “exit” on X terminal.

The chosen configurations are applied correctly to the main CLI environment.

I’m just worried because an user that reads the wiki, thinks that out-of-the-box he can run the wizard. For this reason I would prefer to insert in the doc the detail to install xinit and run startx for executing the wizard, to not confuse the users.

I know that is a tactical workaround, maybe in my honest opinion could be useful in the future to write the anon-connection-wizard (/usr/lib/python3/dist-packages/anon_connection_wizard/anon_connection_wizard.py) by using “dialog” for the CLI version as already done for the “whonixsetup - Connection Wizard” (/usr/bin/whonixsetup) despite the former is written in python, the latter in bash.

1 Like

That’s interesting but not something I want to encourage Whonix to do. Would needlessly complicate the wiki.

For a functional X environment, there is: https://www.whonix.org/wiki/VirtualBox/XFCE

For users that want X, open box, other desktop envrionments, there is: https://www.whonix.org/wiki/Other_Desktop_Environments

I see. I’ve modified the wiki to say:

If you are using a terminal emulator (such as for example xfce4-terminal) on Whonix-Gateway ™, type.

That I consider too complicated as per first chapter of this post.

There are many GUI applications which won’t work in CLI and many cases in which Whonix wiki assumes a GUI.

People who start ACW, specifically after first boot, don’t yet have an internet connection which would allow installation of additional packages.

ACW indeed has no CLI support yet.

Technical details:

  • There’s no need strong technical requirement to rewrite setup-dist (previously whonixsetup) in python.
    • That is because /usr/bin/anon-connection-wizard could detect if it is running with or without X. If not running X, start setup-dist (or ACW CLI - to be invented). If running X, start ACW GUI.
  • One could port setup-dist to ACW. The rudimentary Tor connection wizard functionality of setup-dist doesn’t belong into setup-dist. It belongs into ACW. That would be a bit nicer.

Patches welcome.

  • Also as a stopgap a patch aborting with an error message X is not detected would be welcome.

Looking at https://www.whonix.org/wiki/Template:Start_Anon_Connection_Wizard and the places where it is used https://www.whonix.org/wiki/Special:WhatLinksHere/Template:Start_Anon_Connection_Wizard I’ve added:

If you are using a CLI Whonix-Gateway ™, see footnote. [1]

  1. Anon Connection Wizard is a graphical user interface (GUI) application. It has not command line interface (CLI) support yet. [archive] It is therefore unavailable on Whonix-Gateway ™ CLI. Use whonixsetup (setup-dist in next release of Whonix ™) instead, which however is limited and does not support Bridges.

That would be better from a Whonix GUI perspective. I am always wondering if there are any “lost at hello” moments in Whonix documentation even for users which do read documentation. There probably are but it would be good to fix these as much as possible.

Whonix CLI does’t have “first class support” (for lack of better term). It was a contribution and the contributor became inactive later. It’s hence “dragged along”. It’s still working fine. Highly unlikely of having exclusive unique (meaning CLI version only, not in GUI version) security issues due to modular design of Whonix. But it’s not project focus at this time. Therefore I won’t be inventing ACW CLI support.

1 Like

@Patrick at this point, for the Gateway CLI version, I think that, currently, the anon-connection-wizard command is irrelevant since it uses Qt library. So we could also delete its related folders/files (like /usr/lib/python3/dist-packages/anon_connection_wizard/anon_connection_wizard.py file) because it will never be used (if not running X), right?

ACW has files which setup-dist depends on, is a dependency of setup-dist. For example:

Imperfect split/implementation. Patches welcome.