How to use QEMU
CodeLongAndPros (1538)

How to emulate a x64, i386, or aarch64 computer

This is not a based tutorial, but it's related to some other topics like How a CPU works and How to make an operating system. QEMU will run on repl, but there's little CPU or RAM for it. I would use TC Linux if you have to have a go at it.

You'll first have to have QEMU installed.


I use Arch, so that's the only one that's correct.
If any of you replitors have a Ubuntu, Debain. Fedora, RHEL, CentOS, Gentoo, or SuSE system, tell me if it failed.

Arch Linux: sudo pacman -S qemu qemu-arch-extra
Debian/Ubuntu based: sudo apt install qemu qemu-kvm
Fedora dnf install @virtualization
Gentoo: emerge --ask app-emulation/qemu
SUSE: zypper install qemu
RHEL/CentOS: yum install qemu-kvm

For Mac users:

Homebrew: brew install qemu

Ports: sudo port install qemu

For Wandows users (Bleech):

Download and run this
No checksum for you!

Ok. now that you've got QEMU, let's fly!

Emulating a 64 bit system

Download the Manjaro XFCE iso, SHA1 checksum c44a2984aa2fada53c1db8c6b919b45152780489.

Create this directory structure:

└── manjaro

cd to qemu/manjaro

Let's make a 20Gb disk for manjaro:
qemu-img create -f qcow2 manjaro.img 20G

To break down the command:

qemu-img is the command, create is the verb, -f means format, qcow2 is the format, manjaro.img is the name of the file, and 20G is the size

Your qemu directory should look like this:

└── manjaro
    └── manjaro.img

Now, move the manjaro ISO to qemu/manjaro and rename it to manjaro.iso

Now let's run qemu-system-x64_64 -m 2048 -net nic -net user -enable-kvm -hda manjaro.img -cdrom manjaro.iso -boot cda

To break it down:

  • m: Memory 2048M = 2G
  • net nic -net user: Enable networking
  • enable-kvm: Enable kvm
  • hda: set hard disk to manjaro.img
  • cdrom: set cd to manjaro.iso
  • boot: cda: set boot to:
    - Hard disk
    - CDROM
    - Floppy
    Now, let's run it.

You should see the grub screen:

After it loads, select 'Launch installer' and follow it through:


There you go, you've got Manjaro Linux running on a x64 emulator!

You can swap qemu-system-x86_64 with qemu-system-{arch} for other archs.
For example:

  • qemu-system-i386
  • qemu-system-aarch64
  • qemu-system-sparc

To run an app compiled for aarch64, use qemu-aarch64 {program} to run it.

That's all, for now!

This post has been locked
You are viewing a single comment. View All
Highwayman (1436)

Why are there two as in aarch64?

Highwayman (1436)

Oh ok, thanks that makes sense now :P @CodeLongAndPros

CodeLongAndPros (1538)

@Highwayman They use them in chromebooks.

Highwayman (1436)

They’re using RISC on a computer?? Bruh. I know chrome books were bad but literally why. @CodeLongAndPros

Highwayman (1436)

Hm I have a feeling I just said something misguided... @Highwayman

CodeLongAndPros (1538)

@Highwayman Yeah that was a pain. I know that some have intel though.

Highwayman (1436)

Hm wait imagine they were like selling the chrome book and they were like “you can have a computer! shows one with intel chip or you can have even a phone! shows one with arm chip"
Oo look just one more upvote to 1024, imma upvote you

CodeLongAndPros (1538)

@Highwayman No, I bought a crappy chrome book for $400 that the touchscreen failed on and it was aarch64 /shudder

CodeLongAndPros (1538)

@Highwayman Just 15 more Gigs to go until I have as much cycles as I have Mb of ram! Yay!

Highwayman (1436)

Oof. They couldn’t even get it right XD @CodeLongAndPros

Highwayman (1436)

*me trying to do the math with my summer brain*

uhh... 2... times.... uhh.... no 2.... to the power.... uhh.... f.


Highwayman (1436)

Oof I wasn’t even close to that calculation, I think Im gonna cry in a corner XD @CodeLongAndPros

CodeLongAndPros (1538)

@Highwayman Don’t worry, I had to 50 math problems after my brain rotting this summer.

Highwayman (1436)

Huh I’ve never thought about it that way. I am always just like “I’m dumb -> school begins -> magic school stuff -> I no longer suck at thinking" @CodeLongAndPros