dbhi / qus

qemu-user-static (qus) and containers, non-invasive minimal working setups
https://dbhi.github.io/qus
Other
317 stars 17 forks source link

Question: qus after `docker system prune` #23

Open gogobd opened 8 months ago

gogobd commented 8 months ago

Hi! As far as I understood I have to call docker run --rm --privileged aptman/qus -s -- -p after I do docker system prune -af. Is that correct? Is there a way to make qus "survive" a system prune or have it restart automatically?

Btw thanks everyone for this extremely useful piece of software!

umarcor commented 4 months ago

My guess is that you should not need to register the interpreter again after a docker system prune. Did you try it?

When you register the interpereter the first time, it is done persistently, so the interpreter (the QEMU static binary) is loaded into memory. Then, the container exits and it's removed. From there on, it should not matter what you do with docker. You should be able to even uninstall it and still execute foreign binaries on the host (which will be handled by the interpreter still loaded into memory).

However, if you restart the host system you will need to register the interpreter again. You can use typical features/tools, such as systemd, in order to have qus run after a host system (re)start. There is some support for systemd in qemu-binfmt-conf.sh (see https://github.com/qemu/qemu/blob/master/scripts/qemu-binfmt-conf.sh#L197-L200 and https://github.com/qemu/qemu/blob/master/scripts/qemu-binfmt-conf.sh#L293-L296) but that's unrelated to qus. In order to use that, you would need to have the binaries available on the host. Alternatively, you could write your own systemd task which calls aptman/qus.