Difference between revisions of "QEMU: emulasi android"

From OnnoWiki
Jump to navigation Jump to search
Line 3: Line 3:
 
Now you'll need to create pflash volumes for UEFI. Two volumes are required, one static one for the UEFI firmware, and another dynamic one to store variables. Both need to be exactly 64M in size.
 
Now you'll need to create pflash volumes for UEFI. Two volumes are required, one static one for the UEFI firmware, and another dynamic one to store variables. Both need to be exactly 64M in size.
  
  $ dd if=/dev/zero of=flash0.img bs=1M count=64
+
  dd if=/dev/zero of=flash0.img bs=1M count=64
  $ dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
+
  dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
  $ dd if=/dev/zero of=flash1.img bs=1M count=64
+
  dd if=/dev/zero of=flash1.img bs=1M count=64
  
 
For emulated VMs (e.g. x86 host)
 
For emulated VMs (e.g. x86 host)
  $ sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=vivid-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=$randmac
+
 
 +
sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=vivid-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=$randmac
 +
 
 +
 
 +
Format RAW untuk flash0.img & flash1.img
 +
 
 +
sudo qemu-system-arm -m 1024 -cpu cortex-a57 -M virt -nographic -drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0,mac=$randmac -netdev type=tap,id=net0
 +
 
 +
Parameter -cpu max, kalau cortx-a57 tidak ada
 +
 
 +
sudo qemu-system-arm -m 1024 -cpu max -M virt -nographic -drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0,mac=$randmac -netdev type=tap,id=net0
 +
 
 +
 
  
  

Revision as of 09:11, 15 September 2020


Now you'll need to create pflash volumes for UEFI. Two volumes are required, one static one for the UEFI firmware, and another dynamic one to store variables. Both need to be exactly 64M in size.

dd if=/dev/zero of=flash0.img bs=1M count=64
dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
dd if=/dev/zero of=flash1.img bs=1M count=64

For emulated VMs (e.g. x86 host)

sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=vivid-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0,mac=$randmac


Format RAW untuk flash0.img & flash1.img

sudo qemu-system-arm -m 1024 -cpu cortex-a57 -M virt -nographic -drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0,mac=$randmac -netdev type=tap,id=net0

Parameter -cpu max, kalau cortx-a57 tidak ada

sudo qemu-system-arm -m 1024 -cpu max -M virt -nographic -drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash -drive if=none,file=xenial-server-cloudimg-arm64-uefi1.img,id=hd0 -device virtio-blk-device,drive=hd0 -device virtio-net-device,netdev=net0,mac=$randmac -netdev type=tap,id=net0



Pranala Menarik