Skip to content

Commit

Permalink
Test macOS VM on ARM
Browse files Browse the repository at this point in the history
  • Loading branch information
alevlasu authored and bineesh-n committed Dec 13, 2022
1 parent 0e7230d commit 3be28bc
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
14 changes: 12 additions & 2 deletions lib/vagrant-parallels/action/box_register.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ def call(env)

def box_path(env)
pvm = Dir.glob(env[:machine].box.directory.join('*.pvm')).first
mac_vm_m1 = false

if !pvm
pvm = Dir.glob(env[:machine].box.directory.join('*.macvm')).first
if pvm
mac_vm_m1 = true
end
end

if !pvm
raise Errors::BoxImageNotFound, name: env[:machine].box.name
Expand Down Expand Up @@ -121,8 +129,10 @@ def register_box(env)
end

# Convert template to VM (compatibility with old-styled boxes)
env[:machine].provider.driver.execute_prlctl(
'set', env[:clone_id], '--template', 'off')
# Not required for a macOS VM on M1 - not supported as a template and overall no such boxes anymore in public. Removed. #
# env[:machine].provider.driver.execute_prlctl(
# 'set', env[:clone_id], '--template', 'off')

end
end
end
Expand Down
32 changes: 17 additions & 15 deletions lib/vagrant-parallels/action/sane_defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ def call(env)

def default_settings
{
tools_autoupdate: 'no',
on_shutdown: 'close',
on_window_close: 'keep-running',
auto_share_camera: 'off',
smart_guard: 'off',
longer_battery_life: 'on',
shared_cloud: 'off',
shared_profile: 'off',
smart_mount: 'off',
sh_app_guest_to_host: 'off',
sh_app_host_to_guest: 'off',
startup_view: 'headless',
time_sync: 'on',
disable_timezone_sync: 'on',
shf_host_defined: 'off'
# all commented for macOS VM, need a better solution here

# tools_autoupdate: 'no',
# on_shutdown: 'close',
# on_window_close: 'keep-running',
# auto_share_camera: 'off',
# smart_guard: 'off',
# longer_battery_life: 'on',
# shared_cloud: 'off',
# shared_profile: 'off',
# smart_mount: 'off',
# sh_app_guest_to_host: 'off',
# sh_app_host_to_guest: 'off',
# startup_view: 'headless',
# time_sync: 'on',
# disable_timezone_sync: 'on',
# shf_host_defined: 'off'
}
end
end
Expand Down
2 changes: 1 addition & 1 deletion locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ en:
Box VM config: "%{config}"
box_image_not_found: |-
Parallels VM image (*.pvm) could not be found in the directory of
Parallels VM image (*.pvm or *.macvm) could not be found in the directory of
'%{name}' box. This is usually because the image has been removed manually.
Please remove the box, re-add it, and try again.
dhcp_leases_file_not_accessible: |-
Expand Down

0 comments on commit 3be28bc

Please sign in to comment.