Hello,
I am encountering an issue where I manually set static IP addresses for the windows vm we are provisioning and when I ssh into the newly created VM the IP addresses are different from what I am setting them to. Any help is greatly appreciated! A copy of my Vagrant file is pasted below
Vagrant.configure(“2”) do |config|
DEFINE WINDOWS VM
config.vm.communicator = “winssh”
config.ssh.insert_key = false
config.ssh.keys_only = false
config.winssh.insert_key = false
config.ssh.username = “xxx”
config.ssh.password = “xxx”
config.winssh.shell = “powershell”
config.vm.guest = :windows
config.vm.define “windows_box” do |config|
config.vm.hostname = “windows-simstim”
config.vm.box = “win10_ltsc.base.box”
config.vm.box_url = “http://xxx”
config.vm.box_check_update = false
config.winrm.password = “xxx”
config.vm.provision "file", source: "/opt/vm_staging/a56977_id_rsa.pub", destination: "C:\a56977_id_rsa.pub"
config.vm.provision "shell", inline: <<-EOC
Get-Content -Path C:\a56977_id_rsa.pub | Add-Content -Path C:\ProgramData\ssh\administrators_authorized_keys
EOC
config.vm.provision "file", source: "/opt/vm_staging/jenkins_id_rsa.pub", destination: "C:\jenkins_id_rsa.pub"
config.vm.provision "shell", inline: <<-EOC
Get-Content -Path C:\jenkins_id_rsa.pub | Add-Content -Path C:\ProgramData\ssh\administrators_authorized_keys
EOC
config.vm.network "public_network", ip: "10.162.227.51", netmask: "255.255.252.0",
:dev => "brem1",
:mode => "bridge",
:type => "bridge",
:model => "virtio"
config.vm.network "public_network", ip: "192.165.15.74", netmask: "255.255.0.0",
:dev => "brem220",
:mode => "bridge",
:type => "bridge",
:model => "virtio"
config.vm.provider :"libvirt" do |v|
v.memory = "4096"
end
end