crops / poky-container

A container image that is able to run bitbake/poky. It has helpers to create users and groups within the container. This is so that the output generated in the container will be readable by the user on the host.
GNU General Public License v2.0
206 stars 94 forks source link

QEMU hangs in Docker after the login prompt #48

Closed loic-yvonnet closed 4 years ago

loic-yvonnet commented 4 years ago

In summary, QEMU hangs in the CROPS/Poky Docker container after the login prompt.

The problem may be reproduced from a Ubuntu 18.04 host by following these steps:

Actual result:

Expected result:

On the other hand, compiling and running the core-image-minimal from the Ubuntu 18.04 host in QEMU works as expected.

Is there a workaround to run QEMU from a Docker container?

PS: I am new to the Yocto project and QEMU. It may not be a good idea to run QEMU on top of a Docker container. I am simply trying to see if I can run everything from a container.

rewitt1 commented 4 years ago

Hi @loic-yvonnet,

Thanks for the extremely easy to follow instructions on reproducing the issue.

PS: I am new to the Yocto project and QEMU. It may not be a good idea to run QEMU on top of a Docker container. I am simply trying to see if I can run everything from a container.

Running qemu inside of the container should work. I reproduced the issue you mentioned, and I think the hang you are seeing is because there is no tty. If you instead tried to run runqemu in the shell started from docker run, I expect it should work.

You could also copy run.sh into workdir and run docker exec -w /workdir -u pokyuser -it yocto-dev /workdir/run.sh

Unfortunately, I'm unsure if there is a way to use your original command. Because you will likely get the following error if you try using a tty with your original command.

$ sudo docker exec -w /workdir -u pokyuser -it yocto-dev bash < run.sh
the input device is not a TTY
loic-yvonnet commented 4 years ago

Hi @rewitt1,

Many thanks for your quick answer. I confirm that the following worked for me:

You could also copy run.sh into workdir and run docker exec -w /workdir -u pokyuser -it yocto-dev /workdir/run.sh

Thanks a lot.