Index of /M1-Apple/Kali-M1-Qemu/

NameLast ModifiedSizeType
../ -  Directory
MANJARO-OLD/2021-Jan-08 22:03:33-  Directory
QEMU_EFI.fd2021-Jan-07 23:15:112.0Mapplication/octet-stream
README.txt2021-Jan-11 19:35:182.8Ktext/plain; charset=utf-8
efi-virtio.rom2021-Jan-07 23:15:23157.0Kapplication/octet-stream
initrd.img2021-Jan-08 22:03:0855.1Mapplication/octet-stream
qemu-system-aarch642021-Jan-07 23:15:5217.9Mapplication/octet-stream
run.sh2021-Jan-11 21:21:050.4Ktext/x-sh; charset=utf-8
varstorage.img2021-Jan-11 21:20:0564.0Mapplication/octet-stream
vgabios-ramfb.bin2021-Jan-07 23:16:2528.0Kapplication/octet-stream
vmlinuz2021-Jan-08 22:02:5221.6Mapplication/octet-stream
---------------------------------------------------------------------------------------
 _   __      _ _   _     _                                         _      ____    ___ 
| | / /     | (_) | |   (_)                                       | |    / ___|  /   |
| |/ /  __ _| |_  | |    _ _ __  _   ___  __   __ _  __ _ _ __ ___| |__ / /___  / /| |
|    \ / _` | | | | |   | | '_ \| | | \ \/ /  / _` |/ _` | '__/ __| '_ \| ___ \/ /_| |
| |\  \ (_| | | | | |___| | | | | |_| |>  <  | (_| | (_| | | | (__| | | | \_/ |\___  |
\_| \_/\__,_|_|_| \_____/_|_| |_|\__,_/_/\_\  \__,_|\__,_|_|  \___|_| |_\_____/    |_/
                                                                                      
--------------------------------------------------------------------------------------

Quick and dirty way how to run this on the patched qemu (Alexander Graf)  

For building qemu from source please refer to the following article 
https://forums.macrumors.com/threads/success-virtualize-windows-10-for-arm-on-m1-with-alexander-grafs-qemu-hypervisor-patch.2272354/ 


What we will need 
------------------

- Compiled and patched qemu-system-aarch64 
- QEMU_EFI.fd 
- efi-virtio.rom 
- vgabios-ramfb.bin 
- varstorage.img     (not really needed but can be used for storing settings from UEFI) 
- initrd.img   (Kali initrd from current kernel as of 01.07.2021)  
- vmlinuz      (Kali kernel from current release as of 01.07.2021)  
- disk.img   (this is an extracted Kali Linux aarch64 Pinebookpro image ) 

Get Kali from here (can be other aarch64 images I guess - I have used this one )  

 https://images.kali.org/arm-images/kali-linux-2020.4-pinebook-pro.img.xz 

Extract and rename 

$ unxz kali-linux-2020.4-pinebook-pro.img.xz
$ mv kali-linux-2020.4-pinebook-pro.img disk.img 

We can expand the image via qemu-img to expand it later with gparted or something (but Im not sure how to do this on a Mac) 

$ qemu-img resize disk.img 20G   

The final image is roughly 11 GB big and you will have around 1 GB disk space free once you boot Kali which 
should be sufficient for standard tests (unless you plan to move gigs of data ... consider adding a second qemu disk or expand the image) 


Here is the launcher script 
---------------------------

./qemu-system-aarch64 \
-M virt \
-m 4G \
-accel hvf \
-smp 2 \
-cpu max \
-device ramfb \
-device qemu-xhci \
-device usb-kbd \
-device usb-mouse \
-device usb-tablet \
-device virtio-blk,drive=drive \
-drive if=none,id=drive,format=raw,file=disk.img \
-drive file=varstorage.img,if=pflash,index=1 \
-net nic,model=virtio \
-net user,hostfwd=tcp::2222-:22 \
-kernel vmlinuz -append root=/dev/vda1  -initrd initrd.img \
-bios QEMU_EFI.fd


You can then boot it (save the above as a shell script and place in the Kali working directory with other files) 

- Enjoy 

If you have question ping me @   twitter/astr0baby 

Video demo and some tips https://www.youtube.com/watch?v=XDZoqdeZo_0 



Webserver 1.0