cross-platform-actions / action

Cross-platform GitHub action
MIT License
140 stars 19 forks source link

FreeBSD and OpenBSD VMs don't start - error running `sudo` during initialisation. #88

Closed DrHyde closed 5 months ago

DrHyde commented 5 months ago

I have two workflows which fail consistently while FreeBSD and OpenBSD VMs are starting, both with the messages:

Initializing VM
Error: The process '/usr/bin/sudo' failed with exit code null

My OpenBSD action doesn't use sudo at all. The FreeBSD one does, to install some software in the VM, but isn't getting that far.

jacob-carlborg commented 5 months ago

Strange, I'll take a look. sudo is used by the action before the VM starts.

jacob-carlborg commented 5 months ago

@DrHyde could you please set the following variables to true and rerun the job: ACTIONS_RUNNER_DEBUG and ACTIONS_STEP_DEBUG?

DrHyde commented 5 months ago

Done, but I don't see any extra debug - did I put the variables in the right place?

Here's the FreeBSD build and the OpenBSD build.

jacob-carlborg commented 5 months ago

Done, but I don't see any extra debug - did I put the variables in the right place?

Probably not. I usually put them as a secret variable in Settings -> Security -> Secrets and variables -> Actions -> Secrets.

DrHyde commented 5 months ago

Ahh that's better, lots of extra debug: FreeBSD OpenBSD

jacob-carlborg commented 5 months ago

Ok, I can see the error now. The problem is that you're using macos-latest as the runner [1]. That was recently updated to correspond to macos-14, which is Apple Silicon only. The Xhyve hypervisor, that is used by default for FreeBSD and OpenBSD, is not compatible with Apple Silicon. I recommend switching to ubuntu-latest instead, then it will use the QEMU hypervisor. GitHub fairly recently added support for hardware accelerated nested virtualization on the Ubuntu runners. They also have better performance compared to the macOS runners now. The QEMU hypervisor is also more stable than the Xhyve hypervisor. Cross Platform Actions will deprecate support for the macOS runners in a future release.

It's the same error for both the FreeBSD and OpenBSD jobs.

[1] https://github.com/DrHyde/perl-modules-Number-Phone/blob/ff6ad7c69c9aa41ddedc7de0644d2e688f7c3bc4/.github/workflows/freebsd.yml#L6

DrHyde commented 5 months ago

Yep, that fixed it. Thanks!