-
-
Notifications
You must be signed in to change notification settings - Fork 3
Support starting a Desktop Environment in a Window #16
Comments
We now have a first, super rough draft for running X11 environment in master. Although the Desktop Environment is not preinstalled, it works if we install and configure it following along the code of ContainerBox: https://github.com/AlexandreDey/ContainerBox/blob/master/etc/creator/templates/ubuntu It seems LightDM is the key here to forward the Session to Xephyr. Also, starting the things in the right order seems to be crucial. |
The following issues needs still to be solved:
Wait for cloud-init: With the following command we can wait for cloud-init to complete: Use pre-built images Would be the better way to set things up as it provides a better UX. Opened issue for this: lxc/lxc-ci#154 |
Maybe there is some more we can learn from the x11docker project: |
Rough outline of the desktops and platforms we should support from the beginning. This list is just an idea and can change at any time:
|
Thanks to the input from here, we are now able to start Wayland and Xwayland on host. Still need to find the proper way to map the newly created X server into the container though:
But if we look at the container config, the environment variables are set:
On host, the X1 socket is created:
And in the container, the X0 socket is also available - don't know if the permissions are correct though:
And the environment variables in the container:
|
Well for me its root (inside container): Also (as I already said) simos is favoring proxys:
Source: https://blog.simos.info/running-x11-software-in-lxd-containers/ |
@toby63 I'm aware of the proxy approach and ultimately its the goal to use it, as its the recommended way. But in earlier testings the proxy approach did not work, because LXD was complaining about invalid properties (I guess LXD v3.0.3 does not support all needed proxy configuration properties yet). As Tins is primarily for elementary and elementary 6.0 is not released yet, I have to stick with the "old" approach for now. |
Ok, I understand.
Just for testing, you might try these two proxy approaches. Also: |
@toby63 unfortunately I get the following errors:
Or if I remove
And if I remove
Snap would be an option, yes. But I was hoping for as much automation as possible - and when packaging for AppCenter as *.deb I can add simply add lxd as dependency. Also don't know if a snap is easier to get going, as I expect other permission issues cause the package is in its own "sandbox', right? |
I guess I fixed the Display Server permission issue by adding the
Now the permissions of
Still not able to sucessfully execute
Although on host it works. |
This is an authentication issue. |
Authentication does not seem to be the root cause here. I tried as suggested, but still get the same error in container. Fun fact: As soon as Xwayland runs, every new window which is opened on host does get send to it and is rendered in Will continue to experiment and have another look at the x11docker code, seems like I'm missing some tiny bits to get this working correctly. |
Generating the X client cookie now on host, passing it to Xwayland as well as mounting it into the container. Also mapping X1 -> X1 in the container as suggested (for details see this commit). But trying to run
From what I can tell, the environment in the container looks good:
What seems a bit weird, the environment of the container user looks entirely different - don't know if this is relevant though:
|
Try
What is your host desktop environment? I once got a bug report with GNOME on host with the same issue. |
@mviereck you were right, its indeed a permission/authentication issue: There was an issue which lead to a wrong UID, so that probably prevented authentication as well. Once I fixed the UID, removed Next I'll try set the environment variable for the user automatically and then readd Once again, thanks for all your support - without it, this would took me waaaaaay longer to get running 😍️ |
We now have something close to workable. Only thing missing: Authentication (surprise, surprise ...). Does anyone has an idea whats wrong? I tested the following three cases by executing the following command: Nr. 1: No Nr. 2: Nr. 3: |
Just figured out that running the following on host works:
So I guess the X client cookie is host specific... Is there a way to create it on host and share it with the container, or do I need to create it in container and somehow share it with host because Xwayland runs on host? |
🤔 Update: Somehow my search function did not find your profile in https://github.com/marbetschar/tins/blob/master/data/lxd/profiles/tins-x11.json
Setting the uid exactly the same, is maybe necessary to use the same .Xauthority file... |
@toby63 there‘s room for improvement for sure. Just trying to get something working and take it from there. UID/GID is not the problem, as I already set these. Will try to create the .Xauthority in container and pass it to Xwayland on host - I guess this will do the trick. |
I recommend to not use
There is some network specific information in the first 4 bytes of the cookie. You can replace them with
Full cookie creation process example done by x11docker:
Some tricks here: TL;DR:
You're welcome. :-) |
This did the trick, thank you!! Since everything is in place now, next step is to autostart the desktop environment 👍️ |
Basic Image Server is up & running: Will split up the remaining tasks, into multiple issues so it gets easier to work with. |
It should be possible to start another Desktop Environment from a container in a window.
The text was updated successfully, but these errors were encountered: