Skip to content

Instantly share code, notes, and snippets.

@voutilad
Created May 29, 2017 15:16
  • Star 12 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save voutilad/a5080909e88e8dcffd1960312b5f9510 to your computer and use it in GitHub Desktop.
Installing Alpine Linux in OpenBSD's VMM Hypervisor
# Assuming you're a regular user that has doas allowances for vmctl
mkdir -p ~/vmm
cd ~/vmm
# Grab the the one of the virt iso's of Alpine Linux
curl https://nl.alpinelinux.org/alpine/v3.6/releases/x86_64/alpine-virt-3.6.0-x86_64.iso -o alpine-virt-3.6.0-x86_64.iso
# Make a new virtual disk image, change the size as needed
vmctl create alpine-virt.img -s 6G
# Boot Alpine from the ISO. Make sure you have this exact disk order because as of 29 May 2017
# VMM's SeaBIOS will only try to boot from the first one it seems!
# Also, this assumes:
# - you want 1024M of memory, tune as desired
# - you configured a virtual switch called "local" in your /etc/vm.conf
# (see: http://www.h-i-r.net/2017/04/openbsd-vmm-hypervisor-part-2.html)
doas vmctl start alpine -d alpine-virt-3.6.0-x86_64.iso -d alpine-virt.img -n local -m 1024M -c
# You shoud get a serial console connection immediately. Hit enter or whatever to boot Alpine.
# Once in Alpine, run:
setup-alpine
@voutilad
Copy link
Author

Ohey, some of the above gist might be a bit old now...but if you want some general Alpine on OpenBSD VMM tips check out: https://medium.com/@dave_voutila/tips-for-alpine-linux-under-openbsd-dca8d09568b4

I know...medium is terrible...but my laziness in moving the post to a non-Medium location is greater than anything at the moment. C'est la vie.

@egtann
Copy link

egtann commented Jan 28, 2020

For the poor souls about to install Alpine on vmm, there's a bug in 6.6 and -current at least as of 1/28/2020 which prevents newer versions of Alpine from running properly (they are suddenly killed, no rhyme or reason I can find). Older versions of Alpine work well, though! Tested and very stable on alpine-virt-3.5.3-x86_64.

@epsilon-0
Copy link

For the poor souls about to install Alpine on vmm, there's a bug in 6.6 and -current at least as of 1/28/2020 which prevents newer versions of Alpine from running properly (they are suddenly killed, no rhyme or reason I can find). Older versions of Alpine work well, though! Tested and very stable on alpine-virt-3.5.3-x86_64.

I don't know if this is still a problem, I am trying to run alpine-virt-3.11.3-x86-64.iso and it seems to be woring fine for at least 45-50 mins, mostly idle though.

Can you tell any amount of how to try and replicate this?

@divansantana
Copy link

I've had this issue too. Guessing it's hardware related. openbsd72 running alpine-virt anything greater then or equal to 3.6 fails. No idea why.

@voutilad
Copy link
Author

voutilad commented Jan 5, 2023

Are you on Intel-based hardware for the OpenBSD host? If so, it's probably the Linux kernel probing some expected Intel hardware via MMIO registers. vmm(4) and vmd(8) do not implement support for emulating that access yet, but there is some preliminary support I committed a few months ago that's gated behind an #ifdef. It requires a -current host and building vmd(8) from source and twiddling the MMIO_NOTYET definition.

It might help the guests boot. If not, check the output and share it on misc@openbsd.org for me please.

@divansantana
Copy link

Done. Thanks @voutilad :)

@voutilad
Copy link
Author

voutilad commented Jan 6, 2023

See my reply on the email list: https://marc.info/?l=openbsd-misc&m=167303917804395&w=2

In short, I think this is an issue we will fix in -current but since I don't think I have newer Intel hardware that supports the TSLEEP instructions to test my changes it may be a few days to confirm.

@divansantana
Copy link

Looks like recent patch in 7.2 fixed this. Thank you!

@divansantana
Copy link

Looks like recent patch in 7.2 fixed this. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment