On Sun, Oct 26, 2025 at 10:25:22AM +1100, David Leadbeater wrote:
I'm not aware of anything prebuilt to do this, but it is possible to take the same approach and overwrite the disk with installation media, for example [1] or [2] outline some approaches. The second approach where a Linux tmpfs is used is slightly more "production-ready" as it avoids one potential for the running Linux system to conflict with the install, but I wouldn't call any production-ready, the better approach is to upload a custom image, which most providers do support (and if you want something production ready it feels like using something the provider isn't supporting isn't going to end well, just use a provider that supports OpenBSD to start with).
I found "takeover.sh" which looks promising, but doesn't appear to be actively maintained. Many providers that nominally support OpenBSD provide very old images, or I may not feel like trusting their image. So having something that I can use in every situation, regrdless of the provider's quirks, would be really valuable.
If you do really want to do this, I've done something like this for testing... (based on those two blog posts): mount -t tmpfs -o size=1G none /tmp cd /tmp [on a remote system:] scp install77-serial.img ubuntu@remote:/tmp [busybox-static is a Linux static busybox binary to reduce dependency on the running system.] scp busybox-static ubuntu@remote:/tmp [back on the VM; force the running system disk to be read-only, using Linux sysrq "u", avoids the potential for the running system to overwrite the image being written to disk.] sync echo u > /proc/sysrq-trigger exec /tmp/busybox-static sh # now running an sh off tmpfs too dd if=install77-serial.img of=/dev/sda bs=1M That install77-serial.img image is modified to use serial per [2], but it's also possible to modify bsd.rd and use autoinstall(8), which could setup an encrypted install, or configure install.site(5).
That looks pretty solid. Why wouldn't that be production ready?
[1]: https://gduale.com/posts/openbsd-on-a-scaleway-vm/ [2]: https://marc.info/?l=openbsd-misc&m=162962869305286&w=2 and https://anirudh.fi/openbsd-oci

