vagrant-parallels 2.2.4 → 2.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3069fda3f88a140459a882ee8e9afbc59079e49f6b05d1d13f4505c0c86df4b7
4
- data.tar.gz: 6862da240eac05e3fd35e79f2c9dd4ef47b0fcd32b4558d0ae66f99fe3e1fc2c
3
+ metadata.gz: 7035cf285af41cc2b66992971c09b3e77f68da5bb33ca3a8ef7586e4eec65334
4
+ data.tar.gz: '08a191cd2af6f7a5fbb626a16375be955cae4a386123519fb1db077b16345f9b'
5
5
  SHA512:
6
- metadata.gz: 295b8617a454d081415e7e0fb68fb5485b0581d948c8481c415816079307e1fe1e43be5af695d1f2d98c74f2b5fb6e6b88a515397163aecf79795f7a0bf3c1ba
7
- data.tar.gz: b368159177283a7b5202fc12c03d7781cbdc58e32685a22910cbbb86a79dc8691f4e0af279c28f05231da355f137be4e11d1131a1e96b2c8415ae1c49c3b41c4
6
+ metadata.gz: ac10bedbc9ecfd38984e710de98f634dd9c97572e5f6b8bf27f9a5f91f6d6af9cce0ae7152642b4d37ab2a9c49708189ae7ae9cb108b00c6710f44af9ca19921
7
+ data.tar.gz: 6fea796a741e76daefb24bd2ebbc86fc5a248c3665c347fb3d004c3f277ec6dc84d6c3bd2b3b4577d4e68e49f76d06abea4cf49fede0d198266dd0fa3cfce781
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 2.2.6 (December 19, 2022)
2
+ BUG FIXES:
3
+ - Fix the macOS VMs support on ARM-based Mac
4
+ [[GH-429](https://github.com/Parallels/vagrant-parallels/pull/429)]
5
+
6
+ ## 2.2.5 (February 22, 2022)
7
+ BUG FIXES:
8
+ - Fixed Parallels Tool installation on M1 hosts with arm64
9
+ [[GH-416](https://github.com/Parallels/vagrant-parallels/pull/416)]
10
+
1
11
  ## 2.2.4 (August 18, 2021)
2
12
  BUG FIXES:
3
13
  - Fixed running the provisioner on "vagrant up --provision"
@@ -39,13 +39,13 @@ module VagrantPlugins
39
39
  protected
40
40
 
41
41
  def box_path(env)
42
- pvm = Dir.glob(env[:machine].box.directory.join('*.pvm')).first
42
+ res = Dir.glob(env[:machine].box.directory.join('*.{pvm,macvm}')).first
43
43
 
44
- if !pvm
44
+ if !res
45
45
  raise Errors::BoxImageNotFound, name: env[:machine].box.name
46
46
  end
47
47
 
48
- pvm
48
+ res
49
49
  end
50
50
 
51
51
  def box_id(env)
@@ -120,9 +120,6 @@ module VagrantPlugins
120
120
  f.write(env[:clone_id])
121
121
  end
122
122
 
123
- # Convert template to VM (compatibility with old-styled boxes)
124
- env[:machine].provider.driver.execute_prlctl(
125
- 'set', env[:clone_id], '--template', 'off')
126
123
  end
127
124
  end
128
125
  end
@@ -4,6 +4,7 @@ module VagrantPlugins
4
4
  module Parallels
5
5
  module Action
6
6
  class Import
7
+ include VagrantPlugins::Parallels::Util::Common
7
8
  @@lock = Mutex.new
8
9
 
9
10
  def initialize(app, env)
@@ -24,7 +25,8 @@ module VagrantPlugins
24
25
  end
25
26
 
26
27
  # Linked clones are supported only for PD 11 and higher
27
- if env[:machine].provider_config.linked_clone
28
+ # Linked clones are not supported in macvms
29
+ if env[:machine].provider_config.linked_clone and !is_macvm(env)
28
30
  # Linked clone creation should not be concurrent [GH-206]
29
31
  options[:snapshot_id] = env[:clone_snapshot_id]
30
32
  options[:linked] = true
@@ -6,6 +6,7 @@ module VagrantPlugins
6
6
  module Parallels
7
7
  module Action
8
8
  class PrepareCloneSnapshot
9
+ include VagrantPlugins::Parallels::Util::Common
9
10
  @@lock = Mutex.new
10
11
 
11
12
  def initialize(app, env)
@@ -19,6 +20,12 @@ module VagrantPlugins
19
20
  return @app.call(env)
20
21
  end
21
22
 
23
+ if is_macvm(env)
24
+ #Ignore, since macvms doesn't support snapshot creation
25
+ @logger.info('Snapshot creation is not supported yet for macOS ARM Guests, skip snapshot preparing')
26
+ return @app.call(env)
27
+ end
28
+
22
29
  # If we're not doing a linked clone, snapshots don't matter
23
30
  if !env[:machine].provider_config.linked_clone
24
31
  return @app.call(env)
@@ -4,6 +4,8 @@ module VagrantPlugins
4
4
  module Parallels
5
5
  module Action
6
6
  class SaneDefaults
7
+ include VagrantPlugins::Parallels::Util::Common
8
+
7
9
  def initialize(app, env)
8
10
  @logger = Log4r::Logger.new('vagrant_parallels::action::sanedefaults')
9
11
  @app = app
@@ -27,6 +29,9 @@ module VagrantPlugins
27
29
  private
28
30
 
29
31
  def default_settings
32
+ # Options defined below are not supported for `*.macvm` VMs
33
+ return {} if is_macvm(@env)
34
+
30
35
  {
31
36
  tools_autoupdate: 'no',
32
37
  on_shutdown: 'close',
@@ -434,11 +434,13 @@ module VagrantPlugins
434
434
  #
435
435
  # @param [String] guest_os Guest os type: "linux", "darwin" or "windows"
436
436
  # @return [String] Path to the ISO.
437
- def read_guest_tools_iso_path(guest_os)
438
- guest_os = guest_os.to_sym
437
+ def read_guest_tools_iso_path(guest_os, arch=nil)
438
+ guest_os = (guest_os + (['arm', 'arm64', 'aarch64'].include?(arch.to_s.strip) ? '_arm' : '')).to_sym
439
439
  iso_name = {
440
440
  linux: 'prl-tools-lin.iso',
441
+ linux_arm: 'prl-tools-lin-arm.iso',
441
442
  darwin: 'prl-tools-mac.iso',
443
+ darwin_arm: 'prl-tools-mac-arm.iso',
442
444
  windows: 'PTIAgent.exe'
443
445
  }
444
446
  return nil unless iso_name[guest_os]
@@ -5,8 +5,11 @@ module VagrantPlugins
5
5
 
6
6
  def self.install_parallels_tools(machine)
7
7
  machine.communicate.tap do |comm|
8
+ arch = ''
9
+ comm.execute("uname -p") { |type, data| arch << data if type == :stdout }
10
+
8
11
  tools_iso_path = File.expand_path(
9
- machine.provider.driver.read_guest_tools_iso_path('darwin'),
12
+ machine.provider.driver.read_guest_tools_iso_path("darwin", arch),
10
13
  machine.env.root_path
11
14
  )
12
15
  remote_file = '/tmp/prl-tools-mac.iso'
@@ -1,3 +1,5 @@
1
+ require 'log4r'
2
+
1
3
  module VagrantPlugins
2
4
  module Parallels
3
5
  module GuestLinuxCap
@@ -8,8 +10,11 @@ module VagrantPlugins
8
10
  machine.communicate.sudo('ptiagent-cmd --install')
9
11
  else
10
12
  machine.communicate.tap do |comm|
13
+ arch = ''
14
+ comm.execute("uname -p") { |type, data| arch << data if type == :stdout }
15
+
11
16
  tools_iso_path = File.expand_path(
12
- machine.provider.driver.read_guest_tools_iso_path('linux'),
17
+ machine.provider.driver.read_guest_tools_iso_path("linux", arch),
13
18
  machine.env.root_path
14
19
  )
15
20
  remote_file = '/tmp/prl-tools-lin.iso'
@@ -168,6 +168,7 @@ module VagrantPlugins
168
168
 
169
169
  module Util
170
170
  autoload :CompileForwardedPorts, File.expand_path('../util/compile_forwarded_ports', __FILE__)
171
+ autoload :Common, File.expand_path('../util/common', __FILE__)
171
172
  end
172
173
  end
173
174
  end
@@ -0,0 +1,15 @@
1
+ module VagrantPlugins
2
+ module Parallels
3
+ module Util
4
+ module Common
5
+
6
+ # Determines whether the VM's box contains a macOS guest for an Apple Silicon host.
7
+ # In this case the image file ends with '.macvm' instead of '.pvm'
8
+ def is_macvm(env)
9
+ return !!Dir.glob(env[:machine].box.directory.join('*.macvm')).first
10
+ end
11
+
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,5 +1,5 @@
1
1
  module VagrantPlugins
2
2
  module Parallels
3
- VERSION = '2.2.4'
3
+ VERSION = '2.2.6'
4
4
  end
5
5
  end
data/locales/en.yml CHANGED
@@ -16,7 +16,7 @@ en:
16
16
  Box VM config: "%{config}"
17
17
 
18
18
  box_image_not_found: |-
19
- Parallels VM image (*.pvm) could not be found in the directory of
19
+ Parallels VM image (*.pvm or *.macvm) could not be found in the directory of
20
20
  '%{name}' box. This is usually because the image has been removed manually.
21
21
  Please remove the box, re-add it, and try again.
22
22
  dhcp_leases_file_not_accessible: |-
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-parallels
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mikhail Zholobov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-08-18 00:00:00.000000000 Z
12
+ date: 2022-12-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -128,6 +128,7 @@ files:
128
128
  - lib/vagrant-parallels/plugin.rb
129
129
  - lib/vagrant-parallels/provider.rb
130
130
  - lib/vagrant-parallels/synced_folder.rb
131
+ - lib/vagrant-parallels/util/common.rb
131
132
  - lib/vagrant-parallels/util/compile_forwarded_ports.rb
132
133
  - lib/vagrant-parallels/util/unix_mount_helpers.rb
133
134
  - lib/vagrant-parallels/version.rb