Skip to content

Commit 12a0728

Browse files
author
Peter Willis
committed
Update docs
1 parent f37d528 commit 12a0728

File tree

1 file changed

+47
-22
lines changed

1 file changed

+47
-22
lines changed

README.md

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,70 @@
11
# Setting up an Ubuntu VM with Vagrant on Windows 10
22

3+
Table of Contents
4+
=================
5+
6+
* [Setting up an Ubuntu VM with Vagrant on Windows 10](#setting-up-an-ubuntu-vm-with-vagrant-on-windows-10)
7+
* [Set up an Ubuntu VM](#set-up-an-ubuntu-vm)
8+
* [1\. Install VirtualBox](#1-install-virtualbox)
9+
* [2\. Install Vagrant](#2-install-vagrant)
10+
* [3\. (optional) Install Git for Windows](#3-optional-install-git-for-windows)
11+
* [4\. Create the Vagrant box](#4-create-the-vagrant-box)
12+
* [Troubleshooting](#troubleshooting)
13+
* [Login to your Vagrant machine](#login-to-your-vagrant-machine)
14+
* [Create a new SSH key](#create-a-new-ssh-key)
15+
* [Set up GitHub Access](#set-up-github-access)
16+
* [Extras](#extras)
17+
* [Table of Contents](#table-of-contents)
18+
19+
320
## Set up an Ubuntu VM
421

5-
1. Install VirtualBox (https://www.virtualbox.org/wiki/Downloads)
6-
- Download and install the latest version of VirtualBox **6.0** (as of this writing, [version 6.0.22](https://download.virtualbox.org/virtualbox/6.0.22/VirtualBox-VirtualBox-6.0.22-137980-Win.exe)
7-
- **Do not use VirtualBox 6.1.** It causes networking issues, and it requires Intel VT-x/AMD-v to be enabled. Even if VT-x is enabled, if Hyper-v is also enabled, VirtualBox will not be able to use it. (https://forums.virtualbox.org/viewtopic.php?f=1&t=62339 https://github.com/kubernetes/minikube/issues/4587)
8-
- Follow the install and use all the defaults.
9-
- After install, open the VirtualBox GUI
10-
- Go to menu *File -> Preferences*
11-
- In the *General* tab, look for the *Default Machine Folder* setting.
12-
Set it to `C:\files\VirtualBox VMs`.
13-
This will avoid your VM being created in your user's home directory, which could cause issues later.
14-
- Now click *Extensions*.
15-
- Make sure there is no Oracle VirtualBox Extension Pack listed. If there is, select it, and click the "X" button to the right to uninstall it.
16-
The license for this Extension Pack is not free for commercial uses, and you don't need it for a basic headless Linux VM.
17-
18-
2. Install Vagrant (https://www.vagrantup.com/downloads.html)
19-
- Download and install the latest version of Vagrant for Windows (as of this writing, [version 2.2.9](https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.msi)
20-
21-
3. Open a command-line window (cmd.exe)
22-
23-
4. Run the following commands:
22+
### 1. Install VirtualBox
23+
- Download and install the latest version of VirtualBox **6.0** (as of this writing, [version 6.0.22](https://download.virtualbox.org/virtualbox/6.0.22/VirtualBox-VirtualBox-6.0.22-137980-Win.exe))
24+
- **Do not use VirtualBox 6.1.** It causes networking issues, and it requires Intel VT-x/AMD-v to be enabled. Even if VT-x is enabled, if Hyper-v is also enabled, VirtualBox will not be able to use it. (https://forums.virtualbox.org/viewtopic.php?f=1&t=62339 https://github.com/kubernetes/minikube/issues/4587)
25+
- Follow the install and use all the defaults.
26+
- After install, open the VirtualBox GUI
27+
- Go to menu *File -> Preferences*
28+
- In the *General* tab, look for the *Default Machine Folder* setting.
29+
Set it to `C:\files\VirtualBox VMs`.
30+
This will avoid your VM being created in your user's home directory, which could cause issues later.
31+
- Now click *Extensions*.
32+
- Make sure there is no Oracle VirtualBox Extension Pack listed. If there is, select it, and click the "X" button to the right to uninstall it.
33+
The license for this Extension Pack is not free for commercial uses, and you don't need it for a basic headless Linux VM.
34+
35+
### 2. Install Vagrant
36+
- Download and install the latest version of Vagrant for Windows (as of this writing, [version 2.2.9](https://releases.hashicorp.com/vagrant/2.2.9/vagrant_2.2.9_x86_64.msi))
37+
38+
### 3. (optional) Install Git for Windows
39+
- Download at https://gitforwindows.org/
40+
- This is only used to download the files in this Git repo.
41+
You can skip this step if you download each file in this repo and put them in the `devbox` folder shown in the next step.
42+
However, using Git will allow you to `git pull` any updates to this repo in the future.
43+
44+
### 4. Create the Vagrant box
45+
- Open a command-line window (`cmd.exe`) and run the following commands:
2446
```
2547
C:\Users\willis> mkdir c:\files\vagrant\devbox
2648
C:\Users\willis> cd c:\files\vagrant
2749
C:\files\vagrant> git clone https://github.com/pwillis-els/vagrant-ubuntu-windows-10.git devbox
2850
C:\files\vagrant> cd devbox
2951
C:\files\vagrant\devbox> .\vagrant_up.bat
3052
```
53+
The `vagrant_up.bat` file sets the location of your *VAGRANT_HOME* directory to `C:\files\vagrant`. Otherwise it would be created in your user's profile directory, which could cause problems later. If you're going to run more `vagrant` commands, first set the variable in your console as shown in `vagrant_up.bat`.
54+
3155
Vagrant will now create and provision your new Vagrant box. (this will take some time)
3256

3357
### Troubleshooting
34-
- If `vagrant_up.bat` fails, edit the file to add ` --debug` after `vagrant up`, to find out more information about the failure.
58+
- If `vagrant_up.bat` fails:
59+
1. Edit the file to add ` --debug` after `vagrant up`
60+
2. Run `vagrant_up.bat` again, which should provide more information about why it failed.
3561

3662
- If you get the following error:
3763
```
3864
Stderr: VBoxManage.exe: error: Call to WHvSetupPartition failed: ERROR_SUCCESS (Last=0xc000000d/87) (VERR_NEM_VM_CREATE_FAILED)
3965
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
4066
```
41-
It means VirtualBox is trying to use Hyper-V and failing. You should turn off HyperV and reboot.
67+
It may mean VirtualBox is trying to use Hyper-V and failing. You should turn off HyperV and reboot.
4268
1. Open a new `cmd.exe` console *with Administrator privileges*.
4369
2. Run the command `bcdedit /set hypervisorlaunchtype off`
4470
3. Reboot
@@ -100,4 +126,3 @@ However, it is more secure to have a password-protected key that lives only in y
100126
```
101127

102128
[1]: https://askubuntu.com/questions/41605/trouble-downloading-packages-list-due-to-a-hash-sum-mismatch-error/
103-

0 commit comments

Comments
 (0)