containers / containers/toolbox

"cannot open display: :0" when running gui apps in root toolbox

Open
#1,360 2 comments 1 reaction 0 assignees View on GitHub
1. Bug
Dominant language
Go
Stars
3.5k
Forks
262
Avg merge
3d 1h
Merged PRs (30d)
1

Description

**Describe the bug**
If I run a gui app inside a root toolbox (sudo toolbox create), it should simpy start the gui.

**Steps how to reproduce the behaviour**
1. I am not sure if it's only this tool that's affected by this behavior. Install https://github.com/lakinduakash/linux-wifi-hotspot in a plain fedora (root)toolbox.
2. After installing, running it says:
```
⬢[root@toolbox linux-wifi-hotspot]# wihotspot
Authorization required, but no authorization protocol specified

(wihotspot-gui:8518): Gtk-WARNING **: 05:56:30.097: cannot open display: :0
```

**Expected behaviour**
The gui should start.

**Actual behaviour**
It didn't

**Screenshots**

**Output of `toolbox --version` (v0.0.90+)**
`toolbox version 0.0.99.4`

**Toolbox package info (`rpm -q toolbox`)**
`toolbox-0.0.99.4-1.fc38.x86_64`

**Output of `podman version`**
```
Client: Podman Engine
Version: 4.6.1
API Version: 4.6.1
Go Version: go1.20.7
Built: Fri Aug 11 06:07:53 2023
OS/Arch: linux/amd64
```

**Podman package info (`rpm -q podman`)**
`podman-4.6.1-1.fc38.x86_64`

**Info about your OS**
Fedora Silverblue 38

**Additional context**
If I install the tool in a non-root toolbox, the gui does start but it spews policykit errors. I did the same thing in a distrobox (distrobox create --root) and it worked just fine.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the failure from a root toolbox created with `sudo toolbox create`, using the reported `wihotspot` command and its display authorization output. Compare it with a non-root toolbox and root distrobox, as described, and consider the issue complete when GUI applications start successfully in the root toolbox without the display error.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux
Domain
cli, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.