docker-in-termux
docker-in-termux copied to clipboard
Qemu only uses 2 cores and 1G of memory
My phone has 8 cores and 8G of memory but when running lscpu and free -h in the alpine box it shows 2 cores and 1G of memory can you modify the qemu run command so that it uses all available resources?
For now i had to modify the qemu run command
mem=$(free -m | grep -oP '\d+' | head -n 1)
cpus=$(nproc)
qemu-system-x86_64 -machine q35 -m $mem -smp cpus=$cpus -cpu qemu64 -drive if=pflash,format=raw,read-only=on,file=$PREFIX/share/qemu/edk2-x86_64-code.fd -netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 -device virtio-net,netdev=n1 -nographic alpine.img
I wanted you to change it in the readme to be the default, the emulation was very slow before i changed this.
Thanks for the feedback! While increasing resources can improve performance for some users, it's not necessary for everyone. The default configuration aims for wider compatibility. We can definitely add your script as an optional optimization in the README for users who want to utilize more resources. Would you like to contribute by submitting a pull request with this information?