以 root 身份运行图形应用程序时出现问题

以 root 身份运行图形应用程序时出现问题

如果我尝试通过我的用户运行 firefox ( $ firefox) 或 xxdiff ( $ xxdiff),则一切都会正常工作,但是一旦我以 root 身份登录 ( su -),就会出现错误:

# firefox
Error: no DISPLAY environment variable specified

# xxdiff
qt.qpa.xcb: could not connect to display :0.0
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.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (stack dumped)

希望有人遇到过或知道如何解决这个问题。尝试更改 DISPLAY 没有成功,但也许我做错了什么。

相关内容