# [Solved] Problem regarding wpa_supplicant and wpa_gui

## dchoi2464

I wasn't sure if I should post this in Networking & Security as it's technically a GUI problem; however, since it's related to wpa_supplicant, I just posted my question here

I have recently decided to get into the world of Linux and thought it would be better to learn to swim in the deep end i.e. use Gentoo as my first distro. I finally got a working install last night and configured my wireless networking using wpa_supplicant and its command line interface. 

However, from reading the wiki page for wpa_supplicant, I found that I could install wpa_supplicant using the "qt5" USE flag enabled in order to be able to use the graphical interface for wpa_supplicant. Thus, I re-installed wpa_supplicant with the "qt5" flag enabled: 

```
USE="qt5" emerge --ask net-wireless/wpa_supplicant
```

After that was done, I ran wpa_gui, but encountered the following error:

 *Quote:*   

> qt.qpa.xcb: could not connect to display 
> 
> qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
> 
> This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
> ...

 

After searching around the web, I was advised to run the command again after setting QT_DEBUG_PLUGIN to 1; the output I got is in the following link:

https://dpaste.com/4WBY7BFU9

Another forum post I found suggested I run ldd on libqxcb.so (although I didn't understand what this command does); the output I got is in the following link:

https://dpaste.com/7T7UAXT6Z

As a sanity check, I ran:

```
equery uses wpa_supplicant
```

and got the following output:

https://dpaste.com/APP64TNW4#

NOTE: It seems like wgetpaste didn't capture the full output of the equery command. However, I know that I had two '+' in both U and I columns for "qt5"

I have no idea how to continue from here. I would appreciate any help on how to fix this.Last edited by dchoi2464 on Sun Oct 10, 2021 11:26 am; edited 1 time in total

----------

## Hu

 *dchoi2464 wrote:*   

> 
> 
> ```
> USE="qt5" emerge --ask net-wireless/wpa_supplicant
> ```
> ...

 This is fine for experimentation, but the USE change was not saved.  If you now re-ran emerge --ask net-wireless/wpa_supplicant, Portage would rebuild without USE=qt5.  Changes you want to keep should be recorded in /etc/portage/package.use, so that they apply with every rebuild. *dchoi2464 wrote:*   

> After that was done, I ran wpa_gui, but encountered the following error:

 As what user did you run it?  Could you, from that same shell, run xmessage OK and get a window?  Your error output suggests you ran it from a window where you cannot use X11 applications. *dchoi2464 wrote:*   

> After searching around the web, I was advised to run the command again after setting QT_DEBUG_PLUGIN to 1; the output I got is in the following link:
> 
> https://dpaste.com/4WBY7BFU9

 Unfortunately, this does not seem to show anything diagnostically useful. *dchoi2464 wrote:*   

> Another forum post I found suggested I run ldd on libqxcb.so (although I didn't understand what this command does); the output I got is in the following link:

 man ldd describes it as ldd - print shared object dependencies.  It lists all the shared objects (DLLs, if you prefer Windows terminology) that are required for the target file to successfully load. *dchoi2464 wrote:*   

> NOTE: It seems like wgetpaste didn't capture the full output of the equery command. However, I know that I had two '+' in both U and I columns for "qt5"

 equery tries to be smart and switches to a terse form when the output is not a terminal.  For your edification, compare the output of :

```
equery uses wpa_supplicant

equery uses wpa_supplicant | cat

equery --no-pipe uses wpa_supplicant | cat
```

There is no need to post any of those here.

----------

## dchoi2464

Thank you for your quickly reply. I originally ran wpa_gui as root but I read somewhere on the forum that GUI may not work for root user. So I tried again with a user that wasn’t the root user, but still got the same result. I ran xmessage ok for both users and got the same result for both

 *Quote:*   

> Error: Can’t open display:

 

----------

## Hu

Your $DISPLAY appears to be unset, so the GUI program has no information about where to display its window.  How was this terminal started?  What terminal emulator is it?

----------

## dchoi2464

 *dchoi2464 wrote:*   

> Thank you for your quickly reply. I originally ran wpa_gui as root but I read somewhere on the forum that GUI may not work for root user. So I tried again with a user that wasn’t the root user, but still got the same result. I ran xmessage ok for both users and got the same result for both
> 
>  *Quote:*   Error: Can’t open display: 

 

EDIT: From further research, it seems that I haven’t correctly configured my kernel for my laptop which has an integrated Intel graphics card and an NVIDIA graphics card. I will try reconfiguring the kernel first.

----------

## cboldt

Never crossed my mind that perhaps the attempt was being run from console, not from what I'll call an X11 environment, that is some window manager, or desk manager, etc.

I dropped into a regular tty, ran `wpa_gui`, and got EXACTLY the same error.

I suspect the poster isn't yet in a GUI environment.

----------

## dchoi2464

 *cboldt wrote:*   

> I suspect the poster isn't yet in a GUI environment.

 

This was exactly the issue. I was confused as the wiki page didn't mention anything about having to be in a GUI environment; however, in hindsight, it seems rather obvious. 

Thank you for all the help!

----------

## Hu

Although uncommonly used, one of the odd features of X11 is that you can run a GUI program from the Linux text console, [u]if[/i] you have a GUI server running somewhere else and instruct the program how to find and display itself there.  You will need to go to the GUI server to interact with it.  This could be useful if the GUI server is running on a different machine, and you need the program to act on the machine where it runs, but display elsewhere because the GUI system has a browser, or a nicer keyboard, or even just that you don't have a working GUI on one system yet.

----------

