How to verify $DISPLAY



Crossover is a gui application that works on my lxd gui1804 container with user name ubuntu

when i try using crossover on the lxd gui1804 container with a different user [sherab] here’s the return:

sherab@gui1804:~$ /opt/cxoffice/bin/crossover 
No protocol specified
No protocol specified
No protocol specified
No protocol specified
crossover:error: Verify $DISPLAY: it is not set, invalid or you are not allowed to access it

I obviously need to do something with the #DSIPLAY
but what…?



You would need to edit the ~/.profile of this new user so that they also get the $DISPLAY environment variable to point to :0.

But on top of that, there is a the issue of the UIDs not matching between the host and the container. That is, in the LXD gui profile configuration, there is this line, which instructions to align the UID 1000 from the host to the UID 1000 in the container.

  raw.idmap: both 1000 1000

However, your sherab account in the container probably has the UID 1001 (second account), so it does not match.

So, what do you do? Well, this raw.idmap: both 1000 1000 trick is there in order to avoid the older LXD GUI tutorials of using an .Xauthority file.

Therefore, if you cannot create individual containers for each application (like Crossover), then you would need to deal with XAuthority files.


Hi @simos
Thanks for replying
So are you suggesting that for each application I should have a new lxd container?
or should i simply use all the applications in the same user - ubuntu rather than sherab? and then the mapping will remain consistent between the host and the container and avoid dealing with X.authority and keep my life simple. ?



Personally, if I were to use Crossover, I would launch a new container, let’s say crossover.
Then, I would know that anything related to Crossover, is restricted to this container.
And if something goes wrong in crossover, I can delete and recreate. Or, even better, as soon as I first setup the container, I can take a snapshot (lxc snapshot crossover my-crossover-clean-installation). Then, if I mess things up, I can restore from the snapshot and start over. (lxc restore crossover my-crossover-clean-installation`).

It is also OK to create a single GUI container, then use the default ubuntu account to install all applications. If you were to create multiple accounts (like sherab) in the GUI container, then it would require more thinking as to how to make it possible to get them all to start X11 programs.
I have not given much thought on that and I think it would be more complicated. If there is a compelling reason, I might give it a go and find some simple recipe to make it work well.


Hi @simos
Thanks for your clear reply
there is no compelling reason [except my ignorance]
I’ll tkae your advice about container only for crossover and snapshoting it etc.