vagrant-parallels 1.7.6 → 2.1.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 +5 -5
- data/CHANGELOG.md +84 -42
- data/README.md +29 -31
- data/lib/vagrant-parallels/action.rb +2 -0
- data/lib/vagrant-parallels/action/box_unregister.rb +2 -2
- data/lib/vagrant-parallels/action/import.rb +2 -12
- data/lib/vagrant-parallels/action/network.rb +6 -1
- data/lib/vagrant-parallels/action/package_vagrantfile.rb +33 -0
- data/lib/vagrant-parallels/action/prepare_clone_snapshot.rb +1 -2
- data/lib/vagrant-parallels/action/sane_defaults.rb +3 -18
- data/lib/vagrant-parallels/config.rb +1 -1
- data/lib/vagrant-parallels/driver/base.rb +14 -36
- data/lib/vagrant-parallels/driver/meta.rb +6 -8
- data/lib/vagrant-parallels/driver/pd_11.rb +2 -2
- data/lib/vagrant-parallels/driver/pd_12.rb +1 -1
- data/lib/vagrant-parallels/errors.rb +5 -1
- data/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb +5 -4
- data/lib/vagrant-parallels/plugin.rb +0 -1
- data/lib/vagrant-parallels/synced_folder.rb +2 -2
- data/lib/vagrant-parallels/version.rb +1 -1
- data/locales/en.yml +14 -6
- metadata +26 -13
- data/lib/vagrant-parallels/driver/pd_10.rb +0 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5fdb9ca9fa5d338982ac6541f4f5678e0ef2dee8c59702db2e306db6b78e680b
|
4
|
+
data.tar.gz: aa9b5f1f0e36c1738f110f398625a06966c1000372709f7f1c0b66a3ff8464cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcad3b44951d96a81e85a70de8eced5a79cc345927233de61cd0dae7cfc04793a6f5259d92f420accb1663563d285454435848c569b3de67e3df01bec90934ce
|
7
|
+
data.tar.gz: e3d94acb423edbe4222ad979717a7379780b4be870fc33c793f0c09f64fa48721086d3ef03d14b08e560ead90d44ed183a8a37035b7a043379d9148548bb13eb
|
data/CHANGELOG.md
CHANGED
@@ -1,33 +1,75 @@
|
|
1
|
+
## 2.1.0 (November 25, 2020)
|
2
|
+
BUG FIXES:
|
3
|
+
- Fixed the private network adapter workflow on macOS 11.0 Big Sur
|
4
|
+
[[GH-371](https://github.com/Parallels/vagrant-parallels/pull/371)]
|
5
|
+
- Fixed the concurrency issue with box unregister in multi-vm environment
|
6
|
+
[[GH-370](https://github.com/Parallels/vagrant-parallels/pull/370)]
|
7
|
+
- Fixed the `vagrant package` with custom `Vagrantfile`
|
8
|
+
[[GH-368](https://github.com/Parallels/vagrant-parallels/pull/368)]
|
9
|
+
|
10
|
+
## 2.0.1 (April 23, 2019)
|
11
|
+
BUG FIXES:
|
12
|
+
- Fixed the error message for host-only network collision
|
13
|
+
[[GH-340](https://github.com/Parallels/vagrant-parallels/issues/340)]
|
14
|
+
|
15
|
+
## 2.0.0 (November 19, 2018)
|
16
|
+
BREAKING CHANGES:
|
17
|
+
- **Linked Clone feature is enabled by default.**
|
18
|
+
Now each time when you create a new virtual machine with `vagrant up` it is
|
19
|
+
created as a linked clone of the box image (instead of the full clone, as it
|
20
|
+
was before). Read more about it:
|
21
|
+
[Full Clone vs Linked Clone](https://parallels.github.io/vagrant-parallels/docs/configuration.html#linked_clone).
|
22
|
+
- **Dropped support of Parallels Desktop 10**. It reached
|
23
|
+
[End-of-Life and End-of-Support](https://kb.parallels.com/eu/122533).
|
24
|
+
|
25
|
+
## 1.7.8 (November 18, 2017)
|
26
|
+
BUG FIXES:
|
27
|
+
- Fixed warning messages with Vagrant v2.0.1
|
28
|
+
[[GH-311](https://github.com/Parallels/vagrant-parallels/issues/311)]
|
29
|
+
|
30
|
+
## 1.7.7 (October 15, 2017)
|
31
|
+
BUG FIXES:
|
32
|
+
- Fixed synced folder mounting on guests with Upstart (Ubuntu 14.*)
|
33
|
+
[[GH-307](https://github.com/Parallels/vagrant-parallels/issues/307)]
|
34
|
+
|
35
|
+
|
36
|
+
## 1.7.6 (July 31, 2017)
|
37
|
+
BUG FIXES:
|
38
|
+
- Fixed `vagrant up` failure if the box image was automatically renamed due
|
39
|
+
to the name conflict.
|
40
|
+
[[GH-303](https://github.com/Parallels/vagrant-parallels/issues/303)]
|
41
|
+
|
42
|
+
|
1
43
|
## 1.7.5 (May 27, 2017)
|
2
44
|
BUG FIXES:
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
45
|
+
- Fixed compatibility with Vagrant v1.9.5+. `nokogiri` gem is defined as
|
46
|
+
a plugin runtime dependency.
|
47
|
+
[[GH-297](https://github.com/Parallels/vagrant-parallels/issues/297)],
|
48
|
+
[[GH-298](https://github.com/Parallels/vagrant-parallels/pull/298)]
|
49
|
+
|
50
|
+
**NB!** To use the plugin with Vagrant v1.9.5 you should (re)install it with
|
51
|
+
`NOKOGIRI_USE_SYSTEM_LIBRARIES` enabled:
|
52
|
+
```bash
|
53
|
+
$ vagrant plugin uninstall vagrant-parallels
|
54
|
+
$ NOKOGIRI_USE_SYSTEM_LIBRARIES=true vagrant plugin install vagrant-parallels
|
55
|
+
```
|
56
|
+
|
15
57
|
|
16
58
|
## 1.7.4 (April 20, 2017)
|
17
59
|
IMPROVEMENTS:
|
18
|
-
- Make start action (`"vagrant up"`) run provisioners if VM is running.
|
60
|
+
- Make start action (`"vagrant up"`) run provisioners if VM is running.
|
19
61
|
[[GH-294](https://github.com/Parallels/vagrant-parallels/pull/294)]
|
20
62
|
|
21
63
|
BUG FIXES:
|
22
|
-
- Properly handle `"paused"` VM state for up and halt actions.
|
64
|
+
- Properly handle `"paused"` VM state for up and halt actions.
|
23
65
|
[[GH-295](https://github.com/Parallels/vagrant-parallels/pull/295)]
|
24
66
|
- synced_folder: Escape special characters in Windows-specific guest paths.
|
25
|
-
[[GH-296](https://github.com/Parallels/vagrant-parallels/pull/296)]
|
26
|
-
|
67
|
+
[[GH-296](https://github.com/Parallels/vagrant-parallels/pull/296)]
|
68
|
+
|
27
69
|
|
28
70
|
## 1.7.3 (February 28, 2017)
|
29
71
|
BUG FIXES:
|
30
|
-
- Fix exceptions related to `nokogiri` gem.
|
72
|
+
- Fix exceptions related to `nokogiri` gem.
|
31
73
|
[[GH-291](https://github.com/Parallels/vagrant-parallels/issues/291)],
|
32
74
|
[[GH-292](https://github.com/Parallels/vagrant-parallels/issues/292)]
|
33
75
|
|
@@ -40,28 +82,28 @@ BUG FIXES:
|
|
40
82
|
|
41
83
|
## 1.7.1 (December 7, 2016)
|
42
84
|
FEATURES:
|
43
|
-
- **Guest capability for installing Parallels Tools in Windows.** Now it is
|
85
|
+
- **Guest capability for installing Parallels Tools in Windows.** Now it is
|
44
86
|
possible to install/upgrade Parallels Tools in Windows guests using
|
45
87
|
the provider option `update_guest_tools`. [[GH-284](https://github.com/Parallels/vagrant-parallels/pull/284)]
|
46
|
-
|
88
|
+
|
47
89
|
BUG FIXES:
|
48
90
|
- Fix issues of auto-updating Parallels Tools in Linux guests with Parallels Desktop 12+.
|
49
91
|
[[GH-283](https://github.com/Parallels/vagrant-parallels/pull/283)],
|
50
92
|
[[GH-282](https://github.com/Parallels/vagrant-parallels/pull/282)],
|
51
93
|
[[GH-281](https://github.com/Parallels/vagrant-parallels/pull/281)]
|
52
|
-
|
94
|
+
|
53
95
|
|
54
96
|
## 1.7.0 (November 15, 2016)
|
55
97
|
BREAKING CHANGES:
|
56
|
-
- **Dropped support of Parallels Desktop 8 and 9**. These versions have
|
57
|
-
reached their [End-of-Life and End-of-Support](
|
98
|
+
- **Dropped support of Parallels Desktop 8 and 9**. These versions have
|
99
|
+
reached their [End-of-Life and End-of-Support](https://kb.parallels.com/eu/122533).
|
58
100
|
- **Removed customization options, which were previously deprecated:** [[GH-271](https://github.com/Parallels/vagrant-parallels/pull/271)]
|
59
101
|
- "use_linked_clone" - use `linked_clone` instead.
|
60
102
|
- "regen_box_uuid" - use `regen_src_uuid` instead.
|
61
|
-
- "optimize_power_consumption".
|
62
|
-
|
103
|
+
- "optimize_power_consumption".
|
104
|
+
|
63
105
|
FEATURES:
|
64
|
-
- **IPv6 Private Networks:** Private networking now supports IPv6.
|
106
|
+
- **IPv6 Private Networks:** Private networking now supports IPv6.
|
65
107
|
This only works with Parallels Desktop 12 and higher.
|
66
108
|
[[GH-273](https://github.com/Parallels/vagrant-parallels/pull/273)]
|
67
109
|
|
@@ -76,23 +118,23 @@ DEPRECATIONS:
|
|
76
118
|
[[GH-260](https://github.com/Parallels/vagrant-parallels/pull/260)]
|
77
119
|
|
78
120
|
IMPROVEMENTS:
|
79
|
-
- Allow to package linked clones with `vagrant package`. External disk images
|
80
|
-
will be automatically copied, so the resulted box become a full-sized
|
121
|
+
- Allow to package linked clones with `vagrant package`. External disk images
|
122
|
+
will be automatically copied, so the resulted box become a full-sized
|
81
123
|
standalone VM. [[GH-262](https://github.com/Parallels/vagrant-parallels/pull/262)]
|
82
124
|
- Handle the situation when host machine is not connected to Shared network.
|
83
125
|
With Parallels Desktop 11.2.1+ Vagrant will connect it automatically. With earlier
|
84
|
-
versions, the human-readable error message will be displayed.
|
126
|
+
versions, the human-readable error message will be displayed.
|
85
127
|
[[GH-266](https://github.com/Parallels/vagrant-parallels/pull/266)]
|
86
|
-
- Disable home folder sharing by default (Parallels Desktop 11+).
|
128
|
+
- Disable home folder sharing by default (Parallels Desktop 11+).
|
87
129
|
[[GH-257](https://github.com/Parallels/vagrant-parallels/pull/257)]
|
88
130
|
|
89
131
|
BUG FIXES:
|
90
132
|
- action/box_unregister: Fix `#recover` method for layered environments.
|
91
133
|
[[GH-261](https://github.com/Parallels/vagrant-parallels/pull/261)]
|
92
|
-
- action/network: Fix an exception when option "Connect Mac to
|
134
|
+
- action/network: Fix an exception when option "Connect Mac to
|
93
135
|
this network" is disabled. [[GH-268](https://github.com/Parallels/vagrant-parallels/pull/268)]
|
94
|
-
- commands/snapshot: Add retries for snapshot commands to avoid `prlctl`
|
95
|
-
failures. [[GH-259](https://github.com/Parallels/vagrant-parallels/pull/259)]
|
136
|
+
- commands/snapshot: Add retries for snapshot commands to avoid `prlctl`
|
137
|
+
failures. [[GH-259](https://github.com/Parallels/vagrant-parallels/pull/259)]
|
96
138
|
|
97
139
|
|
98
140
|
## 1.6.2 (March 23, 2016)
|
@@ -101,28 +143,28 @@ BUG FIXES:
|
|
101
143
|
|
102
144
|
IMPROVEMENTS:
|
103
145
|
- action/destroy: Destroy suspended VMs without resuming
|
104
|
-
|
146
|
+
|
105
147
|
## 1.6.1 (January 13, 2016)
|
106
148
|
|
107
149
|
BUG FIXES:
|
108
|
-
- action/import: Fix `regenerate_src_uuid` option behavior in parallel run
|
150
|
+
- action/import: Fix `regenerate_src_uuid` option behavior in parallel run
|
109
151
|
[[GH-241](https://github.com/Parallels/vagrant-parallels/pull/241)]
|
110
|
-
- action/box_unregister: Use temporary lock file to prevent early unregister
|
152
|
+
- action/box_unregister: Use temporary lock file to prevent early unregister
|
111
153
|
in parallel run [[GH-244](https://github.com/Parallels/vagrant-parallels/pull/244)]
|
112
154
|
- action/network: Fix detection of the next virtual network ID [[GH-245](https://github.com/Parallels/vagrant-parallels/pull/245)]
|
113
155
|
|
114
156
|
|
115
157
|
## 1.6.0 (December 24, 2015)
|
116
158
|
BREAKING CHANGES:
|
117
|
-
|
118
|
-
- The required Vagrant version is **1.8** or higher. It is caused by changes
|
159
|
+
|
160
|
+
- The required Vagrant version is **1.8** or higher. It is caused by changes
|
119
161
|
in Vagrant plugin model.
|
120
|
-
|
162
|
+
|
121
163
|
SUPPORT FOR VAGRANT FEATURES:
|
122
164
|
|
123
|
-
- `vagrant port`: This command displays the list of forwarded ports from the
|
165
|
+
- `vagrant port`: This command displays the list of forwarded ports from the
|
124
166
|
guest to the host
|
125
|
-
- `vagrant snapshot`: This command can be used to checkpoint and restore
|
167
|
+
- `vagrant snapshot`: This command can be used to checkpoint and restore
|
126
168
|
point-in-time snapshots [[GH-228](https://github.com/Parallels/vagrant-parallels/pull/228)]
|
127
169
|
|
128
170
|
IMPROVEMENTS:
|
@@ -137,10 +179,10 @@ IMPROVEMENTS:
|
|
137
179
|
|
138
180
|
BUG FIXES:
|
139
181
|
|
140
|
-
- action/forward_ports: Add parallel-safe lock to avoid collisions of
|
182
|
+
- action/forward_ports: Add parallel-safe lock to avoid collisions of
|
141
183
|
forwarded ports in multi-machine env [[GH-226](https://github.com/Parallels/vagrant-parallels/pull/226)]
|
142
184
|
|
143
185
|
## Previous Versions
|
144
186
|
|
145
187
|
Please, refer to [Releases](https://github.com/Parallels/vagrant-parallels/releases)
|
146
|
-
page on GitHub.
|
188
|
+
page on GitHub.
|
data/README.md
CHANGED
@@ -1,37 +1,37 @@
|
|
1
1
|
# Vagrant Parallels Provider
|
2
|
-
[]
|
2
|
+
[](https://badge.fury.io/rb/vagrant-parallels)
|
3
|
+
[](https://travis-ci.org/Parallels/vagrant-parallels)
|
4
|
+
[](https://codeclimate.com/github/Parallels/vagrant-parallels)
|
5
|
+
|
6
|
+
_Vagrant Parallels Provider_ is a plugin for [Vagrant](https://www.vagrantup.com),
|
7
|
+
allowing to manage [Parallels Desktop](https://www.parallels.com/products/desktop/)
|
8
|
+
virtual machines on macOS hosts.
|
9
|
+
|
10
|
+
### Requirements
|
11
|
+
- [Vagrant v1.8](https://www.vagrantup.com) or higher
|
12
|
+
(_there are known issues with Vagrant v1.9.5
|
13
|
+
[[GH-297](https://github.com/Parallels/vagrant-parallels/issues/297#issuecomment-304458691)]
|
14
14
|
and v1.9.6 [[GH-301]](https://github.com/Parallels/vagrant-parallels/issues/301)_)
|
15
|
-
- [Parallels Desktop
|
15
|
+
- [Parallels Desktop 11 for Mac](https://www.parallels.com/products/desktop/) or higher
|
16
16
|
|
17
|
-
*Note:* Only **Pro** and **Business** editions of **Parallels Desktop for Mac**
|
18
|
-
are compatible with this Vagrant provider.
|
19
|
-
Standard edition doesn't have a command line functionality and can not be used
|
17
|
+
*Note:* Only **Pro** and **Business** editions of **Parallels Desktop for Mac**
|
18
|
+
are compatible with this Vagrant provider.
|
19
|
+
Standard edition doesn't have a full command line functionality and can not be used
|
20
20
|
with Vagrant.
|
21
21
|
|
22
22
|
## Features
|
23
|
-
The Parallels provider supports all basic Vagrant features, including
|
24
|
-
|
23
|
+
The Parallels provider supports all basic Vagrant features, including Shared Folders,
|
24
|
+
Private and Public Networking, Forwarded ports and Vagrant Share.
|
25
25
|
|
26
26
|
If you're just getting started with Vagrant, it is highly recommended that you
|
27
|
-
read the official [Vagrant documentation](
|
27
|
+
read the official [Vagrant documentation](https://docs.vagrantup.com/v2/) first.
|
28
28
|
|
29
29
|
## Installation
|
30
|
-
|
31
|
-
and [Vagrant](
|
30
|
+
Make sure that you have [Parallels Desktop for Mac](https://www.parallels.com/products/desktop/)
|
31
|
+
and [Vagrant](https://www.vagrantup.com/downloads.html) properly installed.
|
32
32
|
We recommend that you use the latest versions of these products.
|
33
33
|
|
34
|
-
|
34
|
+
Parallels provider is a plugin for Vagrant. Run this command to install it:
|
35
35
|
|
36
36
|
```
|
37
37
|
$ vagrant plugin install vagrant-parallels
|
@@ -40,24 +40,22 @@ $ vagrant plugin install vagrant-parallels
|
|
40
40
|
## Provider Documentation
|
41
41
|
|
42
42
|
More information about the Parallels provider is available in
|
43
|
-
[Vagrant Parallels Documentation](
|
43
|
+
[Vagrant Parallels Documentation](https://parallels.github.io/vagrant-parallels/docs/)
|
44
44
|
|
45
45
|
We recommend you to start from these pages:
|
46
|
-
* [Usage](
|
47
|
-
* [Getting Started](
|
48
|
-
* [Boxes](
|
46
|
+
* [Usage](https://parallels.github.io/vagrant-parallels/docs/usage.html)
|
47
|
+
* [Getting Started](https://parallels.github.io/vagrant-parallels/docs/getting-started.html)
|
48
|
+
* [Boxes](https://parallels.github.io/vagrant-parallels/docs/boxes/index.html)
|
49
49
|
|
50
50
|
## Getting Help
|
51
|
-
Having problems while using the provider? Ask your question on the official forum:
|
52
|
-
["Parallels Provider for Vagrant" forum branch](http://forum.parallels.com/forumdisplay.php?737-Parallels-Provider-for-Vagrant)
|
53
51
|
|
54
|
-
If you
|
52
|
+
If you have an issue with the Parallels provider or discover a bug,
|
55
53
|
please report it on the [Issue Tracker](https://github.com/Parallels/vagrant-parallels/issues).
|
56
54
|
|
57
55
|
## License and Authors
|
58
56
|
|
59
57
|
* Author: Youssef Shahin <yshahin@gmail.com>
|
60
58
|
* Author: Mikhail Zholobov <legal90@gmail.com>
|
61
|
-
* Copyright 2013-
|
59
|
+
* Copyright 2013-2020, Parallels International GmbH.
|
62
60
|
|
63
|
-
Vagrant Parallels Provider is open-sourced software licensed under the [MIT license](
|
61
|
+
Vagrant Parallels Provider is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
@@ -113,6 +113,7 @@ module VagrantPlugins
|
|
113
113
|
b1.use Package
|
114
114
|
b1.use Export
|
115
115
|
b1.use PackageConfigFiles
|
116
|
+
b1.use PackageVagrantfile
|
116
117
|
end
|
117
118
|
end
|
118
119
|
end
|
@@ -413,6 +414,7 @@ module VagrantPlugins
|
|
413
414
|
autoload :Network, File.expand_path('../action/network', __FILE__)
|
414
415
|
autoload :Package, File.expand_path('../action/package', __FILE__)
|
415
416
|
autoload :PackageConfigFiles, File.expand_path('../action/package_config_files', __FILE__)
|
417
|
+
autoload :PackageVagrantfile, File.expand_path('../action/package_vagrantfile', __FILE__)
|
416
418
|
autoload :PrepareCloneSnapshot, File.expand_path('../action/prepare_clone_snapshot', __FILE__)
|
417
419
|
autoload :PrepareForwardedPortCollisionParams, File.expand_path('../action/prepare_forwarded_port_collision_params', __FILE__)
|
418
420
|
autoload :PrepareNFSSettings, File.expand_path('../action/prepare_nfs_settings', __FILE__)
|
@@ -53,9 +53,9 @@ module VagrantPlugins
|
|
53
53
|
file.flush
|
54
54
|
end
|
55
55
|
|
56
|
-
# Delete the lease file if we
|
56
|
+
# Delete the lease file if we were the last who needed this box.
|
57
57
|
# Then the box image will be unregistered.
|
58
|
-
lease_file.delete if lease_file.read.chomp.to_i <=
|
58
|
+
lease_file.delete if lease_file.read.chomp.to_i <= 0
|
59
59
|
end
|
60
60
|
|
61
61
|
def unregister_box(env)
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'nokogiri'
|
2
|
-
|
3
1
|
require 'digest/md5'
|
4
2
|
|
5
3
|
module VagrantPlugins
|
@@ -21,14 +19,12 @@ module VagrantPlugins
|
|
21
19
|
@logger.info("Disabling password restrictions: #{acts.join(', ')}")
|
22
20
|
env[:machine].provider.driver.disable_password_restrictions(acts)
|
23
21
|
|
24
|
-
if env[:machine].provider_config.regen_src_uuid
|
25
|
-
&& env[:machine].provider.pd_version_satisfies?('>= 10.1.2')
|
22
|
+
if env[:machine].provider_config.regen_src_uuid
|
26
23
|
options[:regenerate_src_uuid] = true
|
27
24
|
end
|
28
25
|
|
29
26
|
# Linked clones are supported only for PD 11 and higher
|
30
|
-
if env[:machine].provider_config.linked_clone
|
31
|
-
&& env[:machine].provider.pd_version_satisfies?('>= 11')
|
27
|
+
if env[:machine].provider_config.linked_clone
|
32
28
|
# Linked clone creation should not be concurrent [GH-206]
|
33
29
|
options[:snapshot_id] = env[:clone_snapshot_id]
|
34
30
|
options[:linked] = true
|
@@ -51,12 +47,6 @@ module VagrantPlugins
|
|
51
47
|
# Flag as erroneous and return if import failed
|
52
48
|
raise Errors::VMCloneFailure if !env[:machine].id
|
53
49
|
|
54
|
-
if env[:machine].provider_config.regen_src_uuid \
|
55
|
-
&& env[:machine].provider.pd_version_satisfies?('< 10.1.2')
|
56
|
-
@logger.info('Regenerate SourceVmUuid by editing config.pvs file')
|
57
|
-
env[:machine].provider.driver.regenerate_src_uuid
|
58
|
-
end
|
59
|
-
|
60
50
|
# Remove 'Icon\r' file from VM home (bug in PD 11.0.0)
|
61
51
|
if env[:machine].provider.pd_version_satisfies?('= 11.0.0')
|
62
52
|
vm_home = env[:machine].provider.driver.read_settings.fetch('Home')
|
@@ -291,7 +291,12 @@ module VagrantPlugins
|
|
291
291
|
@env[:machine].provider.driver.read_bridged_interfaces.each do |interface|
|
292
292
|
next if interface[:status] == 'Down'
|
293
293
|
that_netaddr = IPAddr.new("#{interface[:ip]}/#{interface[:netmask]}")
|
294
|
-
|
294
|
+
if netaddr.include? that_netaddr
|
295
|
+
raise VagrantPlugins::Parallels::Errors::NetworkCollision,
|
296
|
+
hostonly_netaddr: netaddr,
|
297
|
+
bridge_netaddr: that_netaddr,
|
298
|
+
bridge_interface: interface[:name]
|
299
|
+
end
|
295
300
|
end
|
296
301
|
end
|
297
302
|
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'vagrant/util/template_renderer'
|
2
|
+
|
3
|
+
module VagrantPlugins
|
4
|
+
module Parallels
|
5
|
+
module Action
|
6
|
+
class PackageVagrantfile
|
7
|
+
# For TemplateRenderer
|
8
|
+
include Vagrant::Util
|
9
|
+
|
10
|
+
def initialize(app, env)
|
11
|
+
@app = app
|
12
|
+
end
|
13
|
+
|
14
|
+
def call(env)
|
15
|
+
@env = env
|
16
|
+
create_vagrantfile
|
17
|
+
@app.call(env)
|
18
|
+
end
|
19
|
+
|
20
|
+
# This method creates the auto-generated Vagrantfile at the root of the
|
21
|
+
# box. This Vagrantfile contains the MAC address so that the user doesn't
|
22
|
+
# have to worry about it.
|
23
|
+
def create_vagrantfile
|
24
|
+
File.open(File.join(@env["export.temp_dir"], "Vagrantfile"), "w") do |f|
|
25
|
+
f.write(TemplateRenderer.render("package_Vagrantfile", {
|
26
|
+
base_mac: @env[:machine].provider.driver.read_mac_address
|
27
|
+
}))
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -20,8 +20,7 @@ module VagrantPlugins
|
|
20
20
|
end
|
21
21
|
|
22
22
|
# If we're not doing a linked clone, snapshots don't matter
|
23
|
-
if !env[:machine].provider_config.linked_clone
|
24
|
-
|| env[:machine].provider.pd_version_satisfies?('< 11')
|
23
|
+
if !env[:machine].provider_config.linked_clone
|
25
24
|
return @app.call(env)
|
26
25
|
end
|
27
26
|
|
@@ -14,9 +14,6 @@ module VagrantPlugins
|
|
14
14
|
# helpers.
|
15
15
|
@env = env
|
16
16
|
|
17
|
-
settings = default_settings
|
18
|
-
|
19
|
-
@app.call(env) if settings.empty?
|
20
17
|
@env[:ui].info I18n.t('vagrant_parallels.actions.vm.sane_defaults.setting')
|
21
18
|
|
22
19
|
default_settings.each do |setting, value|
|
@@ -30,35 +27,23 @@ module VagrantPlugins
|
|
30
27
|
private
|
31
28
|
|
32
29
|
def default_settings
|
33
|
-
|
30
|
+
{
|
34
31
|
tools_autoupdate: 'no',
|
35
|
-
startup_view: 'same',
|
36
32
|
on_shutdown: 'close',
|
37
33
|
on_window_close: 'keep-running',
|
38
34
|
auto_share_camera: 'off',
|
39
35
|
smart_guard: 'off',
|
40
|
-
longer_battery_life: 'on'
|
41
|
-
}
|
42
|
-
|
43
|
-
return settings if @env[:machine].provider.pd_version_satisfies?('< 10.1.2')
|
44
|
-
settings.merge!(
|
36
|
+
longer_battery_life: 'on',
|
45
37
|
shared_cloud: 'off',
|
46
38
|
shared_profile: 'off',
|
47
39
|
smart_mount: 'off',
|
48
40
|
sh_app_guest_to_host: 'off',
|
49
41
|
sh_app_host_to_guest: 'off',
|
50
|
-
time_sync: 'off'
|
51
|
-
)
|
52
|
-
|
53
|
-
return settings if @env[:machine].provider.pd_version_satisfies?('< 11')
|
54
|
-
settings.merge!(
|
55
42
|
startup_view: 'headless',
|
56
43
|
time_sync: 'on',
|
57
44
|
disable_timezone_sync: 'on',
|
58
45
|
shf_host_defined: 'off'
|
59
|
-
|
60
|
-
|
61
|
-
settings
|
46
|
+
}
|
62
47
|
end
|
63
48
|
end
|
64
49
|
end
|
@@ -71,7 +71,7 @@ module VagrantPlugins
|
|
71
71
|
@functional_psf = true
|
72
72
|
end
|
73
73
|
|
74
|
-
@linked_clone =
|
74
|
+
@linked_clone = true if @linked_clone == UNSET_VALUE
|
75
75
|
@linked_clone_snapshot = nil if @linked_clone_snapshot == UNSET_VALUE
|
76
76
|
|
77
77
|
@name = nil if @name == UNSET_VALUE
|
@@ -193,14 +193,13 @@ module VagrantPlugins
|
|
193
193
|
end
|
194
194
|
end
|
195
195
|
|
196
|
-
# Deletes
|
196
|
+
# Deletes host-only networks that aren't being used by any virtual machine.
|
197
197
|
def delete_unused_host_only_networks
|
198
198
|
networks = read_virtual_networks
|
199
|
-
|
200
|
-
#
|
199
|
+
|
200
|
+
# Exclude all host-only network interfaces which were not created by vagrant provider.
|
201
201
|
networks.keep_if do |net|
|
202
|
-
net['Type'] == 'host-only' && net['
|
203
|
-
net['Bound To'].match(/^(?>vnic|Parallels Host-Only #)(\d+)$/)[1].to_i >= 2
|
202
|
+
net['Type'] == 'host-only' && net['Network ID'] =~ /^vagrant-vnet(\d+)$/
|
204
203
|
end
|
205
204
|
|
206
205
|
read_vms_info.each do |vm|
|
@@ -210,8 +209,8 @@ module VagrantPlugins
|
|
210
209
|
end
|
211
210
|
end
|
212
211
|
|
212
|
+
# Delete all unused network interfaces.
|
213
213
|
networks.each do |net|
|
214
|
-
# Delete the actual host only network interface.
|
215
214
|
execute_prlsrvctl('net', 'del', net['Network ID'])
|
216
215
|
end
|
217
216
|
end
|
@@ -496,7 +495,6 @@ module VagrantPlugins
|
|
496
495
|
#
|
497
496
|
# {
|
498
497
|
# name: 'Host-Only', # Parallels Network ID
|
499
|
-
# bound_to: 'vnic1', # interface name
|
500
498
|
# ip: '10.37.129.2', # IP address of the interface
|
501
499
|
# netmask: '255.255.255.0', # netmask associated with the interface
|
502
500
|
# status: 'Up' # status of the interface
|
@@ -519,11 +517,9 @@ module VagrantPlugins
|
|
519
517
|
}
|
520
518
|
|
521
519
|
adapter = net_info['Parallels adapter']
|
522
|
-
if adapter
|
523
|
-
|
524
|
-
iface[:
|
525
|
-
iface[:netmask] = adapter['Subnet mask'] || adapter['IPv4 subnet mask']
|
526
|
-
iface[:bound_to] = net_info['Bound To']
|
520
|
+
if adapter
|
521
|
+
iface[:ip] = adapter['IPv4 address']
|
522
|
+
iface[:netmask] = adapter['IPv4 subnet mask']
|
527
523
|
iface[:status] = 'Up'
|
528
524
|
|
529
525
|
if adapter['IPv6 address'] && adapter['IPv6 subnet mask']
|
@@ -618,11 +614,9 @@ module VagrantPlugins
|
|
618
614
|
}
|
619
615
|
adapter = net_info['Parallels adapter']
|
620
616
|
|
621
|
-
if adapter
|
622
|
-
|
623
|
-
iface[:
|
624
|
-
iface[:netmask] = adapter['Subnet mask'] || adapter['IPv4 subnet mask']
|
625
|
-
iface[:bound_to] = net_info['Bound To']
|
617
|
+
if adapter
|
618
|
+
iface[:ip] = adapter['IPv4 address']
|
619
|
+
iface[:netmask] = adapter['IPv4 subnet mask']
|
626
620
|
iface[:status] = 'Up'
|
627
621
|
end
|
628
622
|
|
@@ -724,22 +718,6 @@ module VagrantPlugins
|
|
724
718
|
vms_arr | templates_arr
|
725
719
|
end
|
726
720
|
|
727
|
-
# Regenerates 'SourceVmUuid' to avoid SMBIOS UUID collision [GH-113]
|
728
|
-
#
|
729
|
-
def regenerate_src_uuid
|
730
|
-
settings = read_settings
|
731
|
-
vm_config = File.join(settings.fetch('Home'), 'config.pvs')
|
732
|
-
|
733
|
-
# Generate and put new SourceVmUuid
|
734
|
-
xml = Nokogiri::XML(File.open(vm_config))
|
735
|
-
p = '//ParallelsVirtualMachine/Identification/SourceVmUuid'
|
736
|
-
xml.xpath(p).first.content = "{#{SecureRandom.uuid}}"
|
737
|
-
|
738
|
-
File.open(vm_config, 'w') do |f|
|
739
|
-
f.write xml.to_xml
|
740
|
-
end
|
741
|
-
end
|
742
|
-
|
743
721
|
# Registers the virtual machine
|
744
722
|
#
|
745
723
|
# @param [String] pvm_file Path to the machine image (*.pvm)
|
@@ -858,14 +836,14 @@ module VagrantPlugins
|
|
858
836
|
true
|
859
837
|
end
|
860
838
|
|
861
|
-
private
|
862
|
-
|
863
839
|
# Wraps 'execute' and returns the output of given 'prlctl' subcommand.
|
864
840
|
def execute_prlctl(*command, &block)
|
865
841
|
execute(@prlctl_path, *command, &block)
|
866
842
|
end
|
867
843
|
|
868
|
-
|
844
|
+
private
|
845
|
+
|
846
|
+
# Wraps 'execute' and returns the output of given 'prlsrvctl' subcommand.
|
869
847
|
def execute_prlsrvctl(*command, &block)
|
870
848
|
execute(@prlsrvctl_path, *command, &block)
|
871
849
|
end
|
@@ -37,26 +37,23 @@ module VagrantPlugins
|
|
37
37
|
@@version_lock.synchronize do
|
38
38
|
@@version = read_version
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
# Instantiate the proper version driver for Parallels Desktop
|
42
42
|
@logger.debug("Finding driver for Parallels Desktop version: #{@@version}")
|
43
43
|
|
44
44
|
major_ver = @@version.split('.').first.to_i
|
45
45
|
driver_klass =
|
46
46
|
case major_ver
|
47
|
-
when 1..
|
48
|
-
when 10 then PD_10
|
47
|
+
when 1..10 then raise Errors::ParallelsUnsupportedVersion
|
49
48
|
when 11 then PD_11
|
50
49
|
else PD_12
|
51
50
|
end
|
52
51
|
|
53
52
|
# Starting since PD 11 only Pro and Business editions have CLI
|
54
53
|
# functionality and can be used with Vagrant.
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
raise Errors::ParallelsUnsupportedEdition
|
59
|
-
end
|
54
|
+
edition = read_edition
|
55
|
+
if !edition || !%w(any pro business).include?(edition)
|
56
|
+
raise Errors::ParallelsUnsupportedEdition
|
60
57
|
end
|
61
58
|
|
62
59
|
@logger.info("Using Parallels driver: #{driver_klass}")
|
@@ -143,6 +140,7 @@ module VagrantPlugins
|
|
143
140
|
# * prlctl version 8.0.12345.123456
|
144
141
|
# * prlctl version 9.0.12345.123456
|
145
142
|
# * prlctl version 10.0.0 (12345) rev 123456
|
143
|
+
# * prlctl version 14.0.1 (45154)
|
146
144
|
#
|
147
145
|
# But we need exactly the first 3 numbers: "x.x.x"
|
148
146
|
output = execute(@prlctl_path, '--version')
|
@@ -2,13 +2,13 @@ require 'log4r'
|
|
2
2
|
|
3
3
|
require 'vagrant/util/platform'
|
4
4
|
|
5
|
-
require_relative '
|
5
|
+
require_relative 'base'
|
6
6
|
|
7
7
|
module VagrantPlugins
|
8
8
|
module Parallels
|
9
9
|
module Driver
|
10
10
|
# Driver for Parallels Desktop 11.
|
11
|
-
class PD_11 <
|
11
|
+
class PD_11 < Base
|
12
12
|
def initialize(uuid)
|
13
13
|
super(uuid)
|
14
14
|
|
@@ -39,6 +39,10 @@ module VagrantPlugins
|
|
39
39
|
error_key(:mac_os_x_required)
|
40
40
|
end
|
41
41
|
|
42
|
+
class NetworkCollision < VagrantParallelsError
|
43
|
+
error_key(:network_collision)
|
44
|
+
end
|
45
|
+
|
42
46
|
class NetworkInvalidAddress < VagrantParallelsError
|
43
47
|
error_key(:network_invalid_address)
|
44
48
|
end
|
@@ -104,4 +108,4 @@ module VagrantPlugins
|
|
104
108
|
end
|
105
109
|
end
|
106
110
|
end
|
107
|
-
end
|
111
|
+
end
|
@@ -80,10 +80,11 @@ module VagrantPlugins
|
|
80
80
|
end
|
81
81
|
|
82
82
|
# Emit an upstart event if we can
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
83
|
+
machine.communicate.sudo <<-EOH.gsub(/^ {10}/, "")
|
84
|
+
if command -v /sbin/init && /sbin/init 2>/dev/null --version | grep upstart; then
|
85
|
+
/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}
|
86
|
+
fi
|
87
|
+
EOH
|
87
88
|
end
|
88
89
|
|
89
90
|
def self.unmount_parallels_shared_folder(machine, guestpath, options)
|
@@ -143,7 +143,6 @@ module VagrantPlugins
|
|
143
143
|
# our drivers only when they are needed.
|
144
144
|
module Driver
|
145
145
|
autoload :Meta, File.expand_path('../driver/meta', __FILE__)
|
146
|
-
autoload :PD_10, File.expand_path('../driver/pd_10', __FILE__)
|
147
146
|
autoload :PD_11, File.expand_path('../driver/pd_11', __FILE__)
|
148
147
|
autoload :PD_12, File.expand_path('../driver/pd_12', __FILE__)
|
149
148
|
end
|
data/locales/en.yml
CHANGED
@@ -58,13 +58,21 @@ en:
|
|
58
58
|
which are not supported by "prl_fs" file system.
|
59
59
|
|
60
60
|
Invalid mount options: %{options}
|
61
|
+
network_collision: |-
|
62
|
+
The specified host network collides with a non-hostonly network!
|
63
|
+
This will cause your specified IP to be inaccessible. Please change
|
64
|
+
the IP or name of your host only network so that it no longer matches that of
|
65
|
+
a bridged or non-hostonly network.
|
66
|
+
|
67
|
+
Host-only Network Address: '%{hostonly_netaddr}'
|
68
|
+
Bridged Network '%{bridge_interface}': '%{bridge_netaddr}'
|
61
69
|
network_invalid_address: |-
|
62
70
|
Network settings specified in your Vagrantfile are invalid:
|
63
71
|
|
64
72
|
Network settings: %{options}
|
65
73
|
Error: %{error}
|
66
74
|
mac_os_x_required: |-
|
67
|
-
Parallels provider works only on
|
75
|
+
Parallels provider works only on macOS (Mac OS X) systems.
|
68
76
|
parallels_install_incomplete: |-
|
69
77
|
Parallels Desktop is complaining that the installation is incomplete.
|
70
78
|
Try to reinstall Parallels Desktop or contact Parallels support.
|
@@ -101,12 +109,12 @@ en:
|
|
101
109
|
only with Pro and Business editions of Parallels Desktop. Other editions
|
102
110
|
do not have command line functionality and can not be used with Vagrant.
|
103
111
|
|
104
|
-
Please upgrade your installation:
|
112
|
+
Please upgrade your installation: https://parallels.com/desktop
|
105
113
|
parallels_unsupported_version: |-
|
106
114
|
Vagrant has detected that you have a version of Parallels Desktop for Mac
|
107
115
|
installed that is not supported. Vagrant Parallels provider is compatible
|
108
|
-
only with Parallels Desktop
|
109
|
-
Please upgrade your installation:
|
116
|
+
only with Parallels Desktop 11 or later.
|
117
|
+
Please upgrade your installation: https://parallels.com/desktop
|
110
118
|
|
111
119
|
Note: Starting since Parallels Desktop 11 for Mac, Vagrant Parallels
|
112
120
|
provider can be only used with Pro or Business edition of Parallels
|
@@ -205,8 +213,8 @@ en:
|
|
205
213
|
check_shared_interface:
|
206
214
|
connecting: Connecting host to Shared network...
|
207
215
|
clone:
|
208
|
-
full:
|
209
|
-
linked: Creating new virtual machine as a linked clone...
|
216
|
+
full: Creating new virtual machine as a full clone of the box image...
|
217
|
+
linked: Creating new virtual machine as a linked clone of the box image...
|
210
218
|
handle_guest_tools:
|
211
219
|
cant_install: |-
|
212
220
|
Vagrant doesn't support installing Parallels Tools for the guest OS
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-parallels
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mikhail Zholobov
|
8
8
|
- Youssef Shahin
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-11-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogiri
|
@@ -31,28 +31,42 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 12.3.3
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 12.3.3
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rspec
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 3.5.0
|
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:
|
55
|
+
version: 3.5.0
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rspec-its
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.3.0
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 1.3.0
|
56
70
|
description: Enables Vagrant to manage Parallels virtual machines.
|
57
71
|
email:
|
58
72
|
- mzholobov@parallels.com
|
@@ -84,6 +98,7 @@ files:
|
|
84
98
|
- lib/vagrant-parallels/action/network.rb
|
85
99
|
- lib/vagrant-parallels/action/package.rb
|
86
100
|
- lib/vagrant-parallels/action/package_config_files.rb
|
101
|
+
- lib/vagrant-parallels/action/package_vagrantfile.rb
|
87
102
|
- lib/vagrant-parallels/action/prepare_clone_snapshot.rb
|
88
103
|
- lib/vagrant-parallels/action/prepare_forwarded_port_collision_params.rb
|
89
104
|
- lib/vagrant-parallels/action/prepare_nfs_settings.rb
|
@@ -100,7 +115,6 @@ files:
|
|
100
115
|
- lib/vagrant-parallels/config.rb
|
101
116
|
- lib/vagrant-parallels/driver/base.rb
|
102
117
|
- lib/vagrant-parallels/driver/meta.rb
|
103
|
-
- lib/vagrant-parallels/driver/pd_10.rb
|
104
118
|
- lib/vagrant-parallels/driver/pd_11.rb
|
105
119
|
- lib/vagrant-parallels/driver/pd_12.rb
|
106
120
|
- lib/vagrant-parallels/errors.rb
|
@@ -116,11 +130,11 @@ files:
|
|
116
130
|
- lib/vagrant-parallels/util/compile_forwarded_ports.rb
|
117
131
|
- lib/vagrant-parallels/version.rb
|
118
132
|
- locales/en.yml
|
119
|
-
homepage:
|
133
|
+
homepage: https://github.com/Parallels/vagrant-parallels
|
120
134
|
licenses:
|
121
135
|
- MIT
|
122
136
|
metadata: {}
|
123
|
-
post_install_message:
|
137
|
+
post_install_message:
|
124
138
|
rdoc_options: []
|
125
139
|
require_paths:
|
126
140
|
- lib
|
@@ -135,9 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
149
|
- !ruby/object:Gem::Version
|
136
150
|
version: 1.3.6
|
137
151
|
requirements: []
|
138
|
-
|
139
|
-
|
140
|
-
signing_key:
|
152
|
+
rubygems_version: 3.0.3
|
153
|
+
signing_key:
|
141
154
|
specification_version: 4
|
142
155
|
summary: Parallels provider for Vagrant.
|
143
156
|
test_files: []
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'log4r'
|
2
|
-
|
3
|
-
require 'vagrant/util/platform'
|
4
|
-
|
5
|
-
require_relative 'base'
|
6
|
-
|
7
|
-
module VagrantPlugins
|
8
|
-
module Parallels
|
9
|
-
module Driver
|
10
|
-
# Driver for Parallels Desktop 10.
|
11
|
-
class PD_10 < Base
|
12
|
-
def initialize(uuid)
|
13
|
-
super(uuid)
|
14
|
-
|
15
|
-
@logger = Log4r::Logger.new('vagrant_parallels::driver::pd_10')
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|