mviereck / dockerfile-x11docker-deepin

3D desktop deepin from China
MIT License
33 stars 11 forks source link

Run a single application in seamless mode. #9

Closed hongyi-zhao closed 3 years ago

hongyi-zhao commented 3 years ago

Hi,

Currently, when I want to start a specific GUI app, say, wechat, the command similar to the following is suggested:

$ x11docker x11docker-deepin-wechat wechat

This will open the target app's GUI with the deepin desktop as the background. So I want to know whether it's possible for me to run the app separately just as the manner represented by wine-based solution, i.e., w/o running it on the deepin desktop background.

Regards, HY

mviereck commented 3 years ago

I am not sure if I understand your question. Your command example should run wechat only as a single application.

If you want a separate wechat image not based on x11docker/deepin, here are other solutions (I did not check them myself):

https://github.com/huan/docker-wechat https://github.com/bestwu/docker-wechat https://github.com/RokasUrbelis/docker-wine-linux

hongyi-zhao commented 3 years ago

I am not sure if I understand your question. Your command example should run wechat only as a single application.

I mean only invoke/start the target app's GUI, i.e., wechat here, w/o showing the deepin desktop. For more detail, let me use your example here as an illustration.

Run single application:

$ x11docker x11docker/deepin deepin-terminal

When running it, the screenshot is as follows:

image

As you can see, the terminal window has a larger background window named as Xephyr. I want to know whether I can start the terminal window by suppressing the background window that accompanies it.

If you want a separate wechat image not based on x11docker/deepin, here are other solutions (I did not check them myself):

https://github.com/huan/docker-wechat https://github.com/bestwu/docker-wechat https://github.com/RokasUrbelis/docker-wine-linux

I've seen all of them before I try your solution. Considering that you're the author of x11docker, so I think your solution should be the most versatile, stable, robust and feasible one.

Regards, HY

mviereck commented 3 years ago

As you can see, the terminal window has a larger background window name as Xephyr. I want to know whether I can start the terminal window by suppressing the background window that accompanies it.

Ok, now I understand. x11docker supports several X servers, but only a few are able to show a single window ("seamless mode"). Seamless mode is supported with --hostdisplay, --xpra and --nxagent.

I recommend to install xpra and/or nxagent. You can manually choose --hostdisplay, but I discourage this option for security reasons.

Once xpra or nxagent are installed, x11docker will use them automatically. You don't need to specify the option.

Compare: https://github.com/mviereck/x11docker/wiki/X-server-and-Wayland-Options#attributes-of-x-server-and-wayland-options

hongyi-zhao commented 3 years ago

Wonderful, I now installed the following packages:

$ sudo apt-get install xpra nxagent xvfb

Then I tried with --hostdisplay, --xpra and --nxagent respectively. And I find that --hostdisplay and --xpra will start a position fixed window which can't be dragged with the mouse while the --nxagent option doesn't have this problem. In addition, the --hostdisplay option seems so unstable, especially prone to quit/terminate unexpectedly.

As for the case of --nxagent option is used, the info is as follows:

werner@X10DAi-01:~$ x11docker --nxagent x11docker/deepin deepin-terminal
x11docker WARNING: User werner is member of group docker.
  That allows unprivileged processes on host to gain root privileges.

x11docker note: A few applications do not work well with --nxagent.
  In that case, please try another X server option like --xephyr or --xpra.

It gives this info: "A few applications do not work well with --nxagent.". So I want to know which apps are not compatible with this option?

Regards, HY

mviereck commented 3 years ago

I find that --hostdisplay and --xpra will start a position fixed window which can't be dragged with the mouse

That's very odd. Dragging a window is the job of the host window manager and should not be affected by running an application in the container. Maybe check with other container applications, too?

For --hostdisplay you can try to add --clipboard. That removes some security restrictions and might also fix unexpected termination. --xpra should just work well. If in doubt, I recommend to install xpra from www.xpra.org because some distributions ship buggy versions.

It gives this info: "A few applications do not work well with --nxagent.". So I want to know which apps are not compatible with this option?

I just have a hard time to remember, it's a long time since I checked that. I remember issues with the atom editor and with the cinnamon desktop. The issues are related to X extension COMPOSITE that is somehow buggy in nxagent. Some applications only work if the extension is enabled, others only work if it is disabled. By default x11docker disables this extension in --nxagent. You can force to enable it with experimental/undocumented option --xcomposite.

hongyi-zhao commented 3 years ago

That's very odd. Dragging a window is the job of the host window manager and should not be affected by running an application in the container. Maybe check with other container applications, too?

For --hostdisplay you can try to add --clipboard. That removes some security restrictions and might also fix unexpected termination.

Very good. Using both options above fixes this problem, i.e., as the following:

$ x11docker --hostdisplay --clipboard x11docker/deepin deepin-terminal

--xpra should just work well. If in doubt, I recommend to install xpra from www.xpra.org because some distributions ship buggy versions.

Wonderful. Installation of the latest xpra version from its official repo solves the problem.