Thursday, June 6, 2019

How to Run Redox OS for Fun

How to run Redox OS, an OS written in Rust, on QEMU
Redox OS is an entirely new breed of an Operating System built with Rust programming language. It is still small, has only the basic programs but fun to run none the less.


Alternate OSs are important to ensure user freedom, since backdoors are being built into many commonly used systems. There are also vulnerabilities to make moving into a new OS a real option to consider. Also, Rust is known for having exceptional memory handling capabilities which should keep the memory related vulnerabilities to an absolute minimum.

It is not yet matured to a full OS, but definitely worth checking out.

I first heard about it on this video and since then an avid follower of the project:
https://www.youtube.com/watch?v=eH5JgMlNE8o


Due to concerns with VirtualBox not being Free Software anymore, I will give instructions for QEMU (kvm) in this article.


Step 1: Prep

Install QEMU+KVM if not already installed:
sudo pacman -S qemu libvirt

Download the .bin file from: https://gitlab.redox-os.org/redox-os/redox/tags
e.g. mine was redox_0.5.0_harddrive.bin.gz

Extract the .bin file from the archive file and keep in a folder. e.g. ~/Downloads/redox
The bin file should be named harddrive.bin.


Step 2: Running Redox OS

Open the terminal and cd to the directory you have extracted the .bin file on:
cd ~/Downloads/redox

Then run the command below:

qemu-system-x86_64 -serial mon:stdio -d cpu_reset -d guest_errors -smp 4 -m 1024 -s -machine q35 -device ich9-intel-hda -device hda-duplex -net nic,model=e1000 -net user -device nec-usb-xhci,id=xhci -device usb-tablet,bus=xhci.0 -enable-kvm -cpu host -drive file=harddrive.bin,format=raw


Another easy way is to create a new file named run.sh (or whatever), then putting the command in the file:

#!/bin/bash
qemu-system-x86_64 -serial mon:stdio -d cpu_reset -d guest_errors -smp 4 -m 1024 -s -machine q35 -device ich9-intel-hda -device hda-duplex -net nic,model=e1000 -net user -device nec-usb-xhci,id=xhci -device usb-tablet,bus=xhci.0 -enable-kvm -cpu host -drive file=harddrive.bin,format=raw


Then making it executable:
- either right click - Properties - Permissions then check the checkbox to make it run / execute
- or, run: chmod +x run.sh on command line

Now everytime you want to run Redox OS, just double click the file. If your file manager is not setup to run executable files with double click, find out instructions online on how to enable it. You can also cd to the directory and run ./run.sh

The default username is user and the password is a blank password.

Redox OS running on QEMU
Redox OS running on QEMU

No comments:

Post a Comment