mviereck / x11docker

Run GUI applications and desktops in docker and podman containers. Focus on security.
MIT License
5.62k stars 378 forks source link

Failed to start with nerdctl #362

Closed liyimeng closed 3 years ago

liyimeng commented 3 years ago

I try to test nerdctl backend, using command as below.

./x11docker --backend=nerdctl x11docker/xfce xfce4-terminal

The script just flash and crash out immediately. below is the log.

x11docker.log

What has been going wrong ?

mviereck commented 3 years ago

The error message:

x11docker ERROR: Startup of nerdctl failed. Did not receive a container ID. 

  Last lines of container log: 
time="2021-06-03T05:25:57+08:00" level=fatal msg="needs CNI plugin \"bridge\" to be installed in CNI_PATH (\"/opt/cni/bin\"), see https://github.com/containernetworking/plugins/releases: exec: \"/opt/cni/bin/bridge\": stat /opt/cni/bin/bridge: no such file or directory" 
null 
time="2021-06-03T05:25:58+08:00" level=fatal msg="1 errors: [no such object: x11docker/openbox]" 
time="2021-06-03T05:25:58+08:00" level=fatal msg="needs CNI plugin \"bridge\" to be installed in CNI_PATH (\"/opt/cni/bin\"), see https://github.com/containernetworking/plugins/releases: exec: \"/opt/cni/bin/bridge\": stat /opt/cni/bin/bridge: no such file or directory"

The nerdctl installation instructions say:

    Minimal (nerdctl-0.8.3-linux-amd64.tar.gz): nerdctl only
    Full (nerdctl-full-0.8.3-linux-amd64.tar.gz): Includes dependencies such as containerd, runc, and CNI

I've installed nerdctl-full that includes CNI (whatever that is). The error message mentiones that: needs CNI plugin.

Likely you need to install the nerdctl-full package.

liyimeng commented 3 years ago

hmm, thank @mviereck I will give it a try again.

mviereck commented 3 years ago

For comparision you could try nerdctl without x11docker:

nerdctl run --rm -ti alpine sh
liyimeng commented 3 years ago

Thanks @mviereck It is my env. problem.

liyimeng commented 3 years ago

Hi @mviereck I still need some help :)

I find I have some issues with my nerdctl setup because I don't have proper IPv6 on my VM. (Not figure out why nerdctl need ipv6). Anyway, I find another way to bring up the container using crictl.

I firstly follow instructions here https://github.com/mviereck/x11docker/wiki/Custom-access-to-new-X-server to startup an empty X server and then run x11dokcer/xfce container. It dose show up the beautiful graphics, however I don't have any mouse or keyboard events. the mouse cursor just frozen in the middle of the screen.

I test another X11 app from host directly, which dose not run in container at all, the same result. So I guest that I have missed something in starting up X server. Below is the command I used: x11docker --xonly --gpu --xorg --showenv

What can be going wrong?

Thanks a lot in advanced!

liyimeng commented 3 years ago

BTW, my VM was alpine linux. When I start empty X server on unbuntu VM, there seem no issue. Can it be alpine missing some lib. It run X app flawless without x11docker though.

mviereck commented 3 years ago

I find I have some issues with my nerdctl setup because I don't have proper IPv6 on my VM. (Not figure out why nerdctl need ipv6).

I am not sure, too, why nerdctl would need ipv6. Maybe a ticket at https://github.com/containerd/nerdctl makes sense. Two possible workarounds:

It dose show up the beautiful graphics, however I don't have any mouse or keyboard events. the mouse cursor just frozen in the middle of the screen.

Xorg should do all needed setup itself for mouse and keyboard, x11docker does no setup here. Could you show me ~/.cache/x11docker/x11docker.log after a try? Maybe I find a hint in the Xorg output. If you run in a VM as you mentioned above, maybe the issue is somehow VM related, e.g. a host mouse integration failure.

BTW, my VM was alpine linux. When I start empty X server on unbuntu VM, there seem no issue. Can it be alpine missing some lib. It run X app flawless without x11docker though.

Currently I have no good idea why there is an alpine specific issue, especially if there is no Xorg issue if running Xorg without x11docker. Maybe the logfile gives me a hint.

liyimeng commented 3 years ago

@mviereck Thank you so much for timely reply @mviereck! I figure it out! It is alpine bug, I guess. After starting up the empty x server, I need to manually issue udevadm trigger Mouse then suddenly move 👯

Thanks again, you guy rock!

liyimeng commented 3 years ago

I need to give x11docker a star, which I should have done!