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
- Machine Settings - Vagrant
- Building a Disposable Windows 2016 Domain Controller in 20 Minutes with Vagrant
- Windows 2018 Server Standard Box
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
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
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
get-windowsfeature net-framework*
- [How to enable a Windows feature via Powershell - StackOverflow]](https://stackoverflow.com/a/14236507/290340)
Use this to ensure that the background services are installed and running
sc query [service]
nginx
sc query nginx
mssql
sc query MSSQLSERVER
Find the PID (Process ID) in Task Manager then...
netstat -ano | findstr *PID*