Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hypervisor framework not avaiblable on macOS ARM64 runners for running docker containers #9460

Closed
4 of 13 tasks
romeroalx opened this issue Mar 6, 2024 · 1 comment
Closed
4 of 13 tasks

Comments

@romeroalx
Copy link

Description

When trying to run Docker on an ARM64 macOS runner either directly with Docker desktop or using Colima, in both cases it complains that the virtualization framework not being enabled, while it is enabled for the x86_64 macOS runners.

Colima will not start because it launches QEMU with -accel hvf. The output does not say that much, but when trying to launch QEMU manually with that option enabled, it says Error: HV_UNSUPPORTED:

Run qemu-system-aarch64 -m 1G -drive file=ubuntu-23.10-minimal-cloudimg-arm64.qcow2,if=virtio -display default,show-cursor=on -machine type=virt -accel hvf

qemu-system-aarch64: -accel hvf: Error: HV_UNSUPPORTED

I have tried to check manually the support but also throws an error

Run sysctl kern.hv_support

sysctl: unknown oid 'kern.hv_support'

I have checked with the arm64 runners macos-14 and macos-13-xlarge. However, the installation of Docker in both ways works fine on my personal M1 arm64 MAC, and also on the x86_64 macOS runners.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

Runner Image
  Image: macos-14-arm64
  Version: 20240116.1

https://github.com/romeroalx/build-docker-images-arm64/actions/runs/8170604833/job/22337064074

Runner Image
  Image: macos-13-arm64
  Version: 20240219.3

https://github.com/romeroalx/build-docker-images-arm64/actions/runs/8170604827/job/22337064332

Is it regression?

no

Expected behavior

Run sysctl kern.hv_support

kern.hv_support: 1

Actual behavior

> qemu-system-aarch64 -m 1G -drive file=ubuntu-23.10-minimal-cloudimg-arm64.qcow2,if=virtio -display default,show-cursor=on -machine type=virt -accel hvf
qemu-system-aarch64: -accel hvf: Error: HV_UNSUPPORTED

> sysctl kern.hv_support
sysctl: unknown oid 'kern.hv_support'

Repro steps

    jobs:
      docker:
        name: docker
        runs-on: macos-14
        steps:
          # - run: sysctl kern.hv_support
          # Install colima and docker
          - run: brew install colima docker
          # Test launch qemu with -accel hvf and do not stop if fails
          - run: wget https://github.com/abiosoft/colima-core/releases/download/v0.6.7/ubuntu-23.10-minimal-cloudimg-arm64.qcow2
          - run: /opt/homebrew/bin/qemu-system-aarch64 -m 1G -drive file=ubuntu-23.10-minimal-cloudimg-arm64.qcow2,if=virtio -display default,show-cursor=on -machine type=virt -accel hvf -nographic &
          # Start colima daemon
          - run: colima start
          - run: docker ps
          - run: docker pull alpine:latest
          - run: docker image ls
@erik-bershel
Copy link
Contributor

Hey @romeroalx!
Unfortunately it's an architectural issue. We can do nothing about it. You may find more info here.
To use nested virtualisation I can recommend to use Ubuntu based agents. Or to stick to the Intel based agents in case of macOS.

TiagoMSSantos added a commit to TiagoMSSantos/MobileRT that referenced this issue Apr 3, 2024
Summary:
MacOS wasn't updated to v14 because it fails with error:
```
HVF error: HV_UNSUPPORTED
qemu-system-aarch64-headless: failed to initialize HVF: Invalid argument
WARNING | QEMU main loop exits abnormally with code 1
```
This seems to be an architectural issue of macOS ARM64 image:
actions/runner-images#9460

Test plan:
* Pipeline passes
@marcprux marcprux mentioned this issue Apr 25, 2024
13 tasks
wtto00 added a commit to wtto00/test-github-action that referenced this issue May 10, 2024
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue May 13, 2024
The GitHub workflow for testing Docker builds on macOS was consistently
failing. This commit downgrades the macOS version used for Docker tests
to `macos-13`, which is the latest Intel-based macOS runner, instead of
the ARM-based `macos-14` which `macos-latest` points to.

This change is necessary because the hypervisor framework required for
Docker is not supported on the ARM-based macOS runners provided by
GitHub. This issue was causing failures when attempting to run Colima
with QEMU using `-accel hvf`, which is unsupported on these runners.
Switching to an Intel-based runner resolves this issue.

Related issues:
- actions/runner-images#9460
- actions/runner-images#9741
- abiosoft/colima#1023
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue May 13, 2024
The GitHub workflow for testing Docker builds on macOS was consistently
failing. This commit downgrades the macOS version used for Docker tests
to `macos-13`, which is the latest Intel-based macOS runner, instead of
the ARM-based `macos-14` which `macos-latest` points to.

This change is necessary because the hypervisor framework required for
Docker is not supported on the ARM-based macOS runners provided by
GitHub. This issue was causing failures when attempting to run Colima
with QEMU using `-accel hvf`, which is unsupported on these runners.
Switching to an Intel-based runner resolves this issue.

Related issues:
- actions/runner-images#9460
- actions/runner-images#9741
- abiosoft/colima#1023
undergroundwires added a commit to undergroundwires/privacy.sexy that referenced this issue May 13, 2024
The GitHub workflow for testing Docker builds on macOS was consistently
failing. This commit downgrades the macOS version used for Docker tests
to `macos-13`, which is the latest Intel-based macOS runner, instead of
the ARM-based `macos-14` which `macos-latest` points to.

This change is necessary because the hypervisor framework required for
Docker is not supported on the ARM-based macOS runners provided by
GitHub. This issue was causing failures when attempting to run Colima
with QEMU using `-accel hvf`, which is unsupported on these runners.
Switching to an Intel-based runner resolves this issue.

Related issues:
- actions/runner-images#9460
- actions/runner-images#9741
- abiosoft/colima#1023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants