docker-in-termux icon indicating copy to clipboard operation
docker-in-termux copied to clipboard

Qemu only uses 2 cores and 1G of memory

Open Eboubaker opened this issue 9 months ago • 3 comments

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?

Eboubaker avatar May 01 '24 12:05 Eboubaker

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.

Eboubaker avatar May 01 '24 13:05 Eboubaker

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?

cyberkernelofficial avatar May 06 '24 16:05 cyberkernelofficial