bakkar
bakkar
TTermux
Created by bakkar on 6/3/2024 in #support
Running qemu-aarch64 emulator inside Termux
Hello I tried to run qemu-system-x86_64 to run an alpine image it worked fine using this command:
pkg install qemu-utils qemu-common qemu-system-x86_64-headless wget -y
wget http://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-virt-3.19.1-x86_64.iso
qemu-img create -f qcow2 alpine.img 5G
qemu-system-x86_64 -machine q35 -m 1024 -smp cpus=2 -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 -cdrom alpine-virt-3.19.1-x86_64.iso -nographic alpine.img
pkg install qemu-utils qemu-common qemu-system-x86_64-headless wget -y
wget http://dl-cdn.alpinelinux.org/alpine/v3.19/releases/x86_64/alpine-virt-3.19.1-x86_64.iso
qemu-img create -f qcow2 alpine.img 5G
qemu-system-x86_64 -machine q35 -m 1024 -smp cpus=2 -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 -cdrom alpine-virt-3.19.1-x86_64.iso -nographic alpine.img
It booted and I installed the system in the disk normally. Then I noticed I can get better performance by using aarch64 instead of x86_64 since my phone is using arm64 CPU This is what i tried:
pkg install qemu-system-arm
qemu-img create -f raw alpine-arch64.img 2G
wget https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/aarch64/alpine-virt-3.20.0-aarch64.iso
qemu-system-arm \
-machine virt \
-m 1024 \
-smp cpus=2 \
-drive if=pflash,format=raw,read-only=on,file=$PREFIX/share/qemu/edk2-aarch64-code.fd \
-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 \
-device virtio-net,netdev=n1 \
-drive file=alpine-arch64.img,format=raw,if=virtio \
-cdrom alpine-virt-3.20.0-aarch64.iso \
-nographic
pkg install qemu-system-arm
qemu-img create -f raw alpine-arch64.img 2G
wget https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/aarch64/alpine-virt-3.20.0-aarch64.iso
qemu-system-arm \
-machine virt \
-m 1024 \
-smp cpus=2 \
-drive if=pflash,format=raw,read-only=on,file=$PREFIX/share/qemu/edk2-aarch64-code.fd \
-netdev user,id=n1,dns=8.8.8.8,hostfwd=tcp::2222-:22 \
-device virtio-net,netdev=n1 \
-drive file=alpine-arch64.img,format=raw,if=virtio \
-cdrom alpine-virt-3.20.0-aarch64.iso \
-nographic
But it just does nothing I waited for it 30mins no output on the terminal it just hangs there.
9 replies