You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When vagrant is used to install Active Directory on a Windows Server. The connection will hang forever at the winrmshell Transport: negotiate step after the command Install-ADDSForest.
It seems to be an old "know bug", with workarounds, that was never reported.
Paste the provided Vagrantfile and provision.ps1 script in a folder.
Run vagrant up in the folder.
Vagrant hangs at the winrm negotiation.
Vagrantfile
# -*- mode: ruby -*-# vi: set ft=ruby :Vagrant.configure("2")do |config|
# Base box imageconfig.vm.box="StefanScherer/windows_2022"# Uncomment the two following config lines for a workaround# use the plaintext WinRM transport and force it to use basic authentication.# NB this is needed because the default negotiate transport stops working# after the domain controller is installed.# see https://groups.google.com/forum/#!topic/vagrant-up/sZantuCM0q4# config.winrm.transport = :plaintext# config.winrm.basic_auth_only = true# Provision the VMconfig.vm.provision"shell",path: "provision.ps1",privileged: falseconfig.vm.provision"shell",reboot: true# <-- this step is never reachedend
provision.ps1
# Install Active Directory Domain Servicesif ((Add-WindowsFeature AD-Domain-Services -IncludeManagementTools).Success -eq'True') {
Write-Host"[+] Installed Active Directory Domain Services."
} else {
Write-Error"[-] Failed to install Active Directory Domain Services."-Category NotInstalled
}
# Change the password of the local admin$adminPass=ConvertTo-SecureString"GrignotsForever<3"-AsPlainText -Force
$admin=Get-LocalUser-Name Administrator
$admin|Set-LocalUser-Password $adminPassWrite-Host"[+] Uptaded local admin password"# This is required to setup the Active Directory# Create a Forestif ((gwmi win32_computersystem).partofdomain -eq$true) {
Write-Host"[*] domain is already installed"
} else {
$safeModePass=ConvertTo-SecureString"GrignotsForever<3"-AsPlainText -Force
Install-ADDSForest-DomainName 'poudlard.wizard'-InstallDNS -SafeModeAdministratorPassword $safeModePass-Force -NoRebootOnCompletion
}
The text was updated successfully, but these errors were encountered:
Overview
When vagrant is used to install Active Directory on a Windows Server. The connection will hang forever at the
winrmshell Transport: negotiate
step after the commandInstall-ADDSForest
.It seems to be an old "know bug", with workarounds, that was never reported.
Debug output
https://gist.github.com/0xfalafel/1568c6da17893e4fd22f59b739fcf47a
Vagrant hangs forever at the end of the
provisioning.ps1
script.Expected behavior
The installation should continue to the next step after the provisioning script.
Actual behavior
The provisioning script never returns and hangs after the
Install-ADDSForest
powershell command.Workaround
There is a google group discussion that mention as a workaround to change the WinRM configuration:
You can add the following lines to your Vagrantfile configuration:
Reproduction information
To test it with an actual project. You can test this repository https://github.com/bitfrickler/vagrant-active-directory-2016/tree/master, and remove the lines
19:20
of theVagrantfile
.Otherwise, a minimal configuration is provided below.
Vagrant version
Host operating system
A Linux distribution based on Ubuntu 22.04.
Guest operating system
Windows 2022 server
Steps to reproduce
Vagrantfile
andprovision.ps1
script in a folder.vagrant up
in the folder.Vagrantfile
provision.ps1
The text was updated successfully, but these errors were encountered: