gduale's blog

OpenBSD on a Scaleway VM

In this article, we will see how to install OpenBSD on a Scaleway VM.

First, create an instance (a VM) like usual. You can choose for example:

  • Model: DEV1-S
  • OS: Debian 12
  • Disk size: 10GB

Don’t forget to add your public ssh key to be able to access to the VM via ssh.

Now, your VM is up and running! Cool we can eraze it ;)

Switch off the VM, go to “Advanced settings” and select “Use rescue image” and save.

Now, switch on your VM and wait 1 or 2 minutes. After that, you will be able to ssh to your VM.

The VM is booted with a “Live Ubuntu” OS, usually used to debug serious problems.

We can use it to write on the disk the minimal OpenBSD installer.

When you have a root shell on the VM, you can do this with two commands:

wget https://ftp.openbsd.org/pub/OpenBSD/7.5/amd64/miniroot75.img
dd if=miniroot75.img of=/dev/sda;sync

Switch off the VM, go to “Advanced settings” and select “Use local boot” and save.

Reboot the VM from the Scaleway web interface and start the VM console. You will see the OpenBSD installer prompt “boot>”.

Before the installer boot automatically, write after the “boot>”, this:

set tty com0

Then, hit enter twice.

You should see the OpenBSD installer starting!

Now, you can follow the official documentation to install OpenBSD.

Some importants details are about the disk and the console.

You should configure the disk with the option “G” to use the whole disk in the GPT mode. And answer “yes” for the next question:

An EFI/GPT disk may not boot. Proceed? [no] yes

Illustration:

Screenshot representing the disks operations

For the console, you should select “com0”, when the installer ask for:

Change the default console to com0? [yes]

Also, let’s keep the default speed to 9600:

Which speed should com0 use? (or 'done') [9600]

Then you can continue the installation like usual.

At the end, select “reboot” (the default choice) and hit enter.

Congratulation, you have completed the installation of OpenBSD on a Scaleway VM!

After 2 minutes, will you be able to ssh to the VM from your computer.

The classic neofetch :)

Screenshot of a neofetch command

Additionals notes

If it can help, here is the output of the installer when I setup the VM.

>> OpenBSD/amd64 BOOTX64 3.65
boot> 
cannot open hd0a:/etc/random.seed: No such file or directory
booting hd0a:/bsd: 4076463+1688576+3891240+0+708608 [109+464016+317541]=0xaa40e8
entry point at 0x1001000
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2024 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 7.5 (RAMDISK_CD) #76: Wed Mar 20 15:53:54 MDT 2024
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
real mem = 2112753664 (2014MB)
avail mem = 2044616704 (1949MB)
random: good seed from bootblocks
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0x7f919000 (9 entries)
bios0:
bios0: Scaleway SCW-DEV1-S
acpi0 at bios0: ACPI 1.0
acpi0: tables DSDT FACP APIC HPET WAET
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: AMD EPYC 7281 16-Core Processor, 2096.37 MHz, 17-01-02
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,MMX,FXSR,SSE,SSE2,HTT,SSE3,PCLMUL,SSSE3,FMA3,CX16,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,HV,NXE,MMXX,FFXSR,PAGE1GB,RDTSCP,LONG,LAHF,CMPLEG,SVM,AMCR8,ABM,SSE4A,MASSE,3DNOWP,OSVW,CPCTR,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,RDSEED,ADX,SMAP,CLFLUSHOPT,SHA,IBPB,VIRTSSBD,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu0: 64KB 64b/line 2-way D-cache, 64KB 64b/line 2-way I-cache
cpu0: 512KB 64b/line 16-way L2 cache
cpu0: apic clock running at 999MHz
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 0 pa 0xfec00000, version 11, 24 pins
acpihpet0 at acpi0: 100000000 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
"ACPI0006" at acpi0 not configured
acpipci0 at acpi0 PCI0
com0 at acpi0 COM1 addr 0x3f8/0x8 irq 4: ns16550a, 16 byte fifo
com0: console
acpicmos0 at acpi0
"PNP0A06" at acpi0 not configured
"PNP0A06" at acpi0 not configured
"PNP0A06" at acpi0 not configured
"QEMU0002" at acpi0 not configured
"ACPI0010" at acpi0 not configured
acpicpu at acpi0 not configured
pvbus0 at mainbus0: KVM
pci0 at mainbus0 bus 0
0:2:0: rom address conflict 0xfff80000/0x80000
pchb0 at pci0 dev 0 function 0 "Intel 82441FX" rev 0x02
"Intel 82371SB ISA" rev 0x00 at pci0 dev 1 function 0 not configured
pciide0 at pci0 dev 1 function 1 "Intel 82371SB IDE" rev 0x00: DMA, channel 0 wired to compatibility, channel 1 wired to compatibility
pciide0: channel 0 ignored (disabled)
pciide0: channel 1 ignored (disabled)
"Intel 82371AB Power" rev 0x03 at pci0 dev 1 function 3 not configured
virtio0 at pci0 dev 2 function 0 "Qumranet Virtio Network" rev 0x00
vio0 at virtio0: address de:00:00:4e:d4:ad
virtio0: msix per-VQ
virtio1 at pci0 dev 3 function 0 "Qumranet Virtio SCSI" rev 0x00
vioscsi0 at virtio1: qsize 256
scsibus0 at vioscsi0: 255 targets
sd0 at scsibus0 targ 0 lun 0: <SCW, b_ssd, v42>
sd0: 9536MB, 512 bytes/sector, 19531250 sectors, thin
virtio1: msix per-VQ
virtio2 at pci0 dev 4 function 0 "Qumranet Virtio Console" rev 0x00
virtio2: no matching child driver; not configured
isa0 at mainbus0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0 mux 1
efifb at mainbus0 not configured
softraid0 at root
scsibus1 at softraid0: 256 targets
root on rd0a swap on rd0b dump on rd0b
WARNING: CHECK AND RESET THE DATE!
erase ^?, werase ^W, kill ^U, intr ^C, status ^T

Welcome to the OpenBSD/amd64 7.5 installation program.
(I)nstall, (U)pgrade, (A)utoinstall or (S)hell? i
At any prompt except password prompts you can escape to a shell by
typing '!'. Default answers are shown in []'s and are selected by
pressing RETURN.  You can exit this program at any time by pressing
Control-C, but this can leave your system in an inconsistent state.

Terminal type? [vt220] 
System hostname? (short form, e.g. 'foo') cloud   

Available network interfaces are: vio0 vlan0.
Network interface to configure? (name, lladdr, '?', or 'done') [vio0] 
IPv4 address for vio0? (or 'autoconf' or 'none') [autoconf] 
IPv6 address for vio0? (or 'autoconf' or 'none') [none] 
Available network interfaces are: vio0 vlan0.
Network interface to configure? (name, lladdr, '?', or 'done') [done] 
Using DNS domainname my.domain
Using DNS nameservers at 51.159.69.156 51.159.69.162

Password for root account? (will not echo) 
Password for root account? (again) 
Start sshd(8) by default? [yes] 
Change the default console to com0? [yes] 
Available speeds are: 9600 19200 38400 57600 115200.
Which speed should com0 use? (or 'done') [9600] 
Setup a user? (enter a lower-case loginname, or 'no') [no] poc
Full name for user poc? [poc] 
Password for user poc? (will not echo) 
Password for user poc? (again) 
WARNING: root is targeted by password guessing attacks, pubkeys are safer.
Allow root ssh login? (yes, no, prohibit-password) [no] 
What timezone are you in? ('?' for list) [Europe/Paris] 

Available disks are: sd0.
Which disk is the root disk? ('?' for details) [sd0] 
Encrypt the root disk with a (p)assphrase or (k)eydisk? [no] 
Disk: sd0       geometry: 16383/16/74 [19531250 Sectors]
Offset: 0       Signature: 0xAA55
            Starting         Ending         LBA Info:
 #: id      C   H   S -      C   H   S [       start:        size ]
-------------------------------------------------------------------------------
 0: EF      0   0  65 -      0  13  62 [          64:         960 ] EFI Sys
 1: 00      0   0   0 -      0   0   0 [           0:           0 ] Unused
 2: 00      0   0   0 -      0   0   0 [           0:           0 ] Unused
*3: A6      0  13  63 -      9   9  70 [        1024:       10368 ] OpenBSD
Use (W)hole disk MBR, whole disk (G)PT, (O)penBSD area or (E)dit? [OpenBSD] G
An EFI/GPT disk may not boot. Proceed? [no] yes
Setting OpenBSD GPT partition to whole sd0...done.
The auto-allocated layout for sd0 is:
#                size           offset  fstype [fsize bsize   cpg]
  a:          1142.0M           532544  4.2BSD   2048 16384     1 # /
  b:           256.0M          2871424    swap                    
  c:          9536.7M                0  unused                    
  d:          3072.0M          3395712  4.2BSD   2048 16384     1 # /usr
  e:          2048.0M          9687168  4.2BSD   2048 16384     1 # /home
  i:           260.0M               64   MSDOS                    
Use (A)uto layout, (E)dit auto layout, or create (C)ustom layout? [a] 
/dev/rsd0a: 1142.0MB in 2338880 sectors of 512 bytes
6 cylinder groups of 202.50MB, 12960 blocks, 25920 inodes each
/dev/rsd0e: 2048.0MB in 4194304 sectors of 512 bytes
11 cylinder groups of 202.50MB, 12960 blocks, 25920 inodes each
/dev/rsd0d: 3072.0MB in 6291456 sectors of 512 bytes
16 cylinder groups of 202.50MB, 12960 blocks, 25920 inodes each
/dev/sd0a (db982d3783b55bd8.a) on /mnt type ffs (rw, asynchronous, local)
/dev/sd0e (db982d3783b55bd8.e) on /mnt/home type ffs (rw, asynchronous, local, nodev, nosuid)
/dev/sd0d (db982d3783b55bd8.d) on /mnt/usr type ffs (rw, asynchronous, local, nodev)

Let's install the sets!
Location of sets? (disk http nfs or 'done') [http] 
HTTP proxy URL? (e.g. 'http://proxy:8080', or 'none') [none] 
HTTP Server? (hostname, list#, 'done' or '?') [cdn.openbsd.org] 
Server directory? [pub/OpenBSD/7.5/amd64] 

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-', e.g.: '-game*'. Selected sets are labelled '[X]'.
    [X] bsd           [X] base75.tgz    [X] game75.tgz    [X] xfont75.tgz
    [X] bsd.mp        [X] comp75.tgz    [X] xbase75.tgz   [X] xserv75.tgz
    [X] bsd.rd        [X] man75.tgz     [X] xshare75.tgz
Set name(s)? (or 'abort' or 'done') [done] -x*
    [X] bsd           [X] base75.tgz    [X] game75.tgz    [ ] xfont75.tgz
    [X] bsd.mp        [X] comp75.tgz    [ ] xbase75.tgz   [ ] xserv75.tgz
    [X] bsd.rd        [X] man75.tgz     [ ] xshare75.tgz
Set name(s)? (or 'abort' or 'done') [done] -g*
    [X] bsd           [X] base75.tgz    [ ] game75.tgz    [ ] xfont75.tgz
    [X] bsd.mp        [X] comp75.tgz    [ ] xbase75.tgz   [ ] xserv75.tgz
    [X] bsd.rd        [X] man75.tgz     [ ] xshare75.tgz
Set name(s)? (or 'abort' or 'done') [done] 
Get/Verify SHA256.sig   100% |**************************|  2324       00:00    
Signature Verified
Get/Verify bsd          100% |**************************| 25844 KB    00:00    
Get/Verify bsd.mp       100% |**************************| 25917 KB    00:00    
Get/Verify bsd.rd       100% |**************************|  4575 KB    00:00    
Get/Verify base75.tgz   100% |**************************|   408 MB    00:12    
Get/Verify comp75.tgz   100% |**************************| 80681 KB    00:02    
Get/Verify man75.tgz    100% |**************************|  7870 KB    00:00    
Installing bsd          100% |**************************| 25844 KB    00:00    
Installing bsd.mp       100% |**************************| 25917 KB    00:00    
Installing bsd.rd       100% |**************************|  4575 KB    00:00    
Installing base75.tgz   100% |**************************|   408 MB    00:16    
Extracting etc.tgz      100% |**************************|   267 KB    00:00    
Installing comp75.tgz   100% |**************************| 80681 KB    00:05    
Installing man75.tgz    100% |**************************|  7870 KB    00:00    
Location of sets? (disk http nfs or 'done') [done] 
Saving configuration files... done.
Making all device nodes... done.
Multiprocessor machine; using bsd.mp instead of bsd.
fw_update: add amd; update none
Relinking to create unique kernel... done.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!

When you login to your new system the first time, please read your mail
using the 'mail' command.

Exit to (S)hell, (H)alt or (R)eboot? [reboot]