Commit Graph

786 Commits

Author SHA1 Message Date
Brian Cain 73a5a5a8c9
(#9059) Convert to windows path if on WSL during vbox export
Prior to this commit, the incorrect path was used when determining where
to export an ovf file during the `vagrant package` step. This commit
updates that by checking if vagrant is within WSL, and if so, convert
the path to a proper windows path to be used during the export.

Fixes #9059
2018-02-27 16:02:25 -08:00
Brian Cain 0b92123163
Merge pull request #9507 from briancain/fix-hyper-v-check
Fix Hyper-v and VirtualBox check
2018-02-26 14:54:51 -08:00
Brian Cain 007e6f49aa
Merge pull request #9302 from eyJhb/master
Fixed hostonly matching not respecting :name argument
2018-02-26 14:50:45 -08:00
Brian Cain f2954a64c6
Fix Hyper-v and VirtualBox check
Prior to this commit, the hyper-v and virtualbox system crash check
existed within the initialize function of the virtualbox provider. That
caused an issue when running with other providers, because the
virtualbox provider still gets initialized even if not used. This commit
changes that by placing the check inside of one of the virtualbox
provider actions that checks if virtualbox is installed and ready to
use. This action is action is used by the main vbox provider actions,
and should not be called when other providers are being used with
Vagrant.
2018-02-23 11:24:30 -08:00
Brian Cain e8708232a5
(#9258) Exit if Hyper-V is enabled and VirtualBox provider is used
This commit adds a function on windows for the VirtualBox provider to
check if Hyper-V is enabled. If so, exit and display a warning to the
user that going forward will result in a system crash.
2018-02-08 11:20:41 -08:00
Chris Roberts 780673c6fe Add warning message for VirtualBox shared folders option.
Display warning to user about the VirtualBox SharedFoldersEnableSymlinksCreate
option with link to VirtualBox documentation and instructions on how the
setting can be disabled.
2018-01-20 06:51:59 -08:00
Chris Roberts b0fc6a06a1
Merge pull request #9294 from chrisroberts/e-smb
SMB synced folders enhancements
2018-01-12 15:02:08 -08:00
Brian Cain b16ca2e384
Introduce flag for SharedFoldersEnableSymlinksCreate
Prior to this commit, the virtualbox synced folder option
`SharedFoldersEnableSymlinksCreate` was always enabled. This commit
introduces a config option and an environment variable which allows
users to configure the option globally or per synced_folder in their
Vagrantfile.
2018-01-09 14:33:24 -08:00
Brian Cain 9c4ef88b88
Merge pull request #8863 from michaeltlombardi/FullyQualifyHyperVCmdlets
Ensure Hyper-V cmdlets are fully qualified
2018-01-04 10:27:09 -08:00
Chris Roberts 572f341697 Include synced folder cleanup action within hyperv provider 2018-01-03 10:29:45 -08:00
eyJhb 12a6832151 Fixed hostonly matching not respecting :name argument 2017-12-25 20:49:35 +01:00
Michael T Lombardi 9e1d05641f Ensure Hyper-V cmdlets are fully qualified
+ This disambuguates calls to the Hyper-V functions for the Hyper-V provider.
The ambiguity of some commands - such as `Get-VM` - causes the Hyper-V provider
to fail on systems where VMware PowerCLI is installed. This change ensures that
all calls to Hyper-V specific cmdlets or functions are prepended by `Hyper-V\`.
This ensures the correct cmdlet calls are being made.
+ Resolves  #8862.
2017-12-15 08:30:38 -06:00
Zachary Flower 4a4183398b Add a clean error message for invalid IP addresses 2017-12-14 14:57:21 -07:00
Andrew Hardy ad0a47bedf Removed rogue $ from string in hyperv import.rb 2017-12-10 11:09:49 +10:00
Chris Roberts fc7d2a3097 Merge pull request #8921 from lookfwd/fix_8608
fix for issue #8608/Windows hosts
2017-10-23 16:58:39 -07:00
Brian Cain 9d360d2b21 Merge pull request #9000 from bbrala/bug-hyperv-auto-stop-action
Auto stop action is configured wrongly
2017-10-04 09:12:09 -07:00
Brian Cain 83310f8a56 Merge pull request #8955 from jehiah/virtualbox52_8955
Virtualbox 5.2 support
2017-10-03 13:25:39 -07:00
Erik Lattimore 28a92850ab Allow synced folders to contain spaces in the guest path
It should be valid to allow paths with spaces for the synced folder
guest path but since the guest path is used to generate the ID (if one
isn't provided), this will err out in VirtualBox because it doesn't
allow spaces for the --name argument. We should simply convert ' ' to
'_' as we do with other special characters.
2017-09-29 17:24:12 -04:00
Björn Brala 0f743d0731 Auto stop action is configured through auto start action. 2017-09-26 16:03:35 +02:00
Jehiah Czebotar 7d73af5637
Virtualbox 5.2 support 2017-09-14 15:07:11 -04:00
Brian Cain 9b872c9e7e Cleanup virtualbox retryable commands
Reverting the changes done in 7d2f7dab97
because they don't work and or update vagrant to invoke running the
vbox cli tool for every single forwarded port instead of forwarding them
all in one command.
2017-09-06 11:14:11 -07:00
Samuel Clark 2e775e8101 8468 - make more virtualbox commands retryable
Issue: https://github.com/mitchellh/vagrant/issues/8468

A lot of vboxmanage commands are flakey and frequently cause
bringing multiple machines up at once to fail, especially when
the host system is under heavy load. Most commands are also safe
to retry and just result in a no-op, so we can simply add
'retryable' to a lot of existing calls. For the others we need to
do a little bit of cleanup or reevaluate the parameters before
trying again.
2017-09-06 11:14:11 -07:00
nico.vanelslande 9aecd5e1a4 Improved resilience of the VirtualBox driver delete_unused_host_only_networks function by
ignoring VMs that may have been deleted between the calls to
'vboxmanage list vms' and 'vboxmanage showvminfo'
2017-09-06 11:13:14 -07:00
nico.vanelslande 56c8b9269a Improved resilience of the VirtualBox driver read_used_ports function by
ignoring VMs that may have been deleted between the calls to
'vboxmanage list vms' and 'vboxmanage showvminfo'
2017-09-06 11:13:14 -07:00
Dimitrios Kouzis-Loukas 51716c5ef0 fix for issue 8608 2017-08-27 23:56:47 -04:00
Chris Roberts f660c19084 Error when compose and force_host_vm are enabled together 2017-08-22 11:36:26 -07:00
Chris Roberts 1c763cf5e6 Expand relative volume paths for compose on current cwd 2017-08-21 13:26:19 -07:00
Chris Roberts 3f8cbb121a Merge pull request #8837 from chrisroberts/docker-compose/links
Split compose links if string values
2017-08-21 13:21:09 -07:00
Chris Roberts 3b4901a5b5 Split compose links if string values 2017-07-31 14:23:50 -07:00
Chris Roberts 38fed54697 Update guest IP address discovery for hyper-v guests.
Powershell helper script now returns error when guest IP address
cannot be discovered. When reading addresses from a network
device both IPv4 and IPv6 are stored and the IPv4 address has
precedence on returned address.
2017-07-28 10:18:26 -07:00
Chris Roberts 4bc8cc7563 Filter any machine_ip when preparing the NFS settings
When preparing the NFS settings on VirtualBox the guest IP addresses
are pulled from VirtualBox directly and any static addresses are
pulled as well. This can lead to aquiring a host IP and machine IP
but results in a failure of NFS mount because the IPs are not on
the same network. This filters the machine IP result to validate
it is within the host adapter IP range.
2017-07-24 14:02:15 -07:00
Dimitrios Kouzis-Loukas 34d8ffb9b2 Fixing vagrant ssh issue 8705
Fixing vagrant issue https://github.com/mitchellh/vagrant/issues/8705
2017-06-21 10:23:34 -04:00
Chris Roberts 8437dccca2 Merge pull request #8678 from caveman-dick/fixWindow2012R2Issue
Fixes #8677 - Detect the result of the has_vmcx_support.ps1 properly
2017-06-19 16:51:46 -07:00
Chris Roberts c5b3751a83 Properly handle exception raised when property does not exist 2017-06-19 14:04:57 -07:00
Richard Gareau 056f837fed Do not use UNC path for Solaris guest on Windows 2017-06-15 15:15:39 -07:00
Richard Mayes 649fea13ff Detect the result of the has_vmcx_support properly
Fixes #8677
2017-06-13 18:20:48 +01:00
Harry Weppner 250e74cb79 fix check for `docker-compose` 2017-06-08 11:09:41 -07:00
Brian Cain 87b7514603 (#7188) Clean up vagrant snapshot restore/delete error messages
This commit adds some better handling around the snapshot restore and
delete commands for the virtualbox provider. If a user attempts to restore from
a vm that does not exist, instead of exiting 0 it will raise an
exception saying the virtual machine has not been created yet.
Addtionally, if a user attempts to restore from a snapshot id that does
not exist, instead of printing a complicated exception from the
virtualbox cli tool, it prints a more useful error message telling the
user that the snapshot does not exist.
2017-06-07 09:12:20 -07:00
Chris Roberts 27ca3ef831 Convert Windows paths in volumes if detected 2017-05-12 15:11:10 -07:00
Chris Roberts 36ecd40c52 Support optional detach and pass blocks through to execution. 2017-05-12 15:09:30 -07:00
Chris Roberts 6096bb299b Only set image if option given. Do not apply when setting build options. 2017-05-12 15:09:30 -07:00
Chris Roberts 42c9042221 Deep merge configuration settings and set any extra options 2017-05-12 15:09:30 -07:00
Chris Roberts 9242a69545 Allow direct set of composition and ensure basic types are used 2017-05-12 15:09:30 -07:00
Chris Roberts 4673bbb907 Properly define service build within composition. Full cleanup on destroy. 2017-05-12 15:09:30 -07:00
Chris Roberts b333e5cd82 Fix argument construction when adding dockerfile path
Fixes #7914
2017-05-12 15:09:30 -07:00
Chris Roberts d1c1c175a0 Support modifications of composition outside services 2017-05-12 15:09:30 -07:00
Chris Roberts d4bfade19f Include documentation on accessor in docker provider configuration 2017-05-12 15:09:30 -07:00
Chris Roberts deba93ce5c Add optional support for docker-compose
Adds configuration switch to enable using docker-compose
to create and manage docker containers.
2017-05-12 15:09:30 -07:00
Chris Roberts 5d83c03bfc Properly handle synced folders in docker provider on WSL 2017-05-12 14:05:12 -07:00
Chris Roberts 3c44ce9742 Support vbox provider within WSL rootfs. Make Windows access easier.
Enables proper setup of VMs started from within WSL rootfs paths. Updates
setup for Windows access when working within the WSL to auto-detect settings
instead of relying on user defined environment variables.
2017-05-12 13:11:53 -07:00
Chris Roberts 83b0c87f52 Support running Vagrant within the Windows Subsystem for Linux 2017-05-08 10:21:01 -07:00
Chris Roberts 8062b4f61f Merge pull request #8568 from chrisroberts/fix/hyperv-import
Update conditional check to use string equality
2017-05-08 10:17:35 -07:00
Chris Roberts ffc6e3e282 Merge pull request #8566 from chrisroberts/fix/docker-ssh
Fall back to old style ssh info lookup in docker provider
2017-05-08 10:14:51 -07:00
Chris Roberts 9452e7cc38 Update conditional check to use equality check
Fixes #8444
2017-05-05 14:07:52 -07:00
Chris Roberts 88dfe18a3f Fall back to old style ssh info lookup in docker provider
If ssh information cannot be properly extracted from within
the NetworkSettings data, fallback to original ssh information
implementation

Fixes #8552
2017-05-05 14:02:05 -07:00
Chris Roberts e5e0274ef5 Update hyperv and docker providers to raise exception on SSH when machine is not ready
This makes the behavior of the docker and hyperv provider consistent with the
virtualbox provider by raising an error on ssh actions if the machine is not
created or not running.

Fixes #8508
2017-05-05 14:01:12 -07:00
Chris Roberts 023a23403a Merge pull request #8433 from legal90/fix-os-friendly-name
virtualbox: Fix invalid share names in Windows guests
2017-05-01 15:49:13 -07:00
Arjan Weurding 399789467a Fix crash when using HyperV
Fix the error 
```homestead-7: Creating and registering the VM...
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: import_vm_vmcx.ps1
Error:

At C:\Program Files
(x86)\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.4\plugins\providers\hyper                    v\scripts\import_vm_vmcx.ps1:18 char:37
+     [string]$differencing_disk=$null
+                                     ~
Missing ')' in function parameter list.
At C:\Program Files
(x86)\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.4\plugins\providers\hyper                    v\scripts\import_vm_vmcx.ps1:20 char:1
+ )
+ ~
Unexpected token ')' in expression or statement.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingEndParenthesisInFunctionParameterList
```
2017-04-26 08:15:06 -07:00
Chris Roberts 05b6cdab6c Do not force docker host VM on Darwin or Windows 2017-04-03 14:48:14 -07:00
Chris Roberts 74ad90d8e0 Merge pull request #7840 from pstengel/bugfix/7651
Do better at finding ssh_info for Docker
2017-04-03 14:41:50 -07:00
Mikhail Zholobov 3c44ab7cf2
Escape backward slashes in vbox share name
That fixes invalid share names in Windows guests, where backward slash character is
used as a path separator.
2017-04-02 13:05:23 +02:00
Bjorn Brala 2f7e0d3a1f Virtualization extensions wern't enabled for vmcx file format, so it didn't work for Windows 10 and up. Fixes #8402 2017-03-23 07:54:41 +01:00
Bjorn Brala 0534ebf895 Merge remote-tracking branch 'mitchellh/master' into feature-hyperv-integration-services-fresh
# Conflicts:
#	plugins/providers/hyperv/action/import.rb
#	plugins/providers/hyperv/config.rb
#	website/source/docs/hyperv/configuration.html.md
2017-03-23 07:49:57 +01:00
Chris Roberts a0761eb2ea Allow initialization argument to be used in parent 2017-03-19 07:35:46 -07:00
Chris Roberts 1c1adcad9a Merge pull request #8325 from chrisroberts/enhancement/nested-hyperv
Nested Hyper-V
2017-03-17 14:19:58 -07:00
Bjorn Brala e2dd23b06c First implementation for Integration services for Hyper-V as discussed in https://github.com/mitchellh/vagrant/pull/6321 #6321 2017-03-15 22:12:19 +01:00
Björn Brala 765494a2bf Add configuration to HyperV config 2017-03-15 18:09:18 +01:00
Chris Roberts 6f578590a9 Skip forwarded port if disabled in docker provider 2017-03-09 10:28:41 -08:00
Chris Roberts edd8a10b29 Merge pull request #8326 from chrisroberts/refactor/vbox-5.1
Refactor the virtualbox 5.1 driver implementation
2017-03-06 08:36:17 -08:00
Chris Roberts 6d3ab39b27 Merge pull request #7035 from pravinchandar/4608
Fix for #4608: Support for port forwarding in an IP aliased environment
2017-03-03 15:57:04 -08:00
Chris Roberts 98c50ee1c8 Refactor the virtualbox 5.1 driver implementation 2017-03-02 14:42:37 -08:00
Patrick Lang 8cf2240383 Finish hooking up hv.enable_virtualization_extensions 2017-03-02 14:06:39 -08:00
Patrick Lang 6900fc3904 Starting support for Hyper-V nested virtualization 2017-03-02 14:06:21 -08:00
Paul Stengel d98c5b8c00 Do better at finding ssh_info for Docker 2017-01-05 17:41:39 -05:00
Bjorn Brala f808f74009 Harden VMCX support. Vagrant now checks if your Windows version has support for vmcx and then uses the VMCX file. 2016-12-14 15:14:56 +01:00
Chris Roberts 23c41f4461 Merge pull request #7867 from bbrala/hyperv-package
Package Hyper-V boxes
2016-12-07 13:37:47 -08:00
Bjorn Brala 10181f7c8a When you set the memory of a HyperV machine to something lower than the original range it fails. 2016-11-23 08:39:49 +01:00
Chris Roberts 1b04d3da26 Merge pull request #7854 from bbrala/import-vmcx-script
Add support for vmcx (Hyper-V binary config format) to the Hyper-V import script
2016-11-14 13:50:07 -08:00
Bjorn Brala 37a525fbbc Little bit of cleanup. 2016-10-20 22:43:00 +02:00
Bjorn Brala e6093dd709 The virtual machine doesnt need 'Virtual Machines' in its path, this is created when importing. 2016-10-19 21:03:48 +02:00
Bjorn Brala c075c026be Keyboard language setting made my comment bad 2016-10-19 20:56:52 +02:00
Bjorn Brala 055bed5918 removed an extra echo and added proper error message when there is incompatibilities. Appearantly importing into a compressed folder wont work and will result in an error. 2016-10-19 20:55:56 +02:00
Brian Retford 418064519d Move dynamic memory settings into conditional block 2016-10-14 18:53:44 -07:00
Jake Ballard 803fff7f03 Fix issue with missing slash in paths
It was failing to create files below the machines\default\hyperv folder, rather it was creating folders named 'hypervSnapshots', 'hypervVirtual Hard Disks', and 'hypervVirtual Machines'. This was causing the files to not be removed when destroying the vm, and an error when subsequently bringing it up again.
2016-10-11 15:31:28 -05:00
Bjorn Brala 42efd5c198 Make the Virtual Hard Disks directory if importing from XML to keep it consistant across config types 2016-10-09 21:10:56 +02:00
Bjorn Brala 8744caebcf Small typo in options 2016-10-09 20:39:17 +02:00
Bjorn Brala 7b03bf335b Whitespace 2016-10-08 16:44:24 +02:00
Bjorn Brala debe50957b Refactor the import script to fully use Compare-VM for creating the new VM.
Implemented the differencing disk for vmcx.
This means the disk is now copied by Hyper-V (Powershell) instead of Ruby for new machines.
This does mean EFI Firmware now does work for machines since it is quite a feep copy. Compare-VM will report incompatibilities should they be found.
2016-10-08 16:38:42 +02:00
Bjorn Brala a77da314e5 Only check for .vmcx if there is no XML found to not risk breaking older vagrant boxes that added an XML file manually 2016-10-07 20:38:05 +02:00
Björn Brala 6ed612e93b Move package_setup_files to general lib to minimize code duplication 2016-10-07 17:31:15 +02:00
Björn Brala a4d41d0a0e Move code for set-folders for packing VirtualBox to general 2016-10-06 15:07:13 +02:00
Bjorn Brala 5877e8fe22 Sart refactor duplicate classes 2016-10-06 08:55:59 +02:00
Bjorn Brala 8619267cd9 Fix getting mac address from the driver. 2016-10-06 08:29:05 +02:00
Bjorn Brala 5d0de9486e Remove some logging from the package action. 2016-10-06 08:28:52 +02:00
Theron Boerner 391c5be08e Remove --interactive flag from Docker command
See: GH-7597. Due to the childprocess gem setting STDIN to a pipe,
Docker will fail as it requires STDIN to be a TTY if run with
--interactive.
2016-10-05 14:38:20 -05:00
Bjorn Brala 0970a5a67b Generate metadata.json in root of package. 2016-10-05 14:42:46 +02:00
Bjorn Brala be2e9e79aa FIrst draft of packaging of Hyper-V boxes. Need to refactor the package_* files since right now they are copies of the virtualbox versions, might just put them in general. 2016-10-05 13:48:48 +02:00
Bjorn Brala 133e2a7b0f Broke Path argument in mini refactor. 2016-10-04 20:06:10 +02:00
Bjorn Brala 2fc93277fd change argument to vm_config_file so it isn't the same as variable in powershell script. 2016-10-02 18:45:51 +02:00
Bjorn Brala 1ec1cf8177 Update Hyper-V import command and the driver to check for configuration type and call the correct import script. 2016-10-02 16:10:58 +02:00