openbsd-sparc64-vm.md - www.codemadness.org - www.codemadness.org saait content files
(HTM) git clone git://git.codemadness.org/www.codemadness.org
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
openbsd-sparc64-vm.md (2483B)
---
1 This describes how to setup an OpenBSD SPARC64 VM in QEMU.
2
3
4 ## Create a disk image
5
6 To create a 5GB disk image:
7
8 qemu-img create -f qcow2 fs.qcow2 5G
9
10
11 ## Install
12
13 In this guide we'll use the installation ISO to install OpenBSD. Make sure to
14 download the latest (stable) OpenBSD ISO, for example install62.iso.
15
16 * Change -boot c to -boot d to boot from the CD-ROM and do a clean install.
17 * Change -cdrom install62.iso to the location of your ISO file.
18 * When the install is done type: halt -p
19 * Change -boot d back to -boot c.
20
21 Start the VM:
22
23 #!/bin/sh
24 LC_ALL=C QEMU_AUDIO_DRV=none \
25 qemu-system-sparc64 \
26 -machine sun4u,usb=off \
27 -realtime mlock=off \
28 -smp 1,sockets=1,cores=1,threads=1 \
29 -rtc base=utc \
30 -m 1024 \
31 -boot c \
32 -drive file=fs.qcow2,if=none,id=drive-ide0-0-1,format=qcow2,cache=none \
33 -cdrom install62.iso \
34 -device ide-hd,bus=ide.0,unit=0,drive=drive-ide0-0-1,id=ide0-0-1 \
35 -msg timestamp=on \
36 -serial pty -nographic \
37 -net nic,model=ne2k_pci -net user
38
39 The VM has the following properties:
40
41 * No audio.
42 * No USB.
43 * No VGA graphics: serial console.
44 * Netdev is ne0 (Realtek 8029).
45 * 1024MB memory.
46
47 From your host connect to the serial device indicated by QEMU, for example:
48
49 (qemu) 2017-11-19T15:14:20.884312Z qemu-system-sparc64: -serial pty: char device redirected to /dev/ttyp0 (label serial0)
50
51 Then you can use the serial terminal emulator **cu** to attach:
52
53 cu -l /dev/ttyp0
54
55 Another option could be using the [simple terminal(st)](https://git.suckless.org/st/) from suckless.
56
57 st -l /dev/ttyp0
58
59 using cu to detach the [cu(1) man page](https://man.openbsd.org/cu#~^D) says:
60
61 Typed characters are normally transmitted directly to the remote machine (which
62 does the echoing as well). A tilde ('~') appearing as the first character of a
63 line is an escape signal; the following are recognized:
64
65 ~^D or ~. Drop the connection and exit. Only the connection is
66 the login session is not terminated.
67
68 On boot you have to type:
69
70 root device: wd0a
71 for swap use the default (wd0b) Press enter
72
73
74 ## Initial settings on first boot (optional)
75
76 Automatic network configuration using DHCP
77
78 echo "dhcp" > /etc/hostname.ne0
79
80 To bring up the interface (will be automatic on the next boot):
81
82 sh /etc/netstart
83
84 Add a mirror to /etc/installurl for package installation. Make sure to lookup
85 the most efficient/nearby mirror site on the OpenBSD mirror page.
86
87 echo "https://ftp.hostserver.de/pub/OpenBSD" > /etc/installurl