With a previous article connected to Chef Kitchen: https://community.esri.com/people/TNickolai-esristaff/blog/2019/11/18/chef-test-kitchen-for-arcgis-e... we hit on the utilization of VirtualBox/Vagrant to create virtual machines quicker and test deployments via Chef. The key part of this concept is getting your own Vagrant Box to utilize with these tests. The Vagrant Box can be pre-configured with certain tools or content to allow you to have a ready to go deployment of a Virtual system to then test on with our ArcGIS on-premises software. I wanted to put together this article to give you the ability to create your own Vagrant Box following easy steps.
Download/Install Virtual Box and Vagrant:
Virtual Box: https://www.virtualbox.org/wiki/Downloads
Vagrant: https://www.vagrantup.com/downloads.html
-Follow the defaults for the installation/setup.
1.) Getting a Windows Microsoft 2019 ISO
2.) Launch Virtual Box
-Top left of the VirtualBox UI, Machine, New.
3.) Virtual Box Machine Settings.
-System:
-Storage:
The remaining configurations we can leave as default.
4.) Launch our Virtual Box machine.
5.) Preparing the VB Machine for Vagrant.
CAUTION: If the version of Guest Additions is 6.0.6, there is a bug that will cause your Virtual System to crash when syncing a folder. Pending on the version of Virtual Box downloaded, you might need to download and "insert" the proper Guest Additions: Index of http://download.virtualbox.org/virtualbox/6.1.6 (Find Guest Additions download).
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /d 0 /t REG_DWORD /f /reg:64
winrm quickconfig -q
winrm set winrm/config/winrs @{MaxMemoryPerShellMB="512"}
winrm set winrm/config @{MaxTimeoutms="1800000"}
winrm set winrm/config/service @{AllowUnencrypted="true"}
winrm set winrm/config/service/auth @{Basic="true"}
sc config WinRM start= auto
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
Once prompted, type A and hit enter to accept all changes.
Optional Steps:
Since this will essentially be a server container and remain the same with every deployment, we can take this time to install applications such as Notepad++ or different browsers, change settings, etc.
-You could also upload the installation packages for Esri software and have them ready for use (make sure you do not license the software though as the vagrant packaging process will break the license storage).
6.) Packaging our VirtualBox system for re-use.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.guest = :windows
config.vm.communicator = "winrm"
config.vm.boot_timeout = 600
config.vm.graceful_halt_timeout = 600
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
#
#config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: 'rdp', auto_correct: true
#config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct: true
config.vm.provider "virtualbox" do |vb|
#
# Customize the name of VM in VirtualBox manager UI:
vb.name = "Windows2019"
end
end
vagrant package --base Windows2019 --output E:\boxes\windows2019.box --vagrantfile E:\Vagrantfile.rb
vagrant box add E:\boxes\windows2019.box --name windows2019
At this point, we have now created a Windows 2019 vagrant box which can now be utilized with Virtual Box via Chef Kitchen and test Enterprise deployments or Desktop deployments: https://community.esri.com/people/TNickolai-esristaff/blog/2019/11/18/chef-test-kitchen-for-arcgis-e...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.