How to Run an x86_64 Fedora Server on an ARM Mac Using QEMU
Posted 5 April 2023, last edited 5 April 2023 (archive)Download an OS image
First you need to create an OS image. For this example, we are just going to download a Fedora Server image. Go to https://getfedora.org/en/server/download and download one of the files named "Fedora <VERSION>: QEMU image for x86_64", for example https://download.fedoraproject.org/pub/fedora/linux/releases/37/Server/x86_64/images/Fedora-Server-KVM-37-1.7.x86_64.qcow2
$ curl -L 'https://download.fedoraproject.org/pub/fedora/linux/releases/37/Server/x86_64/images/Fedora-Server-KVM-37-1.7.x86_64.qcow2' \
-o /tmp/x86_64-Fedora-Server.qcow2
Then verify your download https://getfedora.org/en/security/ (you're not going to do this)
Boot the image
$ sudo qemu-system-x86_64 -m 2048 \
-hda /tmp/x86_64-Fedora-Server.qcow2 \
-netdev vmnet-shared,id=net0 \
-device e1000,mac=86:A8:82:70:47:8F,netdev=net0 \
-nographic \
-smp 2
-m 2048
assigns the VM 2048MB of RAM-hda x86_64-Fedora-Server.qcow2
assings the disk-image we downloaded to the VM.-netdev vmnet-shared,id=net0
creates a network backend and names it "net0". QEMU network backends connects to outer networks on behalf of a virtual NIC.-device e1000,mac=86:A8:82:70:47:8F,netdev=net0
creates virtual NIC and connects it to "net0" which we just created with the previous flag.-nographic
disables graphics. The installer runs just fine in the terminal. You can remove this flag if you want, but running a GUI on an emulated architecture will probably be very slow. I prefer to use access the VM using Emacs+TRAMP, but you can use any SSH client. The image runs a SSH server by default.-smp 2
give the vm 2 CPUs. Can be set to whatever you want.