Installing Forest OS on a Virtual Machine
Step-by-step install on QEMU, VirtualBox, and VMware — from image download through forinstall to first boot from disk.
Install guides: VM · Install on Real Hardware · USB Persistence
Contents
- Prerequisites
- Step 1 — Get an Image
- Step 2 — Verify the Image
- Step 3 — Create a Target Disk
- Step 4 — QEMU: BIOS Boot
- Step 5 — QEMU: UEFI Boot (OVMF)
- Step 6 — VirtualBox Setup
- Step 7 — VMware Setup
- Step 8 — Boot Menu Entries
- Step 9 — Install with forinstall
- Step 10 — First Boot from Disk
- Guest Additions: What Works and Limits
- Issues and Fixes
1. Prerequisites
# QEMU (test, install target, rescue)
sudo apt install qemu-system-x86 qemu-utils ovmf xorriso mtools
# Verify KVM (strongly recommended — install without it is ~10x slower)
ls -la /dev/kvm
sudo usermod -aG kvm $USER # re-login after
# Verify OVMF firmware files (paths vary by distro)
ls /usr/share/edk2/x64/OVMF_CODE.4m.fd /usr/share/edk2/x64/OVMF_VARS.4m.fd
# Debian/Ubuntu alt paths:
ls /usr/share/ovmf/OVMF.fd
ls /usr/share/OVMF/OVMF_CODE.fd
| Resource | Minimum | Recommended |
|---|---|---|
RAM (-m) | 256M | 512M–1024M |
| Target disk | 512 MiB | 2 GiB+ (ext2 root + FAT ESP if UEFI) |
| Display | Bochs BGA (-vga std) | Same; Cirrus as fallback |
| CPU | 1 vCPU, qemu64/qemu32 | 2 vCPU + KVM (-enable-kvm -cpu host) |
ARM/AArch64/RISC-V guests boot with -kernel directly (no ForeB) and are serial-only. This guide covers x86/x86_64 VM installs.
2. Step 1 — Get an Image (Download or Build)
Option A — Build from source (canonical)
cd forest/fern
./conf.sh --defconfig && ./conf.sh --generate
make all # kernel + userspace + initrd + ForeB hybrid ISO + raw IMG
ls -lh ../foreboots/build/
# forebo.iso # hybrid BIOS+UEFI ISO <- use this for VM install
# forebo.img # raw BIOS disk image (10 MiB, MBR layout)
# esp.img # FAT16 EFI System Partition (~48 MiB)
Config triple matters: ARCH=32|64, BOOT_MODE=bios|uefi. For a VM install that must boot everywhere, build the hybrid ISO (make iso).
Option B — Download a release ISO
wget https://github.com/Enclica-Forest/Forest/releases/latest/download/forebo.iso
wget https://github.com/Enclica-Forest/Forest/releases/latest/download/forebo.iso.sha256
sha256sum -c forebo.iso.sha256
# expected: forebo.iso: OK
If only a .img is published, it is a raw MBR disk — boot it as a hard disk (-drive), not as a CD (-cdrom).
3. Step 2 — Verify the Image
Do this before creating the VM. A corrupt image produces exactly the symptoms in Issues and Fixes.
ISO=../foreboots/build/forebo.iso
IMG=../foreboots/build/forebo.img
ESP=../foreboots/build/esp.img
# 1. ISO has both El Torito entries (BIOS + UEFI)
xorriso -indev "$ISO" -report_el_torito as_mkisofs
# expect: -b boot/forebo/forebo.img ... -eltorito-alt-boot -e boot/efi/esp.img
# 2. List ISO contents
isoinfo -l -i "$ISO"
# 3. MBR signature on the raw image (bytes 510-511 = 55 AA)
xxd -s 510 -l 2 "$IMG"
# expect: 55aa
# 4. Kernel ELF magic at sector 48 (offset 48*512 = 7F 45 4C 46)
xxd -s $((48*512)) -l 4 "$IMG"
# expect: 7f45 4c46 (".ELF")
# 5. Stage size constraints
make -C ../foreboots check
# stage1: exactly 512 B | stage2/3: <= 8192 B each
# 6. ESP sanity (UEFI path only)
mdir -i "$ESP" ::/EFI/BOOT/
# expect: BOOTX64.EFI
mdir -i "$ESP" ::/forebo/
# expect: kernel.elf forebo.cfg initrd.tar
Rebuild if any check fails: make clean && make all in fern/, then make -C ../foreboots check.
4. Step 3 — Create a Target Disk
# QEMU: 2 GiB raw target (grow later with qemu-img resize)
qemu-img create -f raw forest-disk.raw 2G
qemu-img info forest-disk.raw
# QEMU alt: qcow2 (snapshots, thin-provisioned — slower on Forest's ATA path)
qemu-img create -f qcow2 forest-disk.qcow2 2G
- VirtualBox: VM Settings → Storage → Controller IDE/SATA → Create → VDI, dynamically allocated, 2 GiB+.
- VMware: New VM → Custom → SCSI (LSI Logic) or SATA → new virtual disk, 2 GiB+, single file or split.
Attach both devices before first power-on: ISO on optical + empty disk on HDD-0. Boot order must put optical first for install, disk first afterwards (see First Boot).
5. Step 4 — QEMU: BIOS Boot
qemu-system-x86_64 \
-machine q35 -cpu qemu64 -m 512 \
-enable-kvm \
-drive file=forest-disk.raw,format=raw,index=0,media=disk \
-cdrom ../foreboots/build/forebo.iso \
-boot order=dc,menu=on \
-vga std \
-serial stdio
32-bit variant: use qemu-system-i386 -cpu qemu32 with the same drives.
| Flag | Meaning | Notes |
|---|---|---|
-machine q35 | Modern chipset | Use pc/i440fx only if q35 misbehaves |
-m 512 | Guest RAM | 256 minimum; 1024 for full userspace + X11 |
-enable-kvm | Hardware acceleration | Requires /dev/kvm |
-cdrom | ATAPI optical drive | Holds the installer |
-boot order=dc,menu=on | CD then disk | menu=on allows F12/ESC override |
-vga std | Bochs BGA (best VM support) | Fallbacks: cirrus, vmware |
-serial stdio | COM1 → terminal | Always keep this — kernel log and forinstall errors land here |
# Headless / logging variant:
qemu-system-x86_64 -machine q35 -cpu qemu64 -m 512 -enable-kvm \
-drive file=forest-disk.raw,format=raw,index=0,media=disk \
-cdrom ../foreboots/build/forebo.iso -boot order=dc \
-vga std -serial file:/tmp/forest-install.log -display none
tail -f /tmp/forest-install.log
# make shortcuts (build + launch in one step):
cd forest/fern
make run # current config (serial on stdio, -vga std)
make run-bios # force BIOS path
make QEMU_MEMORY=1024 run
6. Step 5 — QEMU: UEFI Boot (OVMF)
UEFI install boots the same hybrid ISO under OVMF. QEMU needs split CODE + writable VARS pflash drives — never point both at the same read-only file.
# 1. Per-VM writable NVRAM copy (once per VM)
cp /usr/share/edk2/x64/OVMF_VARS.4m.fd ./OVMF_VARS.local.fd
# Debian/Ubuntu alt source: /usr/share/ovmf/OVMF_VARS.fd
# 2. Boot installer ISO in UEFI mode
qemu-system-x86_64 \
-machine q35 -cpu qemu64 -m 512 \
-enable-kvm \
-drive if=pflash,format=raw,readonly=on,file=/usr/share/edk2/x64/OVMF_CODE.4m.fd \
-drive if=pflash,format=raw,file=./OVMF_VARS.local.fd \
-drive file=forest-disk.raw,format=raw,index=0,media=disk \
-cdrom ../foreboots/build/forebo.iso \
-boot order=dc,menu=on \
-device qemu-xhci -device usb-tablet -device usb-kbd \
-vga std \
-serial stdio
| Distro | CODE | VARS |
|---|---|---|
| Fedora / RHEL | /usr/share/edk2/x64/OVMF_CODE.4m.fd | /usr/share/edk2/x64/OVMF_VARS.4m.fd |
Debian/Ubuntu (ovmf) | /usr/share/OVMF/OVMF_CODE.fd | /usr/share/OVMF/OVMF_VARS.fd |
Arch (edk2-ovmf) | /usr/share/edk2/x64/OVMF_CODE.4m.fd | /usr/share/edk2/x64/OVMF_VARS.4m.fd |
cd forest/fern
make run-uefi # ESP-based UEFI boot with OVMF
make BOOT_MODE=uefi QEMU_MEMORY=512 run
7. Step 6 — VirtualBox Setup
- New VM: Type
Other/Unknown, 64-bit. RAM 512 MiB+. 1–2 vCPUs, enable VT-x/AMD-V, PAE/NX. - Storage: Controller IDE (best compatibility) or SATA/AHCI. IDE Primary Master →
forest-disk.vdi(2 GiB+); optical →forebo.iso. Boot order: optical first for install. - Display: VBoxVGA (BGA path — works). Avoid VBoxSVGA (framebuffer fallback, slower). 32 MiB+ video memory, 3D off.
- Network: NAT or Bridged, NIC Intel PRO/1000 (e1000) or AMD PCNet. VirtIO-net only if
ENABLE_VIRTIO_NETis built in. - Audio/Input: ICH AC97; PS/2 keyboard + mouse, or USB tablet for the ForeB pointer.
- Boot: Start → ForeB menu → boot entries → forinstall.
Post-install: remove the ISO (or move HDD-0 above optical in boot order), then boot.
8. Step 7 — VMware Setup
- New VM: Guest OS
Other → Other 64-bit. Firmware: BIOS for MBR installs, UEFI for ESP installs. - Storage: LSI Logic SCSI or SATA/AHCI, new virtual disk 2 GiB+. Attach
forebo.isoto CD/DVD, Connect at power on. - Display: Default SVGA is fine (Fern SVGA-II driver, else framebuffer fallback). No VMware Tools needed.
- Network: e1000 (safest) or VMXNET3 (only if the driver is enabled). NAT or Bridged.
- CPU/RAM: 1–2 vCPUs, 512 MiB+ RAM.
- Boot: Power on → ForeB menu → forinstall → power off → disconnect ISO → boot from disk.
9. Step 8 — Boot Menu Entries
ForeB shows a graphical forest-themed menu (GOP framebuffer, mouse + keyboard). Default timeout=10; any key cancels auto-boot.
| Entry | Type | What it does |
|---|---|---|
| Forest OS (default) | type=forest | Multiboot1 ELF handoff: /forebo/kernel.elf + /forebo/initrd.tar. Pick this for install. |
| Forest OS (Safe / nofb) | type=forest + flags | Minimal graphics — use on black screen |
| Recovery | type=recovery | Disk tools: undelete, cloning, partition rescue |
| ForeB Shell | type=shell | fsprobe, ls, cat forebo.cfg — inspect media pre-install |
| Tools | type=tools | Disk Info, GPT Viewer, Hex Viewer, Memory Map, EFI Variables, System Info |
| Setup | type=setup | Reboot into UEFI setup (UEFI VMs only) |
| Reboot | type=reboot | Cold reset |
Keys: Up/Down move, Enter boots, Esc/Left back, S Theme/Settings, U UEFI variables. See Boot Menu and Configuration.
# Pre-install sanity from the Shell entry (optional but cheap):
fsprobe hd0
ls (cd0)/forebo/
cat (cd0)/forebo/forebo.cfg
10. Step 9 — Install with forinstall
Boot Forest OS from the installer ISO, wait for the shell/login prompt, then run:
forinstall
Six screens in order. Defaults are in [brackets] — Enter accepts.
Language
Pick installer + system locale (en default). Sets /etc/locale, console keymap, TTY font page.
Target disk
0 hd0 2048 MiB QEMU HARDDISK / ATA
1 cd0 <iso size> QEMU DVD-ROM (installer — do NOT pick this)
Select target disk [0]:
- Pick the empty disk from Step 3, never
cd0. Confirm the destructive-write warning (YES). - If the disk is missing: run
ls /dev/hd* /dev/sd*and check storage wiring (IDE vs AHCI vs virtio — enable the matchingENABLE_DRIVER_*driver).
Filesystem — ext2 vs FAT
| Choice | Layout | When to use |
|---|---|---|
| ext2 (default) | MBR partition → mkfs.ext2 root | Default for VM installs; permissions + fsck |
| FAT (FAT16/FAT32) | FAT root (UEFI ESP-compatible) | Only if the disk must be ESP-readable |
fdisk /dev/hd0 # MBR table: 1 primary bootable partition
mkfs -t ext2 /dev/hd0p1 # or: mkfs -t fat32 /dev/hd0p1
mount /dev/hd0p1 /mnt
Keep root ≥ 512 MiB; the base system + initrd wants ~100–200 MiB free after install (df -h).
Users
Root password × 2, then a user account (e.g. forest) + password × 2. Skipping the user leaves a root-only system (add users later via System Tools).
ForeB (bootloader install)
- BIOS target: stage1 (MBR +
55AA), stage2 (LBA 1–16), stage3 (LBA 17–32), kernel at sector 48, initrd 16-sector aligned (~sector 560). - UEFI target: FAT ESP (
/EFI/BOOT/BOOTX64.EFI),kernel.elf+forebo.cfg+initrd.tarin/forebo/, NVRAM boot entry.
Confirm + copy
Final screen summarizes language / disk / fs / users / ForeB target. Confirm to format + mount, copy kernel, initrd, base userspace, /etc skeleton, forebo.cfg, install ForeB, fsck, then INSTALL OK — remove install media and reboot. On failure the log stays on serial — copy the last 20 lines into a bug report.
11. Step 10 — First Boot from Disk
- Detach the installer ISO: QEMU: remove
-cdrom …, switch to-boot order=c,menu=on:
UEFI: keep both pflash drives + writableqemu-system-x86_64 -machine q35 -cpu qemu64 -m 512 -enable-kvm \ -drive file=forest-disk.raw,format=raw,index=0,media=disk \ -boot order=c,menu=on -vga std -serial stdioOVMF_VARS.local.fd(it now holdsBootOrder). VirtualBox/VMware: disconnect ISO / HDD-0 first in boot order. - Power on. ForeB menu should appear from the disk. Default entry boots in ~10 s.
- Log in as the created user (or
root). Expect kernel banners on serial, TUI/GUI on display, shell on both. - Smoke test:
uname -a df -hT # root mounted, space free ls /bin | head ip addr # NIC if ENABLE_NETWORKING + NAT adapter - Snapshot now (QEMU
savevm, VirtualBox/VMware snapshot) before experimenting.
12. Guest Additions: What Works and Limits
| Feature | QEMU/KVM | VirtualBox | VMware |
|---|---|---|---|
| Display | Bochs BGA ✅ | VBoxVGA (BGA) ✅ | SVGA-II ✅ |
| Mouse | USB tablet ✅ / PS/2 ✅ | VMMDev + PS/2 ✅ | PS/2 + USB ✅ |
| Shared folders | ❌ | probe only | ❌ |
| Clipboard / drag-and-drop | ❌ | ❌ | ❌ |
| Dynamic resize | ❌ | ❌ | ❌ |
| Time sync | PIT/HPET/RTC ✅ | VMMDev clock ✅ | ✅ |
| Paravirt I/O | VirtIO if enabled | Use IDE/AHCI | LSI/SATA, not PVSCSI |
Rule of thumb: configure emulated hardware (IDE/AHCI, e1000/PCNet, AC97, PS/2 or USB-tablet). Enable paravirt only after confirming the matching ENABLE_* driver is compiled in (make show-config | grep -i virtio). Resolution is fixed at DISPLAY_DEFAULT_WIDTH×HEIGHT×BPP (default 1024×768×32).
13. Issues and Fixes
| Symptom | Likely cause | Fix |
|---|---|---|
| No boot device / EFI shell / "No bootable medium" | Boot order; ISO not connected; no NVRAM entry | -boot order=dc,menu=on for install, order=c after; optical above HDD for install, HDD first after; keep writable OVMF_VARS.local.fd |
| Black screen after ForeB / kernel handoff | Wrong display adapter or graphics disabled | -vga std; VirtualBox: VBoxVGA; check ENABLE_GRAPHICS/ENABLE_FRAMEBUFFER; try Safe/nofb entry; if serial shows login, it is display-only |
| Kernel panic during install / boot | Bad image, heap exhaustion, host-built initrd | Capture serial log; verify per Step 2; -m 1024; rebuild initrd with cross-compiler; enable ENABLE_PANIC_BACKTRACES + BUILD_TYPE=debug |
| Disk full during copy | Target too small | Min 512 MiB, 2 GiB recommended; qemu-img resize forest-disk.raw +2G then re-partition; trim payload per Initrd Builder |
| UEFI loses BootOrder ("vars" issue) | Read-only or shared OVMF_VARS | Copy VARS to a writable per-VM file; readonly=on only on CODE; install ovmf/edk2-ovmf if paths missing |
Still stuck? See Troubleshooting, Testing with QEMU, and Boot Menu.
See Also
- Boot Flow — power-on to login
- Boot Menu — keys, themes, submenus
- Bootloader Configuration —
forebo.cfgreference - ISO Creation — hybrid ISO / IMG / ESP internals
- Testing with QEMU —
make run, serial, GDB - Troubleshooting — full issue catalog
- Disk Tools —
fdisk,mkfs,mount,fsck - Install on Real Hardware — bare-metal USB install
- USB Persistence — live vs persistent vs full USB install