Skip to content

Commit

Permalink
[macOS] Add parallels kernel extension to macOS13 and macOS14
Browse files Browse the repository at this point in the history
[macOS] Add parallels kernel extension to macOS13 and macOS14

[macOS] Add parallels kernel extension to macOS13 and macOS14

Add parallels desktop extension for macOS14 intel machines

Undo changes to Generate-SoftwareReport.ps1

Add parallel desktop for sonoma arm64 and intel

add parallels extension for macos13

add miscellaneous for macOS13 and macOS14

update security preference for macOS13 and macOS14

update hypervisor command for macOS13 and macOS14

change system setting for macOS13 and macos14

add tcc entry for parallels

add extensions for com.parallels.kext identifiers

add echo of kext value for validation

remove parallels from tcc db for testing

add change for macos13 and macos14

Update confirm-identified-developers-macos.scpt

remove is_veertu for macos13 and macos14

Fix for macos 14 kernel extension approval

update macos.scpt for macos13 and macos14

update security preference

apple script fix for macos14

add apple script for macos13 and macos14

final changes

update cask package
  • Loading branch information
sarathrajsrinivasan committed Aug 16, 2024
1 parent 4e6e715 commit baefd5c
Show file tree
Hide file tree
Showing 9 changed files with 111 additions and 14 deletions.
3 changes: 2 additions & 1 deletion images/macos/scripts/build/configure-system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ close_finder_window

# Remove Parallels Desktop
# https://github.com/actions/runner-images/issues/6105
if is_Monterey; then
# https://github.com/actions/runner-images/issues/10143
if is_Monterey || is_Sonoma || is_Ventura; then
brew uninstall parallels
fi

Expand Down
38 changes: 30 additions & 8 deletions images/macos/scripts/build/install-common-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,38 @@ for package in $cask_packages; do
virtualbox_cask_path=$(download_with_retry "https://raw.githubusercontent.com/Homebrew/homebrew-cask/aa3c55951fc9d687acce43e5c0338f42c1ddff7b/Casks/virtualbox.rb")
brew install $virtualbox_cask_path
else
brew install --cask $package
if is_Arm64 && [[ $package == "parallels" ]]; then
echo "Parallels installation is skipped for arm64 architecture"
else
brew install --cask $package
fi
fi
done

# Load "Parallels International GmbH"
if is_Monterey; then
if is_Monterey || is_SonomaX64 || is_VenturaX64; then
sudo kextload /Applications/Parallels\ Desktop.app/Contents/Library/Extensions/10.9/prl_hypervisor.kext || true
fi

# Execute AppleScript to change security preferences
# Execute AppleScript to change security preferences for macOS12, macOS13 and macOS14
# System Preferences -> Security & Privacy -> General -> Unlock -> Allow -> Not now
if is_Monterey; then
if is_Monterey || is_SonomaX64 || is_VenturaX64; then
for retry in {4..0}; do
echo "Executing AppleScript to change security preferences. Retries left: $retry"
{
set -e
osascript -e 'tell application "System Events" to get application processes where visible is true'
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
if is_Monterey; then
osascript $HOME/utils/confirm-identified-developers.scpt $USER_PASSWORD
fi

if is_VenturaX64; then
osascript $HOME/utils/confirm-identified-developers-macos13.scpt $USER_PASSWORD
fi

if is_SonomaX64; then
osascript $HOME/utils/confirm-identified-developers-macos14.scpt $USER_PASSWORD
fi
} && break

if [[ $retry -eq 0 ]]; then
Expand All @@ -61,9 +75,17 @@ if is_Monterey; then
fi

# Validate "Parallels International GmbH" kext
if is_Monterey; then
echo "Closing System Preferences window if it is still opened"
killall "System Preferences" || true
if is_Monterey || is_SonomaX64 || is_VenturaX64; then

if is_Monterey; then
echo "Closing System Preferences window if it is still opened"
killall "System Preferences" || true
fi

if is_SonomaX64 || is_VenturaX64; then
echo "Closing System Settings window if it is still opened"
killall "System Settings" || true
fi

echo "Checking parallels kexts"
dbName="/var/db/SystemPolicyConfiguration/KextPolicy"
Expand Down
8 changes: 7 additions & 1 deletion images/macos/scripts/docs-gen/Generate-SoftwareReport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,13 @@ if ($os.IsMonterey) {
$miscellaneous.AddToolVersion("Zlib", $(Get-ZlibVersion))
}

if ($os.IsMonterey) {
if ($os.IsSonoma -or $os.IsVentura) {
$miscellaneous = $installedSoftware.AddHeader("Miscellaneous")
}
if ($os.IsMonterey -or $os.IsSonoma -or $os.IsVentura) {

Write-Host "Adding environment variables for parallels"

$miscellaneousEnv = $miscellaneous.AddHeader("Environment variables")
$miscellaneousEnv.AddTable($(Build-MiscellaneousEnvironmentTable))

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This AppleScript clicks "Allow" for "System Software from developer "Parallels International GmbH"
# Steps:
# - Open System Settings -> Privacy & Security
# - Click 'Allow' for 'System Software from developer "Parallels International GmbH'
# - Enter password for runner

on run argv
set userpassword to item 1 of argv

tell application "System Settings"
activate
delay 5
end tell

tell application "System Events"
tell process "System Settings"
set frontmost to true
repeat until exists window 1
delay 2
end repeat

tell splitter group 1 of group 1 of window 1
select row 20 of outline 1 of scroll area 1 of group 1
delay 5
click UI Element 2 of group 4 of scroll area 1 of group 1 of group 2
delay 5
keystroke userpassword
delay 5
keystroke return
delay 5
end tell
end tell
end tell
end run
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This AppleScript clicks "Allow" for "System Software from developer "Parallels International GmbH"
# Steps:
# - Open System Settings -> Privacy & Security
# - Click 'Allow' for 'System Software from developer "Parallels International GmbH'
# - Enter password for runner

on run argv
set userpassword to item 1 of argv

tell application "System Settings"
activate
delay 5
end tell

tell application "System Events"
tell process "System Settings"
set frontmost to true
repeat until exists window 1
delay 2
end repeat

tell splitter group 1 of group 1 of window 1
select row 18 of outline 1 of scroll area 1 of group 1
delay 5
click UI Element 2 of group 5 of scroll area 1 of group 1 of group 2
delay 5
keystroke userpassword
delay 5
keystroke return
delay 5
end tell
end tell
end tell
end run
2 changes: 1 addition & 1 deletion images/macos/templates/macOS-13.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ build {
"mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report",
"mv ${local.image_folder}/xamarin-selector ${local.image_folder}/assets",
"mkdir ~/utils",
"mv ${local.image_folder}/helpers/confirm-identified-developers.scpt ~/utils",
"mv ${local.image_folder}/helpers/confirm-identified-developers-macos13.scpt ~/utils",
"mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils",
"mv ${local.image_folder}/helpers/utils.sh ~/utils",
"mv ${local.image_folder}/helpers/xamarin-utils.sh ~/utils"
Expand Down
2 changes: 1 addition & 1 deletion images/macos/templates/macOS-14.anka.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ build {
"mv ${local.image_folder}/docs-gen ${local.image_folder}/software-report",
"mv ${local.image_folder}/xamarin-selector ${local.image_folder}/assets",
"mkdir ~/utils",
"mv ${local.image_folder}/helpers/confirm-identified-developers.scpt ~/utils",
"mv ${local.image_folder}/helpers/confirm-identified-developers-macos14.scpt ~/utils",
"mv ${local.image_folder}/helpers/invoke-tests.sh ~/utils",
"mv ${local.image_folder}/helpers/utils.sh ~/utils",
"mv ${local.image_folder}/helpers/xamarin-utils.sh ~/utils"
Expand Down
2 changes: 1 addition & 1 deletion images/macos/toolsets/toolset-13.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"xcodes"
],
"cask_packages": [
""
"parallels"
]
},
"gcc": {
Expand Down
2 changes: 1 addition & 1 deletion images/macos/toolsets/toolset-14.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"xcodes"
],
"cask_packages": [
""
"parallels"
]
},
"gcc": {
Expand Down

0 comments on commit baefd5c

Please sign in to comment.