DevOps Yourself:
Fast-Track Your
Windows Develop
Environment Setup

Justin James
@digitaldrummerj


Hours
Later
....






+


=

+

Hands On
Time

Creating Config Directories
c:\vagrantboxes\linux
c:\vagrantboxes\windows


Creating Linux Machine

Create VagrantFile
- Open Command Prompt
- cd \vagrantboxes\linux
- vagrant init ubuntu/trusty64


Configure Virtual Machine


-
VagantFile created in
c:\vagrantboxes\linux
- Open in text editor
Configure Virtual Box

Vagrant.configure(2) do |config|
.....
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
vb.cpus = 2
vb.name = "Workshop - Linux"
end
...Provisioning
end

Create Shell Script


- Create main.sh in
c:\vagrantboxes\linux
- Open in text editor
main.sh contents

export DEBIAN_FRONTEND=noninteractive
apt-get install git -y > /dev/null

Configure Provisioning

Vagrant.configure(2) do |config|
.....Virtualbox
config.vm.provision :shell,
path: "main.sh"
end

Start Up Box

vagrant up
Login into Box

vagrant ssh
Control Virtual Machine
Useful Vagrant Commands

vagrant reload

Need to Reboot?
vagrant halt

Need to Shutdown?
vagrant suspend
Need to Hibernate?

vagrant destroy
Done with Project?

vagrant up

Need to Box Again?
Creating Windows
Machine

Create VagrantFile
- Open Command Prompt
- cd \vagrantboxes\windows
- vagrant init opentable/win-2012r2-standard-amd64-nocm


Configure Virtual Machine


-
VagrantFile created in
c:\vagrantboxes\windows
- Open in text editor
Configure VagrantFile

Vagrant.configure(2) do |config|
config.vm.box = "opentable/win-2012r2-standard-amd64-nocm"
config.vm.boot_timeout = 600
config.vm.communicator = "winrm"
....Virtualbox Config
....Provisioning
end

Configure Virtual Box

Vagrant.configure(2) do |config|
.....
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.memory = "4096"
vb.cpus = 2
vb.name = "Workshop - Windows"
vb.customize ["modifyvm", :id, "--clipboard", "bidirectional"]
end
...Provisioning
end

Create Shell Script


- Create main.cmd in
c:\vagrantboxes\windows
- Open in text editor
main.cmd contents

@powershell -NoProfile -ExecutionPolicy Bypass -File
"%systemdrive%\vagrant\InstallChocolatey.ps1"

Create Install Chocolatey


- Create InstallChocolatey.ps1 in
c:\vagrantboxes\windows
- Open in text editor
InstallChocolatey.ps1

$ChocoInstallPath = "$env:SystemDrive\ProgramData\Chocolatey\bin"
if (!(Test-Path $ChocoInstallPath)) {
iex ((new-object net.webclient)
.DownloadString('https://chocolatey.org/install.ps1'))
}

Configure Provisioning

Vagrant.configure(2) do |config|
.....Virtualbox
config.vm.provision :shell,
path: "main.cmd"
end

Start Up Box

vagrant up
-
AWS (EC2 or VPC)
-
Azure
-
Modern.IE
Other uses for Vagrant
thank you
i'm Justin.
@digitaldrummerj - digitaldrummerj@gmail.com
http://digitaldrummerj.me
Workshop - DevOps Yourself - Fast Track Your Windows Dev Box Setup
By Justin James
Workshop - DevOps Yourself - Fast Track Your Windows Dev Box Setup
Learn how to get rid of the it works on my machine. Toss the setup manual out the window and learn how to create reproducible setups.
- 3,014