83 Commits

Author SHA1 Message Date
Chris Roberts
3f3777f03a
Merge pull request #9746 from chrisroberts/e-hyper-v-check
Update Windows Hyper-V check
2018-05-02 07:45:26 -07:00
Chris Roberts
a997a27b57 Update Windows Hyper-V check
Checks only if the Hyper-V hypervisor is enabled instead of all
Hyper-V features. This will allow detection where Hyper-V is in
use for things like ApplicationGuard.

Uses both Get-WindowsOptionalFeature and Get-WindowsFeature to
support check on server and non-server version.
2018-04-27 14:13:34 -07:00
Maximilian Gotter
134060d577 fix rootpath if the vagrantfile is located under the root directory 2018-04-17 07:10:41 +00:00
Chris Roberts
e4399a5724 Check Windows installed Vagrant version using --version
Using the --version flag keeps Vagrant from doing a full startup
and prevents the Vagrantfile from being parsed. This makes the
version check faster, and stops things like syntax errors within
a Vagrantfile from causing an unexpected error.

Fixes #9635
2018-04-10 08:05:23 -07:00
Chris Roberts
8ac0fedbbb Suppress errors from invalid path encoding and carry on with best effort
Fixes #9299
2018-04-04 16:09:46 -07:00
Chris Roberts
8b7e501e50 Handle pathing in lxrun generated WSL instances better. 2018-02-28 10:08:01 -08:00
Chris Roberts
5f0d16a0e9 Include support for lxrun generated install
Adds compatibility support for legacy lxrun generated WSL installation
which is a single install at a known path location. This allows earlier
versions of Windows 10 to continue working as expected while still
supporting the recent updates allowing for multiple instances.
2018-02-28 10:08:01 -08:00
Sergii Bondarenko
cc82f96618 #9298: Fix typos in comments to the code 2018-02-28 10:08:01 -08:00
Sergii Bondarenko
c5fdd47a56 #9298: Respect usernames with spaces 2018-02-28 10:08:01 -08:00
Sergii Bondarenko
a1211caa9c #9298: Add debugging messages and explanations to the code 2018-02-28 10:08:01 -08:00
Sergii Bondarenko
62740e2240 #9298: Increase stability of determination of a current WSL instance 2018-02-28 10:08:01 -08:00
Sergii Bondarenko
72664eafec #9298: Use a single-word distro name 2018-02-28 10:08:01 -08:00
Sergii Bondarenko
476981874b #9298: Compute a correct path to the current WSL instance 2018-02-28 10:08:01 -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
d422053fbc Check for vagrant.exe path before validating versions 2017-10-24 16:53:53 -07:00
Brian Cain
3c9e1c9d84 (#8954) Split out cygwin path and ensure bin exists
This commit splits out the msys2 and cygwin path functions for
expanding a path with the cygpath tool. It also ensures that the tool
itself exists when the Which class is called so that it doesn't attempt
to escape slashes on nil.
2017-09-15 10:33:04 -07:00
Chris Roberts
fcd1aee9bb Update linux host NFS capability
Add support for systemd detection and using correct method
for starting/checking host nfs service.
2017-09-06 09:54:06 -07:00
Brian Cain
b45ee4f455 (#6656) Format windows paths for ssh_config command
Prior to this commit, if the ssh-config command was invoked within
cygwin or msys2, it would show a regular windows style path for private
keys rather than a path that could be used within msys2 or cygwin. This
commit updates that behavior by converting all of the private key paths
to the proper msys2 or cygwin path if the platform is windows and the
command was invoked from one of those two shells.
2017-08-25 13:17:19 -07:00
Roman Semenov
fc1e4f7533 Fix #8901 2017-08-18 18:58:45 +03:00
Chris Roberts
954569d1fc Remove PATH based cygwin detection
Detecting cygwin via PATH contents can result in false positives
resulting in errors when using Vagrant on Windows outside of a
cygwin shell. Use environment based detection instead.
2017-07-03 14:40:27 -07:00
Chris Roberts
6de7c9b445 Only convert path if windows access is granted 2017-05-12 14:14:11 -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
10cb43b917 Use helper module to silence warnings 2017-05-08 17:03:38 -07:00
Chris Roberts
e8e38a4007 Halt Vagrant if within WSL and attempting to operate out of rootfs 2017-05-08 15:21:39 -07:00
Chris Roberts
4df4f77bf6 Match WSL installed Vagrant with Windows installed Vagrant 2017-05-08 10:21:01 -07:00
Chris Roberts
83b0c87f52 Support running Vagrant within the Windows Subsystem for Linux 2017-05-08 10:21:01 -07:00
John Rizzo
1dfc646fb3 Fixed admin test to verify that you are running in an elevated shell, not that you are in the administrators group since that is not required. 2017-05-01 15:42:06 -07:00
Chris Roberts
a8b2f78f59 Do not prefix Windows paths if UNC prefix already exists
While VirtualBox has commented that they do not support UNC remote
paths (but do for long paths) it seems that remote paths can work.
If user provides UNC path, allow it to be used as-is.

Fixes #7011
2017-04-20 16:33:38 -07:00
Luke Bakken
52e98ffdfb Improve detection of admin and hyper-v admin rights via using SIDs and powershell 2016-10-13 14:22:08 -07:00
Seth Vargo
1702584d1e Merge pull request #6765 from PeterMosmans/windows-path-fix
Fix for #6761 (fixes incomplete #6598)
2016-08-08 11:59:26 -04:00
Seth Vargo
d01ddeeb43
Check stdout instead of process output
Fixes GH-7465
2016-06-16 16:20:15 -04:00
Seth Vargo
2a230a11e2
Cache the results of common operations
This commit changes Vagrant::Util::Platform to cache the result of some
common operations. These values are highly unlikely to change over the
course of a single Vagrant run and they are only cached for that run.
2016-05-30 18:27:12 -04:00
Seth Vargo
3d2390fc94
Give a unique, prefixed name to all tempfiles
This commit basically grepped the code base for all uses of Dir.mktmpdir
and Tempfile.new/open and ensures the value is unique within the
code base and also prefixed with `vagrant-`.

Previously, most invocations of these commands simply used "vagrant",
thus making them indistinguishable when trying to identify leaks.
2016-05-28 23:22:34 -04:00
Seth Vargo
1166800b65 Use SSL and HTTPS links where appropriate 2016-01-25 13:14:54 -05:00
Peter Mosmans
4b889ee641 Fix for #6761 (fixes incomplete #6598) 2015-12-30 07:56:08 +10:00
Mitchell Hashimoto
cf4b03d701 core: do not convert drive letters to UNC paths [GH-6598] 2015-12-24 12:36:14 -08:00
Luke Bakken
57187c9f88 Add method to detect if a Windows user is a member of the "Hyper-V Administrators" group.
Modify Hyper-V provider to require a user to either be an Administrator or a member of "Hyper-V Administrators"
2015-12-10 07:04:39 -08:00
Mitchell Hashimoto
d5fa7416ff core: more heuristics for determining Cygwin 2015-11-21 11:17:36 -08:00
Mitchell Hashimoto
b6f0b498e4 core: expand Windows short paths 2015-11-20 14:49:21 -08:00
Mitchell Hashimoto
2ffbe4e6e1 core: more robust WIndows admin check [GH-5616] 2015-11-18 20:27:07 -08:00
Jean-Francois Bibeau
45e14a8dc4 UNC paths should have backslashes, not front-slashes. 2015-04-16 11:02:58 -04:00
Jean-Francois Bibeau
415837c544 moved function to platform utils, added unit test as per @sethvargo 2015-04-06 16:51:55 -04:00
Seth Vargo
d2874064f4 Use .key? instead of .has_key? 2015-01-05 18:29:01 -05:00
Ilya Vassilevsky
ad54e14d65 Encode directory names to filesystem encoding for proper comparison
Dir.entries have filesystem encoding (ANSI in Windows).
Path fragments have terminal encoding (DOS).
2014-07-08 19:01:43 +04:00
Mitchell Hashimoto
6353c765ae core: cygwin_path only uses cygpath in cygwin [GH-3804] 2014-05-17 12:07:43 -07:00
Eric Coleman
f32a865abd Properly escape path in cygwin bash check
Quick attempt at properly fixing #3304
2014-03-25 18:36:05 -04:00
Mitchell Hashimoto
04a19e05ca synced_folders/rsync: convert to proper unix-style path [GH-3086] 2014-03-09 18:22:00 -07:00
Mitchell Hashimoto
c6b07e10c9 core: Cygwin path conversion must replace slashes first 2014-03-07 22:56:47 -08:00
Mitchell Hashimoto
784a5b2e32 providers/hyperv: all sorts of tests to verify Windows/admins 2014-02-27 08:12:51 -08:00
Felix C. Stegerman
5c3555b56b Clean up temp dir used by fs_case_sensitive? 2014-01-25 04:57:52 +01:00