Update WSL docs page

This commit is contained in:
Chris Roberts 2018-07-06 14:07:39 -07:00
parent 2667de163b
commit 1a67b59292
1 changed files with 38 additions and 34 deletions

View File

@ -9,10 +9,10 @@ description: |-
# Vagrant and Windows Subsystem for Linux # Vagrant and Windows Subsystem for Linux
Windows has recently introduced a new feature called the Windows Subsystem Recent versions of Windows 10 now include Windows Subsystem for Linux (WSL) as
for Linux (WSL). This is a beta feature available in developer mode on recent an optional Windows feature. The WSL supports running a Linux environment
releases of Windows 10. It is important to note that this feature is still within Windows. Vagrant support for WSL is still in development and should
in _beta_ on Windows, and Vagrant support should be considered _alpha_. be considered _beta_.
<div class="alert alert-warning"> <div class="alert alert-warning">
<strong>Warning: Advanced Topic!</strong> Using Vagrant within the Windows <strong>Warning: Advanced Topic!</strong> Using Vagrant within the Windows
@ -21,43 +21,38 @@ in _beta_ on Windows, and Vagrant support should be considered _alpha_.
</div> </div>
# Installation
Installation requires WSL, Ubuntu on Windows, and Vagrant. Read on for installation
instructions for each item.
## Windows Subsystem for Linux and Ubuntu on Windows
First install the Windows Subsystem for Linux, followed by Ubuntu on Windows. This guide
from Microsoft walks through the process:
* https://msdn.microsoft.com/en-us/commandline/wsl/install_guide
## Vagrant Installation ## Vagrant Installation
Vagrant _must_ be installed within Ubuntu on Windows. Even though the `vagrant.exe` Vagrant _must_ be installed within the Linux distribution used with WSL. While
file can be executed from within the WSL, it will not function as expected. To the `vagrant.exe` executable provided by the Vagrant Windows installation is
install Vagrant into the WSL, follow these steps: accessible from within the WSL, it will not function as expected.
* Download the 64-bit Debian package from the downloads page. Download the installer package for the Linux distribution from the releases
* Open a `cmd` or `powershell` window page and install Vagrant.
* Enter the command: `bash`
* Install vagrant: `sudo dpkg -i vagrant_VERSION_x86_64.deb`
``` __NOTE: When Vagrant is installed on the Windows system the version installed
C:\Users\vagrant> bash within the Linux distribution *must* match._
vagrant@vagrant-10:/mnt/c/Users/vagrant$ sudo dpkg -i vagrant_VERSION_x86_64.deb
[sudo] password for vagrant:
(Reading database ... 31885 files and directories currently installed.)
Preparing to unpack vagrant_VERSION_x86_64.deb ...
Unpacking vagrant (1:VERSION) ...
Setting up vagrant (1:VERSION) ...
vagrant@vagrant-10:/mnt/c/Users/vagrant$ vagrant help
Usage: vagrant [options] <command> [<args>]
```
# Vagrant Usage # Vagrant Usage
## Windows Access
By default Vagrant will not access features available on the Windows system
from within the WSL. This means the VirtualBox and Hyper-V providers will
not be available. To enable Windows access, which will also enable the
VirtualBox and Hyper-V providers, set the `VAGRANT_WSL_ENABLE_WINDOWS_ACCESS`
environment variable:
````
$ export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"
```
When Windows access is enabled Vagrant will automatically adjust `VAGRANT_HOME`
to be located on the Windows host. This is required to ensure `VAGRANT_HOME`
is located on a DrvFs file system.
## PATH modifications
Vagrant will detect when it is being run within the WSL and adjust how it Vagrant will detect when it is being run within the WSL and adjust how it
locates and executes third party executables. For example, when using the locates and executes third party executables. For example, when using the
VirtualBox provider Vagrant will interact with VirtualBox installed on VirtualBox provider Vagrant will interact with VirtualBox installed on
@ -71,6 +66,15 @@ For example, when using the VirtualBox provider:
export PATH="$PATH:/mnt/c/Program Files/Oracle/VirtualBox" export PATH="$PATH:/mnt/c/Program Files/Oracle/VirtualBox"
``` ```
## Synced Folders
Support for synced folders within the WSL is implementation dependent. In
most cases synced folders will not be supported when running Vagrant within
WSL on a VolFs file system. Synced folder implementations must "opt-in" to
supporting usage from VolFs file systems. To use synced folders from within
the WSL that do not support VolFs file systems, move the Vagrant project
directory to a DrvFs file system location (/mnt/c/ prefixed path for example).
## Windows Access ## Windows Access
Working within the WSL provides a layer of isolation from the actual Working within the WSL provides a layer of isolation from the actual