vagrant-vmware-desktop 3.0.0 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vagrant-vmware-desktop/action/base_mac_to_ip.rb +3 -0
  3. data/lib/vagrant-vmware-desktop/action/boot.rb +3 -0
  4. data/lib/vagrant-vmware-desktop/action/check_existing_network.rb +3 -0
  5. data/lib/vagrant-vmware-desktop/action/check_vmware.rb +3 -0
  6. data/lib/vagrant-vmware-desktop/action/checkpoint.rb +3 -0
  7. data/lib/vagrant-vmware-desktop/action/clear_shared_folders.rb +3 -0
  8. data/lib/vagrant-vmware-desktop/action/common.rb +3 -0
  9. data/lib/vagrant-vmware-desktop/action/compatibility.rb +3 -0
  10. data/lib/vagrant-vmware-desktop/action/created.rb +3 -0
  11. data/lib/vagrant-vmware-desktop/action/destroy.rb +3 -0
  12. data/lib/vagrant-vmware-desktop/action/discard_suspended_state.rb +3 -0
  13. data/lib/vagrant-vmware-desktop/action/export.rb +3 -0
  14. data/lib/vagrant-vmware-desktop/action/fix_old_machine_id.rb +3 -0
  15. data/lib/vagrant-vmware-desktop/action/forward_ports.rb +3 -0
  16. data/lib/vagrant-vmware-desktop/action/halt.rb +3 -0
  17. data/lib/vagrant-vmware-desktop/action/import.rb +3 -0
  18. data/lib/vagrant-vmware-desktop/action/machine_lock.rb +3 -0
  19. data/lib/vagrant-vmware-desktop/action/message_already_running.rb +3 -0
  20. data/lib/vagrant-vmware-desktop/action/message_not_created.rb +3 -0
  21. data/lib/vagrant-vmware-desktop/action/message_not_running.rb +3 -0
  22. data/lib/vagrant-vmware-desktop/action/network.rb +3 -0
  23. data/lib/vagrant-vmware-desktop/action/package_vagrantfile.rb +3 -0
  24. data/lib/vagrant-vmware-desktop/action/prepare_forwarded_port_collision_params.rb +3 -0
  25. data/lib/vagrant-vmware-desktop/action/prepare_nfs_settings.rb +3 -0
  26. data/lib/vagrant-vmware-desktop/action/prepare_synced_folder_cleanup.rb +3 -0
  27. data/lib/vagrant-vmware-desktop/action/prune_forwarded_ports.rb +3 -0
  28. data/lib/vagrant-vmware-desktop/action/prune_nfs_exports.rb +3 -0
  29. data/lib/vagrant-vmware-desktop/action/running.rb +3 -0
  30. data/lib/vagrant-vmware-desktop/action/set_display_name.rb +3 -0
  31. data/lib/vagrant-vmware-desktop/action/share_folders.rb +3 -0
  32. data/lib/vagrant-vmware-desktop/action/snapshot_delete.rb +3 -0
  33. data/lib/vagrant-vmware-desktop/action/snapshot_restore.rb +3 -0
  34. data/lib/vagrant-vmware-desktop/action/snapshot_save.rb +3 -0
  35. data/lib/vagrant-vmware-desktop/action/suspend.rb +3 -0
  36. data/lib/vagrant-vmware-desktop/action/suspended.rb +3 -0
  37. data/lib/vagrant-vmware-desktop/action/vmx_modify.rb +3 -0
  38. data/lib/vagrant-vmware-desktop/action/wait_for_address.rb +3 -0
  39. data/lib/vagrant-vmware-desktop/action/wait_for_communicator_compat.rb +3 -0
  40. data/lib/vagrant-vmware-desktop/action/wait_for_vmx_halt.rb +3 -0
  41. data/lib/vagrant-vmware-desktop/action.rb +3 -0
  42. data/lib/vagrant-vmware-desktop/cap/disk.rb +3 -0
  43. data/lib/vagrant-vmware-desktop/cap/provider.rb +3 -0
  44. data/lib/vagrant-vmware-desktop/cap/snapshot.rb +3 -0
  45. data/lib/vagrant-vmware-desktop/checkpoint_client.rb +3 -0
  46. data/lib/vagrant-vmware-desktop/config.rb +3 -0
  47. data/lib/vagrant-vmware-desktop/constants.rb +3 -0
  48. data/lib/vagrant-vmware-desktop/driver/base.rb +93 -11
  49. data/lib/vagrant-vmware-desktop/driver.rb +3 -0
  50. data/lib/vagrant-vmware-desktop/errors.rb +7 -0
  51. data/lib/vagrant-vmware-desktop/guest_cap/linux/mount_vmware_shared_folder.rb +3 -0
  52. data/lib/vagrant-vmware-desktop/guest_cap/linux/verify_vmware_hgfs.rb +3 -0
  53. data/lib/vagrant-vmware-desktop/helper/lock.rb +3 -0
  54. data/lib/vagrant-vmware-desktop/helper/routing_table.rb +3 -0
  55. data/lib/vagrant-vmware-desktop/helper/vagrant_utility.rb +3 -0
  56. data/lib/vagrant-vmware-desktop/plugin.rb +3 -0
  57. data/lib/vagrant-vmware-desktop/provider.rb +3 -0
  58. data/lib/vagrant-vmware-desktop/setup_plugin.rb +3 -0
  59. data/lib/vagrant-vmware-desktop/synced_folder.rb +4 -1
  60. data/lib/vagrant-vmware-desktop.rb +3 -0
  61. data/locales/en.yml +36 -8
  62. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bdcfbbb304726e177ac071a8842c567ca35ebac76acb944b8b787b4a3c8b95d6
4
- data.tar.gz: b871eaf2ccfdf8fb33384feb5c050e8b4e45daf61557158af7c23f7b57b9bf80
3
+ metadata.gz: ba545200e0b56b039bbb5f2e562b6b95bc0101cfdfc2b1b8bb7112c03d4bc163
4
+ data.tar.gz: 2f06179843c86955a7eb81170090daa184b2fb54aedf96bd13c408366fd2c819
5
5
  SHA512:
6
- metadata.gz: 6efa97edc063503dfa6d858160a23d57e0ff73f66cf4f09b9bc16027b9f2fc1000c41536ab9dd16c24e69b417cc9d17c1fec26d6dec6e3ecb37e94af701c64c7
7
- data.tar.gz: ae05d94217266dedfb30bdbc392c05ec67a97f1604c17c51810b2cc8df1ae71af1b2e39246b9dcb41373826147b4ef2b286d8d28c4ad00d111ab7ecff588e6b8
6
+ metadata.gz: b3c33c80806c0519d5f104456efe882e2d8d81d3392b1c36b9e3c23d4bd3344779a629c0f03e3654406af12ac7e9db0d00803253e7d2f4373bd63e8c493811a0
7
+ data.tar.gz: 3118c1fad9e990dd7fc81d0ebf2f7be35c5ac8dd1afe6e550c060488495e71d820b4a916a56ca2235e468e76f8d07444c6200015109bb5af157cd9270140072f
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
  require "ipaddr"
3
6
 
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  require "vagrant-vmware-desktop/helper/lock"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "json"
2
5
  require "set"
3
6
 
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "pathname"
2
5
  require "securerandom"
3
6
 
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "vagrant/action/builtin/lock"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "set"
2
5
 
3
6
  require "log4r"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require 'vagrant/util/template_renderer'
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  require "vagrant-vmware-desktop/helper/lock"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  require "vagrant/util/scoped_hash_override"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Action
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "pathname"
2
5
 
3
6
  require "vagrant/action/builder"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "vagrant/util/experimental"
2
5
  require "vagrant/util/numeric"
3
6
 
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "json"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Cap
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
  require "singleton"
3
6
  require "vagrant-vmware-desktop/config"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "vagrant"
2
5
  require "ipaddr"
3
6
 
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  version_text_path = File.expand_path(File.join(__dir__, "../../versions/desktop.txt"))
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "fileutils"
2
5
  require "ipaddr"
3
6
  require "pathname"
@@ -18,9 +21,16 @@ module HashiCorp
18
21
  # some shared common helpers.
19
22
  class Base
20
23
 
24
+ SOURCE_VMXPATH_FILE_NAME = "source-vmx"
25
+ SOURCE_SNAPSHOT_FILE_NAME = "source-snapshot"
26
+
21
27
  # Default NAT device when detection is unavailable
22
28
  DEFAULT_NAT_DEVICE = "vmnet8".freeze
23
29
 
30
+ # Default NIC device when setting up network
31
+ DEFAULT_NIC_DEVICE="e1000e".freeze
32
+
33
+ # Number of bytes in disk sector
24
34
  SECTOR_TO_BYTES = 512.freeze
25
35
 
26
36
  # Vagrant utility version requirement which must be satisfied to properly
@@ -170,6 +180,29 @@ module HashiCorp
170
180
  end
171
181
  end
172
182
 
183
+ # Product type value used by vmrun based on platform and license
184
+ #
185
+ # @return [String] fusion, ws, or player
186
+ def product_type
187
+ return @product_type if @product_type
188
+
189
+ # If the license is standard, the type is player
190
+ if standard?
191
+ return @product_type = "player"
192
+ end
193
+
194
+ case @product_name.downcase
195
+ when "workstation"
196
+ @product_type = "ws"
197
+ when "fusion"
198
+ @product_type = "fusion"
199
+ else
200
+ @product_type = "player"
201
+ end
202
+
203
+ @product_type
204
+ end
205
+
173
206
  # @return [Boolean] using standard license
174
207
  def standard?
175
208
  !professional?
@@ -237,6 +270,13 @@ module HashiCorp
237
270
  h_port = fwd[:port]
238
271
  f_proto = fwd[:protocol].downcase.to_sym
239
272
  result[g_ip] ||= {:tcp => {}, :udp => {}}
273
+ if f_proto != :tcp && f_proto != :udp
274
+ raise Errors::PortForwardInvalidProtocol,
275
+ guest_ip: g_ip,
276
+ guest_port: g_port,
277
+ host_port: h_port,
278
+ protocol: f_proto
279
+ end
240
280
  result[g_ip][f_proto][g_port] = h_port
241
281
  end
242
282
  if ip
@@ -305,14 +345,24 @@ module HashiCorp
305
345
  linked = false
306
346
  end
307
347
 
348
+ # Sanity test
349
+ if !destination.directory?
350
+ raise Errors::CloneFolderNotFolder, path: destination.to_s
351
+ end
352
+
308
353
  if linked
309
354
  @logger.info("Cloning machine using VMware linked clones.")
310
355
  # The filename of the resulting VMX
311
356
  destination_vmx = destination.join(source_vmx.basename)
312
357
 
313
358
  begin
359
+ snap_name = destination.basename
360
+ vmrun("snapshot", host_path(source_vmx), snap_name)
314
361
  # Do a linked clone!
315
- vmrun("clone", host_path(source_vmx), host_path(destination_vmx), "linked")
362
+ vmrun("clone", host_path(source_vmx), host_path(destination_vmx), "linked", "-snapshot=#{snap_name}")
363
+ # store the snapshot name
364
+ File.write(destination.join(SOURCE_SNAPSHOT_FILE_NAME).to_s, snap_name)
365
+ File.write(destination.join(SOURCE_VMXPATH_FILE_NAME).to_s, source_vmx.to_s)
316
366
  # Common cleanup
317
367
  rescue Errors::VMRunError => e
318
368
  # Check if this version of VMware doesn't support linked clones
@@ -329,10 +379,6 @@ module HashiCorp
329
379
 
330
380
  if !destination_vmx
331
381
  @logger.info("Cloning machine using direct copy.")
332
- # Sanity test
333
- if !destination.directory?
334
- raise Errors::CloneFolderNotFolder, path: destination.to_s
335
- end
336
382
 
337
383
  # Just copy over the files within the folder of the source
338
384
  @logger.info("Cloning VM to #{destination}")
@@ -398,7 +444,26 @@ module HashiCorp
398
444
  # This deletes the VM.
399
445
  def delete
400
446
  @logger.info("Deleting VM: #{@vm_dir}")
401
- @vm_dir.rmtree
447
+ begin
448
+ snap_file = @vmx_path.parent.join(SOURCE_SNAPSHOT_FILE_NAME)
449
+ source_vmx_file = @vmx_path.parent.join(SOURCE_VMXPATH_FILE_NAME)
450
+ if snap_file.exist? && source_vmx_file.exist?
451
+ source_vmx = File.read(source_vmx_file.to_s)
452
+ snap_name = File.read(snap_file.to_s)
453
+ @logger.info("source snapshot name found, deleting snapshot (#{snap_name})")
454
+ begin
455
+ vmrun("deleteSnapshot", source_vmx, snap_name, "andDeleteChildren")
456
+ rescue Errors::VMRunError => err
457
+ # If we failed to remove the source snapshot, just log it and move on
458
+ @logger.warn("failed to remove source clone snapshot '#{snap_name}': #{err}")
459
+ end
460
+ else
461
+ @logger.debug("source snapshot information not found, ignoring")
462
+ end
463
+ @vm_dir.rmtree
464
+ rescue Errno::ENOTEMPTY
465
+ FileUtils.rm_rf(@vm_dir.to_s)
466
+ end
402
467
  end
403
468
 
404
469
  # This discards the suspended state of the machine.
@@ -781,7 +846,7 @@ module HashiCorp
781
846
 
782
847
  vmx["#{key}.present"] = "TRUE"
783
848
  vmx["#{key}.connectiontype"] = adapter[:type].to_s
784
- vmx["#{key}.virtualdev"] = "e1000"
849
+ vmx["#{key}.virtualdev"] = DEFAULT_NIC_DEVICE
785
850
 
786
851
  if adapter[:mac_address]
787
852
  vmx["#{key}.addresstype"] = "static"
@@ -835,12 +900,28 @@ module HashiCorp
835
900
 
836
901
  def snapshot_tree
837
902
  snapshots = []
903
+ snap_level = 0
838
904
  vmrun("listSnapshots", host_vmx_path, "showTree").stdout.split("\n").each do |line|
839
905
  if !line.include?("Total snapshot")
840
906
  # if the line starts with white space then it is a child
841
907
  # of the previous line
842
908
  if line.start_with?(/\s/)
843
- name = "#{snapshots.last}/#{line.gsub(/\s/, "")}"
909
+ current_level = line.count("\t")
910
+ if current_level > snap_level
911
+ name = "#{snapshots.last}/#{line.gsub(/\s/, "")}"
912
+ elsif current_level == snap_level
913
+ path = snapshots.last.split("/")
914
+ path.pop
915
+ path << line.gsub(/\s/, "")
916
+ name = path.join("/")
917
+ else
918
+ path = snapshots.last.split("/")
919
+ diff = snap_level - current_level
920
+ (0..diff).to_a.each { |i| path.pop }
921
+ path << line.gsub(/\s/, "")
922
+ name = path.join("/")
923
+ end
924
+ snap_level = current_level
844
925
  snapshots << name
845
926
  else
846
927
  snapshots << line
@@ -886,7 +967,7 @@ module HashiCorp
886
967
 
887
968
  # This is called to do any message suppression if we need to.
888
969
  def suppress_messages
889
- if PRODUCT_NAME == "fusion"
970
+ if @product_name.downcase == "fusion"
890
971
  contents = <<-DATA
891
972
  <?xml version="1.0" encoding="UTF-8"?>
892
973
  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@@ -1183,7 +1264,7 @@ module HashiCorp
1183
1264
  if VagrantVMwareDesktop.wsl?
1184
1265
  r_path = VagrantVMwareDesktop.windows_to_wsl_path(r_path)
1185
1266
  end
1186
- result = Vagrant::Util::Subprocess.execute(r_path, *command)
1267
+ result = Vagrant::Util::Subprocess.execute(r_path, *command.map(&:to_s))
1187
1268
  if result.exit_code != 0
1188
1269
  raise Errors::VMExecError,
1189
1270
  :executable => executable.to_s,
@@ -1204,7 +1285,8 @@ module HashiCorp
1204
1285
  # This executes the "vmrun" command with the given arguments.
1205
1286
  def vmrun(*command)
1206
1287
  begin
1207
- vmexec(@vmrun_path, *command)
1288
+ cmd = ["-T", product_type] + command
1289
+ vmexec(@vmrun_path, *cmd)
1208
1290
  rescue Errors::VMExecError => e
1209
1291
  raise Errors::VMRunError,
1210
1292
  :command => e.extra_data[:command],
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "vagrant/util/platform"
2
5
 
3
6
  require "vagrant-vmware-desktop/driver/base"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "vagrant"
2
5
 
3
6
  module HashiCorp
@@ -206,6 +209,10 @@ module HashiCorp
206
209
  error_key(:package_not_supported)
207
210
  end
208
211
 
212
+ class PortForwardInvalidProtocol < Base
213
+ error_key(:port_forward_invalid_protocol)
214
+ end
215
+
209
216
  class RoutingTableError < Base; end
210
217
 
211
218
  class RoutingTableCommandNotFound < RoutingTableError
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module GuestCap
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module GuestCap
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  module Helper
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "ipaddr"
2
5
 
3
6
  require "vagrant/util/platform"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
  require "net/http"
3
6
  require "net/https"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  begin
2
5
  require "vagrant"
3
6
  rescue LoadError
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "log4r"
2
5
  require "thread"
3
6
  require "vagrant"
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "vagrant-vmware-desktop/checkpoint_client"
2
5
 
3
6
  module HashiCorp
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  module HashiCorp
2
5
  module VagrantVMwareDesktop
3
6
  class SyncedFolder < Vagrant.plugin("2", :synced_folder)
@@ -54,7 +57,7 @@ module HashiCorp
54
57
  machine.ui.info I18n.t("hashicorp.vagrant_vmware_desktop.sharing_folders")
55
58
  machine.provider.driver.enable_shared_folders
56
59
  shared_folders.each do |id, data|
57
- id = id.gsub('/', machine.provider_config.shared_folder_special_char)
60
+ id = id.gsub(%r{[:\\/]}, machine.provider_config.shared_folder_special_char)
58
61
  path = data[:hostpath]
59
62
  guestpath = data[:guestpath]
60
63
 
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  require "rbconfig"
2
5
  require "pathname"
3
6
  require "fileutils"
data/locales/en.yml CHANGED
@@ -1,3 +1,6 @@
1
+ # Copyright (c) HashiCorp, Inc.
2
+ # SPDX-License-Identifier: MPL-2.0
3
+
1
4
  en:
2
5
  hashicorp:
3
6
  vagrant_vmware_desktop:
@@ -163,7 +166,9 @@ en:
163
166
  to occur across several attempts, it may indicate a problem with the
164
167
  base box being used. If this error occurs across multiple boxes, it
165
168
  may indicate a VMware configuration problem. Persistent problems can
166
- be reported to support@hashicorp.com.
169
+ be reported to:
170
+
171
+ https://github.com/hashicorp/vagrant-vmware-desktop/issues
167
172
  clone_folder_exists: |-
168
173
  The clone folder that Vagrant is attempting to use to import
169
174
  the VMware box has existed repeatedly 10 times while generating
@@ -172,7 +177,9 @@ en:
172
177
  to your system.
173
178
  clone_folder_not_folder: |-
174
179
  The clone directory given is not a directory. This is an internal
175
- error and should be reported as a bug to support@hashicorp.com.
180
+ error and should be reported as a bug to:
181
+
182
+ https://github.com/hashicorp/vagrant-vmware-desktop/issues
176
183
 
177
184
  Path: %{path}
178
185
  disk_not_created: Disk %{name} not created!
@@ -383,6 +390,20 @@ en:
383
390
  The "package" command is not supported with VMware. We recommend
384
391
  taking a look at Packer (www.packer.io) as an option for creating
385
392
  VMware images.
393
+ port_forward_invalid_protocol: |-
394
+ An invalid protocol type has been provided for a port forward
395
+ configuration. Vagrant supports port forwarding protocols values:
396
+
397
+ * udp
398
+ * tcp
399
+
400
+ Please update your port forward configuration and run the command
401
+ again. Below is the invalid port forward entry:
402
+
403
+ Guest IP: %{guest_ip}
404
+ Guest Port: %{guest_port}
405
+ Host Port: %{host_port}
406
+ Protocol: %{protocol}
386
407
  routing_table_command_not_found: |-
387
408
  The external program used to read TCP/IP routing tables in order
388
409
  to protect you against creating network collisions could not be
@@ -522,7 +543,9 @@ en:
522
543
  service key file. This error can occur if the Vagrant VMware Utility
523
544
  has not yet been installed, or if it was installed incorrectly. If
524
545
  this error persists after running the Vagrant VMware Utility installer
525
- again, please contact support at: support@hashicorp.com
546
+ again, please open a new issue at:
547
+
548
+ https://github.com/hashicorp/vagrant-vmware-desktop/issues
526
549
 
527
550
  Information about the Vagrant VMware Utility, including installation
528
551
  instruction, can be found here:
@@ -536,7 +559,9 @@ en:
536
559
  service key file. This error can occur if the Vagrant VMware Utility
537
560
  has not yet been installed, or if it was installed incorrectly. If
538
561
  this error persists after running the Vagrant VMware Utility installer
539
- again, please contact support at: support@hashicorp.com
562
+ again, please open a new issue at:
563
+
564
+ https://github.com/hashicorp/vagrant-vmware-desktop/issues
540
565
 
541
566
  Information about the Vagrant VMware Utility, including installation
542
567
  instruction, can be found here:
@@ -569,11 +594,15 @@ en:
569
594
  driver_api_request_unexpected_error: |-
570
595
  Vagrant encountered an unexpected communications error with the
571
596
  Vagrant VMware Utility driver. Please try to run the command
572
- again. If this error persists, please contact support@hashicorp.com
597
+ again. If this error persists, please open a new issue at:
598
+
599
+ https://github.com/hashicorp/vagrant-vmware-desktop/issues
573
600
  driver_api_invalid_response: |-
574
601
  Vagrant failed to properly process a result from the Vagrant VMware
575
602
  Utility driver. Please try to run the command again. If this error
576
- persists, please contact support@hashicorp.com
603
+ persists, please open a new issue at:
604
+
605
+ https://github.com/hashicorp/vagrant-vmware-desktop/issues
577
606
  driver_api_port_forward_list_error: |-
578
607
  Failed to receive list of currently used VMware port forwards. The
579
608
  reported cause for the error:
@@ -627,8 +656,7 @@ en:
627
656
  Device: %{device}
628
657
  MAC: %{mac}
629
658
  Reason: %{message}
630
- disks:
659
+ disks:
631
660
  cap:
632
661
  disks:
633
662
  floppy_not_supported: "Floppy disk configuration not yet supported. Skipping disk '%{name}'..."
634
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vagrant-vmware-desktop
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vagrant Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-09 00:00:00.000000000 Z
11
+ date: 2023-05-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Enables Vagrant to power VMware Workstation/Fusion machines.
14
14
  email: vagrant@hashicorp.com
@@ -95,7 +95,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: 1.3.6
97
97
  requirements: []
98
- rubygems_version: 3.1.6
98
+ rubyforge_project:
99
+ rubygems_version: 2.7.6
99
100
  signing_key:
100
101
  specification_version: 4
101
102
  summary: Enables Vagrant to power VMware Workstation/Fusion machines.