evanplaice / aceinfo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aceinfo Vagrant Setup

Step 1 - Provision a Windows Server 2019 Box

After installing both VirtualBox and Vagrant provision a bare Windows Server 2019 box

Vagrant.configure("2") do |config|
  # use a Windows Server 2019 Standard base box
  config.vm.box = "gusztavvargadr/windows-server"
  # set the hostname
  config.vm.hostname = "aceinfo"
  # set the local IP Address
  config.vm.network "private_network", ip: "192.168.50.4"
end

Build the VM

vagrant init

Check it with

vagrant ssh

References

Step 2 - Enable RDP (Remote Desktop Protocol)

Enable the Remote Desktop Protocol in the Windows Box

Vagrantfile

Vagrant.configure("2") do |config|
  # use RDP for communication
  config.vm.communicator = "winrm"
  # configure port forwarding for RDP
  config.vm.network "forwarded_port", guest: 3389, host: 3389

  # run the RDP configuration script
  config.vm.provision :enable_rdp, type: "shell", path: "scripts/enable-rdp.ps1"
end

Update the VM

vagrant reload --provision

Resources

Step 3 - Installing Software

This step will install the following using the Chocolatey CLI utility

  • python3
  • nginx
  • sql server 2019 (dev)
  • sql server management studio

Vagrantfile

Vagrant.configure("2") do |config|
  # run the chocolately installation script
  config.vm.provision :choco_install, type: "shell", path: "scripts/choco-install.ps1"

Update the VM

vagrant reload --provision

References

Step 4 - Configure MSSQL

This step enables MSSQLSERVER TCP access on port 1433

Vagrantfile

Vagrant.configure("2") do |config|
  # configure port forwarding for MSSQL
  config.vm.network "forwarded_port", guest: 1433, host: 1433

  # run the MSSQL configuration script
  config.vm.provision :choco_install, type: "shell", path: "scripts/choco-install.ps1"
end

Update the VM

vagrant reload --provision

Appendix A - Notes

Check if .NET is installed

get-windowsfeature net-framework*

Search and List Windows Services

Use this to ensure that the background services are installed and running

sc query [service]

nginx

sc query nginx

mssql

sc query MSSQLSERVER

Find MSSQL TCP Port

Find the PID (Process ID) in Task Manager then...

netstat -ano | findstr *PID*

Appendix B - Useful Tools

About


Languages

Language:PowerShell 100.0%