UI apps can't connect to display in lxc container

Asked by Mikael Pahmp

After upgrading from 14.10 to 15.04, I started and attached to my lxc (privileged) containerand tried to start some UI apps which all fail with similar errors - "can't connect to display".

Is this a known problem or is their something I should configure differently regarding lxc or X11 for 15.05?

E.g.:

$ echo $DISPLAY
:0
$ sudo lxc-start -n ub1404 -d
$ sudo lxc-wait -n ub1404 -s RUNNING
$ sudo lxc-attach -n ub1404 -- env DISPLAY=$DISPLAY sudo -u mikael -i
mikael@ub1404:~
$ echo $DISPLAY
:0
mikael@ub1404:~
$ gitk
No protocol specified
No protocol specified
application-specific initialization failed: couldn't connect to display ":0"
No protocol specified
No protocol specified
Error in startup script: couldn't connect to display ":0"
    while executing
"load /usr/lib/x86_64-linux-gnu/libtk8.6.so Tk"
    ("package ifneeded Tk 8.6.1" script)
    invoked from within
"package require Tk"
    (file "/usr/bin/gitk" line 10)

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mikael Pahmp (mikael-pahmp) said :
#1

If I use "ssh -X" to connect to the container, UI apps work fine.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Mikael Pahmp (mikael-pahmp) said :
#3

I still have this problem. this just stopped working when upgrading to 15.04.

Software Updater daily tells me that it wants to upgrade "LXC runtime" but the checkbox for selecting it is disabled. All other updates can be installed, which I do.

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.