Install 9front in OpenBSD VMM
- jrmu (jrmu@cloud9p.org)
ABSTRACT
- This guide explains how to install 9front as a virtual machine inside OpenBSD's VMM
Download the ISO
This installation assumes you (or your admin) has configured VMM properly. Inside your home folder, download the 9front ISO:
ftp https://9front.org/iso/9front-10522.amd64.iso.gz sha256 9front-10522.amd64.iso.gz SHA256 (9front-10522.amd64.iso.gz) = 89f1e35bf735bfc9aeca38286a9a6607f3a40292befa4a30133157790f2edbcc 89f1e35bf735bfc9aeca38286a9a6607f3a40292befa4a30133157790f2edbcc 9front-10522.amd64.iso.gz gunzip 9front-10522.amd64.iso.gz ln -sf 9front-10522.amd64.iso USER.iso
Inside /etc/vm.conf, make sure your virtual machine's cdrom is set to USER.iso:
vm "USER" { owner USER memory 2048M cdrom "/home/USER/USER.iso" disk /home/USER/USER.qcow2 interface { locked lladdr aa:bb:cc:dd:ee:ff switch "switch0" } }
vmctl stop USER
rm USER.qcow2 vmctl create -s 20G USER.qcow2 vmctl start -c USER Connected to /dev/ttyp9 (speed 115200) Boot failed: not a bootable disk *e820=1 0x0000000000000000 0x000000000009f800 2 0x000000000009f800 0x00000000000a0000 2 0x00000000000f0000 0x0000000000100000 1 0x0000000000100000 0x000000007fffa000 2 0x000000007fffa000 0x0000000080000000 2 0x00000000f0000000 0x0000000100000000 cdboot=yes mouseport=ask monitor=ask vgasize=ask bootfile=/amd64/9pc64 At this point, you must immediately interrupt booting to type console=0: >console=0 ccoonnssoollee==00 Then type boot: >>bboooott bboooott Plan 9 125 holes free 0x0001d000 0x0009f000 532480 0x00100000 0x00110000 65536 0x005df000 0x3365f000 856162304 856760320 bytes free cpu0: 4600MHz GenuineIntel Xeon5000-series (AX 000206D7 CX 96982203 DX 079BA97F) ELCR: 02E8 #l0: virtio: 1000Mbps port 0x2000 irq 5 ea f2b2b3daeb89 i8042: kbd init failed 2004M memory: 822M kernel data, 1181M user, 2431M swap bootfs: Sun Apr 28 01:34:12 GMT 2024 fingerprint: eb2b47a2e2650e5348e2efa5bca9df39239a42c6 nusb/usbd: no hubs /dev/sd00: OpenBSD VMM CD-ROM 001 /dev/sd00/data 9660 /dev/sdF0: /dev/sdF0/data bootargs is (tcp, tls, il, local!device)[local!/dev/sd00/data] Select the default by pressing enter. user[glenda]: init: starting /bin/rc cirno Jun 16 06:28:16 starting dns resolver on /net vgasize is (text, 640x480x8, 1024x768x16, ...) [1024x768x16] text bind: #i: no frame buffer rio: can't open display: initdisplay: /dev/draw/new: file does not exist: '/dev/draw' init: rc exit status: rc 216: rio 342: display open init: starting /bin/rc term% inst/start Sun Jun 16 04:29:45 CET 2024 Installation process started -------------------------------------- Preparing menu... The following unfinished tasks are ready to be done: configfs - choose the type of file system to install confignet - configure the network tzsetup - choose time zone Task to do [configfs]: -------------------------------------- You can install the following types of file systems: cwfs64x the cached-worm file server hjfs the new 9front file server (experimental!) File system (cwfs64x, hjfs)[cwfs64x]: hjfs -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install The following unfinished tasks are ready to be done: partdisk - edit partition tables (e.g., to create a plan 9 partition) mountfs - choose and mount file system partition confignet - configure the network tzsetup - choose time zone Task to do [partdisk]: -------------------------------------- The following disk devices were found. sd00 - OpenBSD VMM CD-ROM 001 empty 0 465 (465 cylinders, 1.81 GB) * p1 465 466 (1 cylinders, 4.00 MB) ESP sdF0 - Disk to partition (sd00, sdF0)[no default]: sdF0 The disk you selected HAS NO master boot record on its first sector. (Perhaps it is a completely blank disk.) Shall we create a blank EFI partition table (GPT) or install traditional DOS partition table (MBR)? Install mbr or gpt (mbr, gpt)[no default]: mbr This is disk/fdisk; use it to create a Plan 9 partition. If there is enough room, a Plan 9 partition will be suggested; you can probably just type 'w' and then 'q'. cylinder = 8225280 bytes '* p1 0 2610 (2610 cylinders, 19.99 GB) PLAN9 >>> w >>> q -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) The following unfinished tasks are ready to be done: prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition confignet - configure the network tzsetup - choose time zone Task to do [prepdisk]: -------------------------------------- The following Plan 9 disk partitions were found. /dev/sdF0/plan9 empty 0 41929587 (41929587 sectors, 19.99 GB) Plan 9 partition to subdivide (/dev/sdF0/plan9)[/dev/sdF0/plan9]: This is disk/prep; use it to subdivide the Plan 9 partition. If it is not yet subdivided, a sensible layout will be suggested; you can probably just type 'w' and then 'q'. no plan9 partition table found 9fat 204800 nvram 1 fs 41724786 ' 9fat 0 204800 (204800 sectors, 100.00 MB) ' nvram 204800 204801 (1 sectors, 512 B ) ' fs 204801 41929587 (41724786 sectors, 19.89 GB) >>> w >>> q -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition The following unfinished tasks are ready to be done: mountfs - choose and mount file system partition confignet - configure the network tzsetup - choose time zone Task to do [mountfs]: -------------------------------------- Please choose your hjfs partition --rw-r----- S 0 glenda glenda 21363090432 Apr 28 03:34 /dev/sdF0/fs Hjfs partition (/dev/sdF0/fs)[/dev/sdF0/fs]: Size of RAM filesystem cache (MB)? [296]: Ream the filesystem? (yes, no)[yes]: Starting hjfs file server for /dev/sdF0/fs hjfs: reaming /dev/sdF0/fs hjfs: ream successful hjfs: fs is /dev/sdF0/fs Configuring hjfs file server for /dev/sdF0/fs hjfs: >create /dist sys sys 775 d hjfs: >create /usr sys sys 775 d hjfs: >newuser glenda hjfs: >newuser adm +glenda hjfs: >newuser sys +glenda hjfs: >newuser upas +glenda hjfs: >echo off Mounting hjfs file server for /dev/sdF0/fs % mount -c /srv/hjfs.newfs /n/newfs -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition The following unfinished tasks are ready to be done: confignet - configure the network mountdist - locate and mount the distribution tzsetup - choose time zone Task to do [confignet]: -------------------------------------- We will configure the ethernet. Please choose a method for configuring your ethernet connection. manual - specify IP address, network mask, gateway IP address automatic - use DHCP and SLAAC to automatically configure Configuration method (manual, automatic)[automatic]: manual ip address [no default]: 104.167.242.231 network mask [no default]: 255.255.255.128 gateway address [no default]: 104.167.242.129 dns server [104.167.242.129]: starting ethernet manual config -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition confignet - configure the network The following unfinished tasks are ready to be done: mountdist - locate and mount the distribution tzsetup - choose time zone Task to do [mountdist]: -------------------------------------- Please wait... Scanning storage devices... /dev/sd00/data /dev/sdF0/9fat /dev/sdF0/data /dev/sdF0/fs The following storage media were detected. Choose the one containing the distribution. /dev/sd00/data (iso9660 cdrom) Distribution disk (/dev/sd00/data, /dev/sdF0/fs, /)[/]: % mount /srv/boot /n/distmedia Which directory contains the distribution? Location of archives [/]: -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition confignet - configure the network mountdist - locate and mount the distribution The following unfinished tasks are ready to be done: copydist - copy the distribution into the file system tzsetup - choose time zone Task to do [copydist]: -------------------------------------- processing /sys/lib/sysconfig/proto/allproto file system made -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition confignet - configure the network mountdist - locate and mount the distribution copydist - copy the distribution into the file system The following unfinished tasks are ready to be done: ndbsetup - setup network configuration tzsetup - choose time zone bootsetup - configure hard disk to boot plan 9 Task to do [ndbsetup]: -------------------------------------- Setup network configuration sysname [cirno]: jrmu.host.nastycode.com -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition confignet - configure the network mountdist - locate and mount the distribution copydist - copy the distribution into the file system ndbsetup - setup network configuration The following unfinished tasks are ready to be done: tzsetup - choose time zone bootsetup - configure hard disk to boot plan 9 Task to do [tzsetup]: -------------------------------------- Setup Time Zone Time Zone (Argentina, Asia_Bahrain, Asia_India, Australia_ACT, Australia_Broken-Hill, Australia_LHI, Australia_NSW, Australia_North, Australia_Queensland, Australia_South, Australia_Sturt, Australia_Tasmania, Australia_Victoria, Australia_West, Australia_Yancowinna, Brazil_Acre, Brazil_DeNoronha, Brazil_East, Brazil_West, CET, Canada_Atlantic, Canada_Central, Canada_East-Saskatchewan, Canada_Eastern, Canada_Mountain, Canada_Newfoundland, Canada_Pacific, Canada_Yukon, Chile_Continental, Chile_EasterIsland, Cuba, EET, Egypt, GB-Eire, GMT, HST, Hongkong, Iceland, Iran, Israel, Jamaica, Japan, Libya, Mexico_BajaNorte, Mexico_BajaSur, Mexico_General, NZ, NZ_CHAT, Navajo, PRC, Poland, ROC, ROK, Singapore, Turkey, US_Alaska, US_Arizona, US_Central, US_East-Indiana, US_Eastern, US_Hawaii, US_Michigan, US_Mountain, US_Pacific, US_Yukon, Uruguay, W-SU, WET)[US_Eastern]: -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition confignet - configure the network mountdist - locate and mount the distribution copydist - copy the distribution into the file system ndbsetup - setup network configuration tzsetup - choose time zone The following unfinished tasks are ready to be done: bootsetup - configure hard disk to boot plan 9 Task to do [bootsetup]: -------------------------------------- Setup Plan 9 FAT boot partition (9fat) Plan 9 FAT partition (/dev/sdF0/9fat)[/dev/sdF0/9fat]: dossrv: serving /srv/dos % dd -bs 512 -count 1 -if /dev/sdF0/9fat -of /tmp/pbs.bak 1+0 records in 1+0 records out Initializing Plan 9 FAT partition. % disk/format -r 2 -d -b /386/pbs -l PLAN9 /dev/sdF0/9fat Initializing FAT file system type hard, 12 tracks, 255 heads, 63 sectors/track, 512 bytes/sec used 4096 bytes % mount -c /srv/dos /n/9fat /dev/sdF0/9fat % rm -f /n/9fat/9bootfat % cp /386/9bootfat /n/9fat/9bootfat % chmod +al /n/9fat/9bootfat % rm -f /n/9fat/plan9.ini % cp /tmp/plan9.ini /n/9fat/plan9.ini % rm -f /n/9fat/9pc64 % cp /amd64/9pc64 /n/9fat/9pc64 % mkdir -p /n/9fat/efi/boot % cp /386/bootia32.efi /n/9fat/efi/boot/ % mkdir -p /n/9fat/efi/boot % cp /386/bootx64.efi /n/9fat/efi/boot/ % cp /tmp/pbs.bak /n/9fat % unmount /n/9fat If you use the Windows NT/2000/XP master boot record or a master boot record from a Unix clone (e.g., LILO or FreeBSD bootmgr), it is probably safe to continue using that boot record rather than install the Plan 9 boot record. Install the Plan 9 master boot record (yes, no)[no default]: yes Mark the Plan 9 partition active (yes, no)[no default]: yes The Plan 9 partition is now marked as active. -------------------------------------- Preparing menu... The following tasks are done: configfs - choose the type of file system to install partdisk - edit partition tables (e.g., to create a plan 9 partition) prepdisk - subdivide plan 9 disk partition mountfs - choose and mount file system partition confignet - configure the network mountdist - locate and mount the distribution copydist - copy the distribution into the file system ndbsetup - setup network configuration tzsetup - choose time zone bootsetup - configure hard disk to boot plan 9 The following unfinished tasks are ready to be done: finish - finish the installation and reboot Task to do [finish]: -------------------------------------- Congratulations; you've completed the install. halting...hjfs: ending/srv/hjfs.newfs.cmd... done halting echo: write error: device or object already in use rebooting... cpu0: exiting Takes a licking and keeps on ticking... can't reset
doas vmctl stop USER doas vmctl start -c USER host# vmctl start -c jrmu Connected to /dev/ttyp6 (speed 115200) MBR...pbs.................ok *e820=1 0x0000000000000000 0x000000000009f800 2 0x000000000009f800 0x00000000000a0000 2 0x00000000000f0000 0x0000000000100000 1 0x0000000000100000 0x000000007fffa000 2 0x000000007fffa000 0x0000000080000000 2 0x00000000f0000000 0x0000000100000000 bootfile=9pc64 bootargs=local!/dev/sdF0/fs -m 296 mouseport=ask monitor=ask vgasize=text ccoonnssoollee==00 bboooott Plan 9 125 holes free 0x0001d000 0x0009f000 532480 0x00100000 0x00110000 65536 0x005df000 0x3365f000 856162304 856760320 bytes free cpu0: 4600MHz GenuineIntel Xeon5000-series (AX 000206D7 CX 96982203 DX 079BA97F) ELCR: 02E8 #l0: virtio: 1000Mbps port 0x2000 irq 5 ea f2b2b3daeb89 i8042: kbd init failed 2004M memory: 822M kernel data, 1181M user, 2431M swap bootfs: Sun Apr 28 01:34:12 GMT 2024 fingerprint: eb2b47a2e2650e5348e2efa5bca9df39239a42c6 nusb/usbd: no hubs /dev/sd00: OpenBSD VMM CD-ROM 001 /dev/sd00/data 9660 /dev/sdF0: /dev/sdF0/9fat dos /dev/sdF0/data /dev/sdF0/fs hjfs /dev/sdF0/nvram /dev/sdF0/plan9 bootargs is (tcp, tls, il, local!device)[local!/dev/sdF0/fs -m 296] user[glenda]: hjfs: fs is /dev/sdF0/fs init: starting /bin/rc bind: #i: no frame buffer rio: can't open display: initdisplay: /dev/draw/new: file does not exist: '/dev/draw' init: rc exit status: rc 261: rio 391: display open init: starting /bin/rc term% auth/wrkey bad nvram des key bad authentication id bad authentication domain authid: glenda authdom: example.com secstore key: password: confirm password: enable legacy p9sk1[no]: term% 9fs 9fat term% cd /n/9fat/ term% cat plan9.ini bootfile=9pc64 bootargs=local!/dev/sdF0/fs -m 296 mouseport=ask monitor=ask vgasize=text console=0 term% echo 'service=cpu' >> /n/9fat/plan9.ini term% echo '@{while() {sleep 5; ip/ping 104.167.242.129}} > /dev/null &' >> /cfg/sysname/cpustart term% fshalt -r halting...hjfs: ending /srv/hjfs.cmd... done halting echo: write error: device or object already in use rebooting... cpu0: exiting Takes a licking and keeps on ticking... can't reset
host# vmctl stop username-plan9 stopping vm username-plan9: requested to shutdown vm 6 host# vmctl start -c username-plan9
# vncs -A /bin/rio -s