vagrant-parallels 2.2.5 → 2.3.0

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: ede8c43d4ad31a4ad5cec8ecf94158e93a825ea959bf4a2cbf5da1b1428108ad
4
- data.tar.gz: 0e56a44dcbd181577e69ef04525be3278a86fd6c0ccb41139635a19176d3768e
3
+ metadata.gz: 4cc3b37f94bef78ed214b98add9ae9814d6cad49650e5016fce26c7b7641eaaa
4
+ data.tar.gz: 0e1ffee3b192374a3acc9b36438334605702e7c5b472d1e47857a31acd5c7196
5
5
  SHA512:
6
- metadata.gz: a283f0ebedc0074f277fd902725d6724b1db7a7c822621885f5df8bba6197abe9e3e6a914a5cfc8146c4abd187c04a81c59ff02f364c058ffa3fbe7f7fc634be
7
- data.tar.gz: 8af828330dc40be03eefcd34834e2eb1d7490ba7ed7331d01dbec224f148ca9743d961cc2510c889d97112f50bc3f7d0db0047c0c3cb5cc03316ed256ed665a3
6
+ metadata.gz: f03a6bc1a95f28f95a736d3ce59dc52edb00bd609780e24ef26b38090ef32421ef8db5f362cd9692954aa88292e18af89cd884ea423f9a244d5932cdfff1749d
7
+ data.tar.gz: 86467aba98c5870183d5da52a0b688ca28f5f06eb5160d983ea26d80a582a20108958e0b54c2c4ee14adb8f3740608ffeaf4f84debdbafb614a79da75c9f8e5b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 2.3.0 (March 22, 2022)
2
+ IMPROVEMENTS:
3
+ - Support fetching the VM IP using prlctl
4
+ [[GH-434](https://github.com/Parallels/vagrant-parallels/pull/434)].
5
+ - Update gem dependensies and support Ruby 3.0
6
+ [[GH-437](https://github.com/Parallels/vagrant-parallels/pull/437)],
7
+ [[GH-439](https://github.com/Parallels/vagrant-parallels/pull/439)].
8
+
9
+ BUG FIXES:
10
+ - Fixes SSH access to `.macvm` VMs on Macs with Apple M-series chip
11
+ [[GH-435](https://github.com/Parallels/vagrant-parallels/issues/435)]
12
+
13
+ ## 2.2.6 (December 19, 2022)
14
+ BUG FIXES:
15
+ - Fix the macOS VMs support on ARM-based Mac
16
+ [[GH-429](https://github.com/Parallels/vagrant-parallels/pull/429)]
17
+
1
18
  ## 2.2.5 (February 22, 2022)
2
19
  BUG FIXES:
3
20
  - Fixed Parallels Tool installation on M1 hosts with arm64
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Copyright (c) 2013 Youssef Shahin
2
- Copyright (c) 2013-2017 Parallels International GmbH.
2
+ Copyright (c) 2013-2023 Parallels International GmbH.
3
3
 
4
4
  MIT License
5
5
 
data/README.md CHANGED
@@ -53,6 +53,6 @@ please report it on the [Issue Tracker](https://github.com/Parallels/vagrant-par
53
53
 
54
54
  * Author: Youssef Shahin <yshahin@gmail.com>
55
55
  * Author: Mikhail Zholobov <legal90@gmail.com>
56
- * Copyright 2013-2020, Parallels International GmbH.
56
+ * Copyright 2013-2023, Parallels International GmbH.
57
57
 
58
58
  Vagrant Parallels Provider is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
@@ -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)
@@ -37,7 +37,7 @@ module VagrantPlugins
37
37
  # The ! indicates that this method modifies its argument.
38
38
  def add_ips_to_env!(env)
39
39
  host_ip = @machine.provider.driver.read_shared_interface[:ip]
40
- guest_ip = @machine.provider.driver.read_guest_ip
40
+ guest_ip = @machine.provider.driver.ssh_ip
41
41
 
42
42
  # If we couldn't determine either guest's or host's IP, then
43
43
  # it is probably a bug. Display an appropriate error message.
@@ -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',
@@ -403,11 +403,12 @@ module VagrantPlugins
403
403
  end
404
404
  end
405
405
 
406
- # Returns an IP of the virtual machine. It requires that Shared network
407
- # adapter is configured for this VM and it obtains an IP via DHCP.
406
+ # Returns an IP of the virtual machine fetched from the DHCP lease file.
407
+ # It requires that Shared network adapter is configured for this VM
408
+ # and it obtains an IP via DHCP.
408
409
  #
409
410
  # @return [String] IP address leased by DHCP server in "Shared" network
410
- def read_guest_ip
411
+ def read_guest_ip_dhcp
411
412
  mac_addr = read_mac_address.downcase
412
413
  leases_file = '/Library/Preferences/Parallels/parallels_dhcp_leases'
413
414
  leases = {}
@@ -430,6 +431,15 @@ module VagrantPlugins
430
431
  leases.max_by { |_ip, lease_time| lease_time }.first
431
432
  end
432
433
 
434
+ # Returns an IP of the virtual machine fetched from prlctl.
435
+ #
436
+ # @return [String] IP address returned by `prlctl list -f` command
437
+ def read_guest_ip_prlctl
438
+ vm_info = json { execute_prlctl('list', @uuid, '--full', '--json') }
439
+ ip = vm_info.first.fetch('ip_configured', nil)
440
+ ip == '-' ? nil : ip
441
+ end
442
+
433
443
  # Returns path to the Parallels Tools ISO file.
434
444
  #
435
445
  # @param [String] guest_os Guest os type: "linux", "darwin" or "windows"
@@ -757,11 +767,14 @@ module VagrantPlugins
757
767
  end
758
768
  end
759
769
 
760
- # Reads the SSH IP of this VM.
770
+ # Reads the SSH IP of this VM from DHCP lease file or from `prlctl list`
771
+ # command - whatever returns a non-empty result.
772
+ # The method with DHCP does not work for *.macvm VMs on Apple M-series Macs,
773
+ # so we try both sources here.
761
774
  #
762
775
  # @return [String] IP address to use for SSH connection to the VM.
763
776
  def ssh_ip
764
- read_guest_ip
777
+ read_guest_ip_dhcp || read_guest_ip_prlctl
765
778
  end
766
779
 
767
780
  # Reads the SSH port of this VM.
@@ -87,7 +87,8 @@ module VagrantPlugins
87
87
  :read_bridged_interfaces,
88
88
  :read_current_snapshot,
89
89
  :read_forwarded_ports,
90
- :read_guest_ip,
90
+ :read_guest_ip_dhcp,
91
+ :read_guest_ip_prlctl,
91
92
  :read_guest_tools_state,
92
93
  :read_guest_tools_iso_path,
93
94
  :read_host_only_interfaces,
@@ -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.5'
3
+ VERSION = '2.3.0'
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.5
4
+ version: 2.3.0
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: 2022-02-22 00:00:00.000000000 Z
12
+ date: 2023-03-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: 3.10.0
48
+ version: '3.11'
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 3.10.0
55
+ version: '3.11'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rspec-its
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -67,9 +67,23 @@ dependencies:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
69
  version: 1.3.0
70
+ - !ruby/object:Gem::Dependency
71
+ name: webrick
72
+ requirement: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: 1.8.0
77
+ type: :development
78
+ prerelease: false
79
+ version_requirements: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: 1.8.0
70
84
  description: Enables Vagrant to manage Parallels virtual machines.
71
85
  email:
72
- - mzholobov@parallels.com
86
+ - legal90@gmail.com
73
87
  - yshahin@gmail.com
74
88
  executables: []
75
89
  extensions: []
@@ -128,6 +142,7 @@ files:
128
142
  - lib/vagrant-parallels/plugin.rb
129
143
  - lib/vagrant-parallels/provider.rb
130
144
  - lib/vagrant-parallels/synced_folder.rb
145
+ - lib/vagrant-parallels/util/common.rb
131
146
  - lib/vagrant-parallels/util/compile_forwarded_ports.rb
132
147
  - lib/vagrant-parallels/util/unix_mount_helpers.rb
133
148
  - lib/vagrant-parallels/version.rb
@@ -151,7 +166,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
151
166
  - !ruby/object:Gem::Version
152
167
  version: 1.3.6
153
168
  requirements: []
154
- rubygems_version: 3.0.3
169
+ rubygems_version: 3.2.33
155
170
  signing_key:
156
171
  specification_version: 4
157
172
  summary: Parallels provider for Vagrant.