Hi guys,
this is the first time for me on a Google group, I'm a system engineer and I write here to ask for some help for a Server configuration. I work for a company in which pre-production server are inexistent, so I'm trying to find an useful solution for different devs groups.
I'm working on Vagrant from some days and I think to be at good point with the following configuration:
- 1 Powerful WinSrv 2012 R2 with last Virtualbox and Vagrant release installed
- Correctly packaged a personal WinSrv2012R2 box ( with correct winrm configuration ) that will be useful for different countries devs ( Spain, France... )
- Vagrant file like this:
__________________________________
Vagrant.configure(2) do |config|
config.vm.box = "WindowsSrv2012R2-from-DEVVGRITA"
config.vm.communicator = "winrm"
config.vm.boot_timeout = 600
config.vm.guest = :windows
config.winrm.username = "vagrant"
config.winrm.password = "vagrant"
config.windows.set_work_network = true
config.vm.define "devTurkey" do |dev1|
dev1.vm.network "public_network", bridge: "vmxnet3 Ethernet Adapter", ip: "192.168.79.54"
dev1.vm.host_name = "devTurkey"
dev1.vm.network "forwarded_port", guest: 5985, host: 5985, id: "winrm", auto_correct: true
end
config.vm.define "devPortugal" do |dev2|
dev2.vm.network "public_network", bridge: "vmxnet3 Ethernet Adapter", ip: "192.168.79.55"
dev2.vm.host_name = "devPortugal"
dev2.vm.network "forwarded_port", guest: 5985, host: 5985, id: "winrm", auto_correct: true
end
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", 4096]
vb.customize ["modifyvm", :id, "--cpus", 4]
vb.customize ["modifyvm", :id, "--vram", 64]
vb.customize ["setextradata", "global", "GUI/SuppressMessages", "all" ]
end
config.vm.provision "shell" do |s|
s.path = "set-defaultgateway.ps1"
end
end
__________________________________________
- The machines starts correctly, IP addr configured and powershell script correctly executed.
So, seems al ok...but...what's my problem???
When I enter with my account domain in the host server I can bring up these machines, but If I logout the server ( not disconnect ) or If I leave my work in the evening, the next days the machines are down, and I don't want this.
I thought about 2 workarounds:
1) Use Hyper-V, It's fantastic because It works like a service BUT It's really impossible to configure two network interfaces, and I need them
2) I thought about the possibility to start remotely the vagrant guest with the following script im Powershell:
_______________________________
Set-ExecutionPolicy bypass
$securepw = ConvertTo-SecureString ********* -asplaintext -force
$cred = new-object -typename System.Management.Automation.PSCredential -argument user, $securepw
Enable-WSManCredSSP -Role Client -DelegateComputer *.
domain.it -force
$allowed = @('WSMAN/*')
$key = 'hklm:\SOFTWARE\Policies\Microsoft\Windows\CredentialsDelegation'
if (!(Test-Path $key))
{
md $key
}
New-ItemProperty -Path $key -Name AllowFreshCredentialsWhenNTLMOnly -Value 1 -PropertyType Dword -Force
New-ItemProperty -Path $key -Name ConcatenateDefaults_AllowFreshNTLMOnly -Value 1 -PropertyType Dword -Force
$key = Join-Path $key 'AllowFreshCredentialsWhenNTLMOnly'
if (!(Test-Path $key))
{
md $key
}
$i = 1
$allowed | % {
# Script does not take into account existing entries in this key
New-ItemProperty -Path $key -Name $i -Value $_ -PropertyType String -Force
$i++
}
$session = New-PSSession -credential $cred -ComputerName $computer -Authentication Credssp
invoke-command -Session $session -ScriptBlock { cd c:\; vagrant up devTurkey }
________________________________
The second works but I totally lose control of the guest machine, when the script finish I cannot manage It with VBoxManage or via Vagrant, I cannot find the machine anymore.
I hope that someone can help me for this point, I'm really at the end of the configuration and any help will be appreciated.
V