geerlingguy / geerlingguy/ansible-for-devops
Appendix A - Vagrant with VirtualBox within WSL2 to run ansible-for-devops VMs
- Dominant language
- Python
- Stars
- 9.9k
- Forks
- 3.8k
- PR merge metrics
- No merged PRs in 30d
Description
I think it may finally work, but there are some caveats.
Following my work on Episode 14 of Ansible 101 (see #289), I found you have to do the following:
1. Install WSL2, and install Ubuntu in WSL2.
2. Install VirtualBox (I'm running 6.1.x).
3. _Inside WSL2/Ubuntu/Bash environment_, install Vagrant:
a. `wget https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_linux_amd64.zip`
b. `unzip vagrant_2.2.9_linux_amd64.zip`
c. `sudo mv ./vagrant /usr/local/bin/vagrant`
d. `export VAGRANT_WSL_ENABLE_WINDOWS_ACCESS="1"`
e. `vagrant --version`1
4. `cd` into a `/mnt/c` directory (like `/mnt/c/Users/jgeerling/Downloads`) and clone or otherwise put the ansible-for-devops repository contents in there.
5. `cd` into one of the ansible-for-devops example directories (e.g. `drupal`).
6. Edit the `Vagrantfile` and make sure to disable the default shared folder (add line `config.vm.synced_folder '.', '/vagrant', disabled: true`).2
7. Run `vagrant up` from that directory.
1 It seems that every time I run a `vagrant` command, the Bash terminal window is reverted to 'raster' fonts at a very tiny size, and I have to go into the window preferences to revert back to Consolas / 24 pt... Very weird.
2 There's an [issue for supporting shared folders within the WSL2 environment](https://github.com/hashicorp/vagrant/issues/11705) here. This might not be needed in the future.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading the related work in issue #289 and locating where an Appendix A or comparable setup documentation belongs in the ansible-for-devops repository. Use the documented WSL2, Ubuntu, VirtualBox, Vagrant, and example-directory steps as the source material, including the Vagrantfile shared-folder caveat. Done means the WSL2 procedure and its caveats are incorporated in the appropriate documentation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ansible, linux, ubuntu
- Domain
- devops, documentation, infrastructure
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100