diff --git a/images/macos/provision/core/commonutils.sh b/images/macos/provision/core/commonutils.sh index 1f472d2d..10101588 100644 --- a/images/macos/provision/core/commonutils.sh +++ b/images/macos/provision/core/commonutils.sh @@ -13,7 +13,18 @@ done cask_packages=$(get_toolset_value '.brew.cask_packages[]') for package in $cask_packages; do echo "Installing $package..." - brew install --cask $package + if [[ $package == "virtualbox" ]]; then + if ! is_Ventura || ! is_VenturaArm64; then + # Do not update VirtualBox on macOS 12 due to the issue with VMs in gurumediation state which blocks Vagrant on macOS: https://github.com/actions/runner-images/issues/8730 + # macOS host: Dropped all kernel extensions. VirtualBox relies fully on the hypervisor and vmnet frameworks provided by Apple now. + vbcask_url="https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa3c55951fc9d687acce43e5c0338f42c1ddff7b/Casks/virtualbox.rb" + download_with_retries $vbcask_url + brew install ./virtualbox.rb + rm ./virtualbox.rb + fi + else + brew install --cask $package + fi done # Load "Parallels International GmbH" diff --git a/images/macos/tests/Common.Tests.ps1 b/images/macos/tests/Common.Tests.ps1 index 9e278773..e1e645e7 100644 --- a/images/macos/tests/Common.Tests.ps1 +++ b/images/macos/tests/Common.Tests.ps1 @@ -123,6 +123,12 @@ Describe "Go" -Skip:($os.IsVentura -or $os.IsVenturaArm64) { } } +Describe "VirtualBox" -Skip:($os.IsBigSur -or $os.IsVentura -or $os.IsVenturaArm64) { + It "Check kext kernel modules" { + kextstat | Out-String | Should -Match "org.virtualbox.kext" + } +} + Describe "CodeQL Bundle" { It "Is installed" { $CodeQLVersionWildcard = Join-Path $Env:AGENT_TOOLSDIRECTORY -ChildPath "CodeQL" | Join-Path -ChildPath "*"