README.md 1.31 KB
Newer Older
1 2 3 4
# hyperv

This Vagrant environment can be used to spin up a Windows 10 VM to create the 2016 Hyper-V Vagrant boxes.
The VM needs about 6GByte RAM and 100 GByte disk.
Stefan Scherer's avatar
Stefan Scherer committed
5
Tested with VMware Fusion 8 and VMware Workstation 12.
6

Stefan Scherer's avatar
Stefan Scherer committed
7
## On your OSX/Windows host
8 9
### Build the Windows 10 VMware base box

Stefan Scherer's avatar
Stefan Scherer committed
10
Build the Windows 10 base box for VMware Fusion/Workstation with 100GByte disk size.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

```bash
cd ..
packer build --only=vmware-iso -var disk_size=102400 windows_10.json
vagrant box add windows_10 windows_10_vmware.box
```

### Build the Windows 10 Hyper-V environment

Now build the Vagrant environment with Hyper-V and packer in a Windows 10 VM.

```bash
cd hyperv
vagrant up --provider vmware_fusion
```

## In the Windows 10 VM
Stefan Scherer's avatar
Stefan Scherer committed
28
### Build the Windows Server 2016 Hyper-V base box
29

Stefan Scherer's avatar
Stefan Scherer committed
30 31
Now inside the Windows 10 VM create a Hyper-V external switch and then run
packer with this command
32 33 34 35 36 37

```powershell
cd C:\vagrant
packer build --only=hyperv-iso -var 'hyperv_switchname=Wifi' windows_2016_docker.iso
```

Stefan Scherer's avatar
Stefan Scherer committed
38 39
You probably have to copy the C:\vagrant folder into the VM as packer would work
on a shared folder of the host.
40

Stefan Scherer's avatar
Stefan Scherer committed
41
### Run the Hyper-V VM in Windows 10
42 43

```powershell
Stefan Scherer's avatar
Stefan Scherer committed
44
vagrant box add windows_2016_docker windows_2016_docker_hyperv.box
45 46 47 48 49
cd C:\Users\vagrant
git clone https://github.com/StefanScherer/docker-windows-box
cd docker-windows-box
vagrant up
```