如何使用 Qt 和 D-Bus 在 schroot 中正确运行图形应用程序?

如何使用 Qt 和 D-Bus 在 schroot 中正确运行图形应用程序?

我试图获得 Audex跑步16.04 LTS 内部schroot在 20.04 LTS 主机上。

下面的方法对于基于 Gtk 的应用程序可以正常工作,我已经测试过了。

在当前情况下,我做了以下事情:

sudo apt-get install schroot debootstrap -y

cat <<EOF | sudo tee /etc/schroot/chroot.d/xenial.conf
[xenial]
description=Ubuntu 16.04 Xenial
directory=/srv/chroot/xenial
root-users=$USER
type=directory
users=$USER
EOF

sudo mkdir -p /srv/chroot/xenial

sudo debootstrap xenial /srv/chroot/xenial

cat <<EOF | sudo tee /srv/chroot/xenial/etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted universe multiverse
EOF

schroot -c xenial -u root apt-get update
schroot -c xenial -u root apt-get install audex 

然后尝试从终​​端启动它

schroot -c xenial env DISPLAY=:0.0 audex

并得到以下终端输出:

QDBusConnection: session D-Bus connection created before
QCoreApplication. Application may misbehave. QDBusConnection: session
D-Bus connection created before QCoreApplication. Application may
misbehave. Failed enumerating UDisks2 objects:
"org.freedesktop.DBus.Error.Disconnected"   "Not connected to D-Bus
server"  Failed enumerating UDisks2 objects:
"org.freedesktop.DBus.Error.Disconnected"   "Not connected to D-Bus
server"  Failed enumerating UDisks2 objects:
"org.freedesktop.DBus.Error.Disconnected"   "Not connected to D-Bus
server"  Failed enumerating UDisks2 objects:
"org.freedesktop.DBus.Error.Disconnected"   "Not connected to D-Bus
server"  Failed enumerating UDisks2 objects:
"org.freedesktop.DBus.Error.Disconnected"   "Not connected to D-Bus
server"  Failed enumerating UDisks2 objects:
"org.freedesktop.DBus.Error.Disconnected"   "Not connected to D-Bus
server"  KCrash: Application 'audex' crashing... KCrash: Attempting to
start /usr/lib/kde4/libexec/drkonqi from kdeinit KCrash: Connect
sock_file=/home/mate/.kde/socket-focal/kdeinit4__0 Warning: connect()
failed: : No such file or directory KCrash: Attempting to start
/usr/lib/kde4/libexec/drkonqi directly audex(2145): Communication
problem with  "audex" , it probably crashed.  Error message was: 
"org.freedesktop.DBus.Error.NoReply" : " "Message recipient
disconnected from message bus without replying" " 

drkonqi(2154): Unable to find an internal debugger that can work with
the KCrash backend  drkonqi(2154): The specified process does not
exist. 

并且未显示应用程序窗口。

我猜这里的 D-Bus 有问题。我们该如何修复它?

答案1

尝试

export $(dbus-launch)

在启动其他应用程序之前运行新的消息总线守护进程

相关内容