How to use QEMU
h
CodeLongAndPros (1539)

How to emulate a x64, i386, or aarch64 computer

This is not a repl.it 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.

Installation

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:

qemu
└── 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:

.qemu
└── 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
lilpeen (215)

@CodeLongAndPros I am sorry, but I don't know why it was botted, I didn't do it myself and didn't ask anyone else to. I am sure that everyone I know that also knows about the post has not done it. I did receive a weird comment from @TommyVictory containing a multiple screen shots of what appeared to be a lists of users that upvoted the post:
https://storage.googleapis.com/replit/images/1608345422961_e64910e6315f1921d4af62a010480566.png
https://storage.googleapis.com/replit/images/1608345456268_7b24c4080815c7c574e961accb2fdcd8.png
and "There's more if you want" to which I responded with "more what?" I did not have anything to do with this. It would be entirely fair if repl removed the botted upvotes, but closing the post entirely because of something I had no control over does not seem fair at all.

Second, if you look at the source code for classic.minecraft.net, most of it is in one file and compressed if I remember correctly, making it hard for someone like me to modify the game. If I am unable to modify it, I would not be able to make my own version and make it look different from the original, but if you visit each webpage they are clearly different. I do understand that there may be a lack of evidence proving that I wrote the code, but what people need to realize is this: lack of evidence to prove innocent, is not evidence to prove guilty.