Last modification on 2017-12-11
This describes how to setup an OpenBSD SPARC64 VM in QEMU.
To create a 5GB disk image:
qemu-img create -f qcow2 fs.qcow2 5G
- Change -boot c to -boot d to boot from the CD-ROM and do a clean install.
- Change -cdrom install62.iso to the location of your ISO file.
- When the install is done type: halt -p
- Change -boot d back to -boot c.
Start the VM:
#!/bin/sh LC_ALL=C QEMU_AUDIO_DRV=none \ qemu-system-sparc64 \ -machine sun4u,usb=off \ -realtime mlock=off \ -smp 1,sockets=1,cores=1,threads=1 \ -rtc base=utc \ -m 1024 \ -boot c \ -drive file=fs.qcow2,if=none,id=drive-ide0-0-1,format=qcow2,cache=none \ -cdrom install62.iso \ -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-1,id=ide0-0-1 \ -msg timestamp=on \ -serial pty -nographic
The VM has the following properties:
- No audio.
- No USB.
- No VGA graphics: serial console.
- Default netdev is ne0 (Realtek 8029) on qemu-system-sparc64 2.10.1
- 1024MB memory.
From your host connect to the serial device indicated by QEMU, for example:
(qemu) 2017-11-19T15:14:20.884312Z qemu-system-sparc64: -serial pty: char device redirected to /dev/ttyp0 (label serial0)
Then type to attach:
cu -l /dev/ttyp0
to detach the cu(1) man page says:
Typed characters are normally transmitted directly to the remote machine (which does the echoing as well). ) appearing as the first character of a line is an escape signal; the following are recognized: ~^D or ~. Drop the connection and exit. Only the connection is the login session is not terminated.
On boot you have to type:
root device: wd0a for swap use the default (wd0b) Press enter
Automatic network configuration using DHCP
echo "dhcp" > /etc/hostname.ne0
To bring up the interface (will be automatic on the next boot):
Add a mirror to /etc/installurl for package installation. Make sure to lookup the most efficient/nearby mirror site on the OpenBSD mirror page.
echo "https://ftp.hostserver.de/pub/OpenBSD" > /etc/installurl
I hope this helps. Have fun.