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

Greetings,
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?

Regards

ACW is a GUI (graphical user interface) application.

Quote Whonix for Windows, macOS, Linux inside VirtualBox

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 X Window System - Wikipedia / openbox… This applies:

In that case, well… Easier to use:

I am not sure it’s worth pointing out on the Anon Connection Wizard - Whonix 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
startx

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: Whonix for Windows, macOS, Linux inside VirtualBox

For users that want X, open box, other desktop envrionments, there is: Other Desktop Environments - Whonix

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 Template:Start Anon Connection Wizard - Whonix and the places where it is used Login required - Whonix 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:

https://github.com/Whonix/setup-dist/blob/master/usr/lib/setup-dist/ft_m_1#L86

Imperfect split/implementation. Patches welcome.