Skip to content

QEMU Ubuntu MacOS Application on Apple Silicon M1 (aarch64)

Notifications You must be signed in to change notification settings

jeonghanlee/qemu_ubuntu_app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ubuntu 20.04 ARM64, QEMU on Apple Silicon Mac

QEMU / Ubuntu ARM64 Setup for Apple M1

The original reference is at https://gist.github.com/niw/e4313b9c14e968764a52375da41b4278#enable-the-internet. Please check it for further descriptions. The following procedure is tuned for me.

$ sudo port install ninja pkgconfig glib2 pixman wget

$ pwd
/Users/JeongLee/github/qemu_ubuntu_app

$ git clone https://git.qemu.org/git/qemu.git qemu-src

$ cd qemu-src
$ git checkout d0dddab40e -b wip/hvf
$ curl 'https://patchwork.kernel.org/series/418581/mbox/'|git am --3way

$ mkdir build
$ cd build
$ ../configure --target-list=aarch64-softmmu --enable-cocoa
$ make -j

$ ./qemu-img create -f qcow2 ../../drive/ubuntu.qcow2 40G 

$ cd ../../drive
$ wget -c https://gist.github.com/niw/4f1f9bb572f40d406866f23b3127919b/raw/f546faea68f4149c06cca88fa67ace07a3758268/QEMU_EFI-cb438b9-edk2-stable202011-with-extra-resolutions.tar.gz
$ tar xzvf QEMU_EFI-*.tar.gz
$ dd if=/dev/zero of=pflash0.img bs=1M count=64
$ dd if=/dev/zero of=pflash1.img bs=1M count=64
$ dd if=QEMU_EFI.fd of=pflash0.img conv=notrunc
$ dd if=QEMU_VARS.fd of=pflash1.img conv=notrunc
$ wget -c https://cdimage.ubuntu.com/releases/20.04/release/ubuntu-20.04.2-live-server-arm64.iso
$ cd ..
$ sh install_ubuntu.sh
1png
Figure 1 Ubuntu Boot Screenshot

Setup the compiled QEMU into the local folder for the next step

$ mkdir qemu
$ cp -r qemu-src/build/* qemu/
$ sh Contents/MacOS/main.command

Build Apple Aplications, and deploy into /Applications.

$ pwd
/Users/JeongLee/github/qemu_ubuntu_app

$ rm -f drive/*.gz
$ rm -f drive/*.fd
$ rm -f drive/*.iso
$ sudo mkdir /Applications/QEMU_Ubuntu.app
$ sudo ditto Contents/ /Applications/QEMU_Ubuntu.app/Contents
$ sudo ditto qemu /Applications/QEMU_Ubuntu.app/qemu
$ sudo ditto drive/ /Applications/QEMU_Ubuntu.app/drive
2png
Figure 2 Running Ubuntu through QEMU on Apple M1 screenshot

Enjoy!

About

QEMU Ubuntu MacOS Application on Apple Silicon M1 (aarch64)

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published