2

I am using Xephyr to run applications as another user, while being logged in as primary user.

Most applications work fine in Xephyr, except qt4 based. Specifically:

electrum
ipython qtconsole
qbittorrent

The above applications work when started in normal X server, but when I start them in Xephyr, I only see the window frame, but it is blank.

How can I fix this problem ?

My OS is Debian Wheezy and version numbers are:

xserver-xephyr    1.12.4
libqtcore4        4.8.2

Here is how I start my Xephyr session:

Xephyr :1 -screen 1920x1080 -nolisten tcp -reset -terminate >/dev/null 2>&1 &
terminator --execute su - user2 -c 'DISPLAY=:1 startlxde >/dev/null 2>&1 &'

UPDATE I have tested with XFCE4 and have the same problem. QT4 applications still don't work, I get a blank window. As example, see how qbittorrent window loks like:

enter image description here

Martin Vegter
  • 69
  • 66
  • 195
  • 326

2 Answers2

1

While the question assumed that Xephyr was run correctly (since no information is provided on this), I have at least confirmed that qBittorrent runs fine in Xephyr on Debian Xfce Wheezy.

The screenshot below is showing qBittorrent 2.9.8 in Xephyr.

qBittorrent 2.9.8 in Xephyr on Debian Xfce Wheezy

This was tested on Debian Xfce Wheezy and using latest packages of libqtcore4 and xserver-xephyr available to this date, which are similar to versions quoted in the question.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 7.9 (wheezy)
Release:    7.9
Codename:   wheezy

$ dpkg-query -W | grep libqt
libqt4-dbus:i386    4:4.8.2+dfsg-11
libqt4-network:i386 4:4.8.2+dfsg-11
libqt4-xml:i386 4:4.8.2+dfsg-11
libqtcore4:i386 4:4.8.2+dfsg-11
libqtdbus4:i386 4:4.8.2+dfsg-11
libqtgui4:i386  4:4.8.2+dfsg-11

$ dpkg-query -W | grep xephyr
xserver-xephyr  2:1.12.4-6+deb7u6

Identifying the issue

The only relevant search I found was Bug 71421, reporting on "Qt5 apps don't work with Xephyr".

When trying to run any Qt5 (or apparently GTK3) apps inside Xephyr, they don't work (as in nothing is shown). GTK2 or Qt4 works just fine as well as GLX apps (glxgears for example). Also tested on standalone X server with no DM running - Qt5 works perfectly fine there, just inside Xephyr they don't.

This bug is similar to the question case, except affecting only Qt5 applications. The bug was due to Qt5 and it was fixed recently in late April this year.

Besides that, there was no information provided on how the application was run in Xephyr.

The above applications work when started in normal X server, but when I start them in Xephyr, I only see the window frame, but it is blank.

Based on the quoted text, I have something else to doubt: Did Xephyr run with invalid arguments? Or rather, how was the application run as another user in Xephyr?

If you are indeed sure that Qt4 applications don't work in Xephyr, it may be an unreported issue in Qt4 package. But since I have confirmed that qBittorrent (based on Qt4) runs fine in Xephyr, it may be an issue with the "another user" or the way Xephyr was run from current session.

On Xephyr usage

These are some online sources that explain about using Xephyr to accomplish certain tasks.

  1. Xephyr on ArchWiki. A good place to get started for running Xephyr, but doesn't explain much on extensive usage besides running a Terminal or Window Manager in Xephyr.

  2. No idea how to get started with Xephyr. What am I doing wrong? on Xorg mailing list, dated Thu Jan 23 17:16:40 PST 2014. Another way of running Xterm in Xephyr.

  3. How to run multiple X desktops? on Super User, asked Jul 22 '09. One of the answers suggested to use Xephyr. Similar way as suggested in source #1.

  4. Multiseat Configuration/Xephyr: How to make a Multiterminal with Xephyr on Wikibooks.

  5. Screenshots from multiple Xservers on Unix & Linux Stack Exchange, asked Aug 21 '14.

  6. Howto: run firefox (and other things) as a separate user with Xephyr. This seems to be the most similar usage as hinted in the question.

The reason I have quoted these sources, is to provide relevant hints that may help you to clarify whether you are running Qt application in Xephyr correctly or else.

That being said, there is something tricky for understanding the first sentence "using Xephyr to run applications as another user, while logged in as primary user". After all, I didn't create "another user" for test running qBittorrent in Xephyr. Perhaps someone else can give a better answer.

0

It may be useful to know which command is used to start Xephyr, and which window manager is in use.

I tried this:

Xephyr :1 &
DISPLAY=:1 openbox &
DISPLAY=:1 qbittorrent

and got incomplete window content of qbittorrent. Trying the same with xfwm4:

Xephyr :1 &
DISPLAY=:1 xfwm4 &
DISPLAY=:1 qbittorrent

then everything is fine, and qbittorrent is usable.

I can't explain why there is a difference, but obviously there is one. I suspected problems with composite and tried to run Xephyr with composite enabled:

Xephyr +extension Composite :1 &

but this seems to make no difference.

EDIT: xfwm4 has compositing abilities, openbox does not. Maybe composite is nevertheless the crucial key.

mviereck
  • 2,377
  • 1
  • 18
  • 18