Skip to content

catap/obsd.sh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenBSD VMs

It needs following firmwares:

    pkg_add u-boot-aarch64 u-boot-arm opensbi u-boot-riscv64

Run a VM:

    ./obsd.sh [-n] <arch> [qemu args ...]

Boot miniroot with attached VM disk:

    ./obsd.sh [-n] -m (-s|-R version) <arch> [installurl] [qemu args ...]

Autoinstall or autoupgrade over TFTP:

    ./obsd.sh [-n] -i (-s|-R version) <arch> [installurl] [qemu args ...]
    ./obsd.sh [-n] -u (-s|-R version) <arch> [installurl] [qemu args ...]

Shrink a qcow2 image:

    ./obsd.sh [-n] -z <arch> [qemu-img convert args ...]

Use -c after <arch> to create a compressed qcow2. Zero free space inside
the guest first if you want the conversion to reclaim by Boot the guest
as /bsd -s, then run:

    fsck -p && mount -uw / && mount -a -t ffs && mount -t ffs | while read dev on mp rest; do dd if=/dev/zero of=$mp/.zero bs=1m; rm -f $mp/.zero; done; sync; halt

With -n, the script prints the command instead of running it.

DISK_SIZE and SSH_PORT override the default VM disk size (100G) and host
SSH forwarding port (22022).

If autoinstall asks for the response file location, enter:

    http://10.0.2.2/install.conf

The dummy HTTP server is used only by autoinstall and autoupgrade; it
serves install.conf and disklabel from the current directory.

Some arches may not support TFTP install like sparc64, in that case -m
starts dummy HTTP server as well.

On armv7, the target disk has an MSDOS boot partition visible as i: in
the disklabel. Autopartitioning has room for at most 14 OpenBSD
partitions there.

Not supported:

    alpha
    hppa
    landisk
    m88k (luna88k)
    mips64 (octeon)
    mips64el (loongson)
    powerpc (macppc)
    powerpc64

alpha is blocked by QEMU's alpha firmware path. The clipper PALcode is
not a real SRM console: direct bsd.rd loading uses QEMU's kernel entry
ABI, while OpenBSD/alpha expects the alpha boot loader to pass bootinfo,
PTBR, and working PROM state. The OpenBSD boot loader is not enough
there either, because QEMU PALcode does not implement the SRM disk I/O
callbacks it uses.

hppa is blocked by qemu-system-hppa behaviour before the installer can
run. C3700 and A400 boot cd79.iso far enough to load bsd.rd, then stop
after SPID setup. B160L gets farther and prints the OpenBSD copyright,
then hangs before cpu_startup() output. lif79.img reaches BOOT and can
open dk0a:/bsd, but loading the ramdisk dies with heap full and an
allocation size of 0x20202020, which is spaces interpreted as a number,
not guest RAM exhaustion.

landisk is blocked by QEMU machine support. QEMU provides r2d-plus, not
the IO-DATA LANDISK platform OpenBSD/landisk expects. Booting
miniroot79.img as the only disk consumes CPU but prints nothing on the
serial console; explicit first and second serial wiring does not change
that.

m88k means OpenBSD/luna88k. QEMU does not provide an m88k system
emulator.

mips64 means OpenBSD/octeon. QEMU has an Octeon CPU model, but no Octeon
machine, so the required platform firmware and devices are missing.

mips64el means OpenBSD/loongson. QEMU has a Fuloong 2E machine, but it
does not boot through the serial console. loongson3-virt reaches UEFI
with Loongson Community's non-free bios_loongson3.bin, sees
miniroot79.img and cd79.iso, but both media contain bsd.rd without an
EFI loader, so firmware boot stops at the UEFI shell.

powerpc means OpenBSD/macppc. It reaches the OpenBSD ramdisk under
qemu-system-ppc, but hangs after mounting rd0 and printing the clock
warning.

powerpc64 is blocked by qemu-system-ppc64 limits. The PowerNV path can
reach OpenBSD's early Hello, World! message, then hangs; that points at
missing or incomplete platform emulation rather than an OpenBSD install
procedure issue. See:

    https://lists.gnu.org/archive/html/qemu-ppc/2021-08/msg00435.html

About

OpenBSD VMs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages