Skip to content
MariusDoe edited this page May 18, 2022 · 60 revisions

Installation of QEMU

Ubuntu

apt install qemu qemu-system

Arch Linux

pacman -S qemu-full

Setting up a virtual machine

  • Create the virtual disk image

    qemu-img create -f qcow2 void.img 10G
  • Download the image from https://voidlinux.org/download/ (base live glibc)

  • Run the VM

    qemu-system-x86_64 -m 1024 -hda void.img -cdrom void-live-x86_64-20210930.iso -boot d
    • Depending on output, you might need to use a VNC viewer
  • Default credentials are username: root, password: voidlinux

  • Run the Void Linux installer (on the default US keymap, the - is the key to the right of the 0)

    void-installer
  • Configuration

    • Keyboard: de-latin1
    • RootPassword: root
    • Partition (using cfdisk): dos (MBR), 7.5G primary Linux, 2.5G Free space
    • BootLoader: /dev/sda
    • Filesystems: 7.5G ext4, /
  • Install (ignore sed error)

  • Reboot

  • Pick "Boot first HD found by BIOS"

Booting without live ISO

  • You can shutdown using

    poweroff
  • Run the VM without the live ISO

    qemu-system-x86_64 -m 1024 -hda void.img

Installing necessary components

  • Update the system

    xbps-install -Su
  • Install git

    xbps-install -S git

Compiling the kernel

  • Install the necessary dependencies

    • Arch Linux
      pacman -S lld
    • Ubuntu
      apt install clang flex bison lld
  • Follow the quickstart

  • Configure the kernel

    make LLVM=1 menuconfig
    • / RUST -> ensure "Depends on:" is met
  • Build the kernel

    make LLVM=1

Running the VM with the new kernel

qemu-system-x86_64 -m 1024 -hda void.img -append "root=/dev/sda1" -kernel ../Rust-for-Linux/arch/x86/boot/bzImage
Clone this wiki locally