Created
November 12, 2025 16:08
-
-
Save mmguero/57af708ac7411d7939f58e2e95288f0f to your computer and use it in GitHub Desktop.
Vagrantfile for three windows 10 boxes that can all RDP into each other
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| common_script_0 = <<-SHELL | |
| # Disable hibernation and sleep | |
| REG ADD "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power" /v HiberbootEnabled /t REG_DWORD /d "0" /f | |
| powercfg.exe -x -monitor-timeout-ac 0 | |
| powercfg.exe -x -monitor-timeout-dc 0 | |
| powercfg.exe -x -disk-timeout-ac 0 | |
| powercfg.exe -x -disk-timeout-dc 0 | |
| powercfg.exe -x -standby-timeout-ac 0 | |
| powercfg.exe -x -standby-timeout-dc 0 | |
| powercfg.exe -x -hibernate-timeout-ac 0 | |
| powercfg.exe -x -hibernate-timeout-dc 0 | |
| # Download helper script | |
| echo 'iwr -useb https://git.io/debloat|iex' > 'C:/debloat.ps1' | |
| iwr -useb 'https://raw.githubusercontent.com/mmguero/dotfiles/master/bash/development_setup_bootstrap.ps1' -outfile 'C:/development_setup_bootstrap.ps1' | |
| # --- Enable Remote Desktop (no NLA, super unsafe mmmkay) --- | |
| reg add "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f | |
| reg add "HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Terminal Server\\WinStations\\RDP-Tcp" /v UserAuthentication /t REG_DWORD /d 0 /f | |
| # Allow vagrant user to log in via RDP | |
| net localgroup "Remote Desktop Users" vagrant /add | |
| # Ensure the RDP service is set to start and is running | |
| Set-Service -Name TermService -StartupType Automatic | |
| Start-Service -Name TermService | |
| # Open RDP in the firewall for all profiles | |
| netsh advfirewall firewall set rule group="remote desktop" new enable=yes | |
| SHELL | |
| Vagrant.configure("2") do |config| | |
| config.vm.box = "peru/windows-10-enterprise-x64-eval" | |
| config.vm.communicator = "winrm" | |
| config.winrm.username = "vagrant" | |
| config.winrm.password = "vagrant" | |
| config.vm.guest = :windows | |
| config.windows.halt_timeout = 30 | |
| ["node1", "node2", "node3"].each do |hostname| | |
| config.vm.define hostname do |node| | |
| node.vm.hostname = hostname | |
| node.vm.network "private_network", type: "dhcp" | |
| node.vm.provider :libvirt do |libvirt| | |
| libvirt.cpus = 4 | |
| libvirt.disk_bus = "virtio" | |
| libvirt.driver = "kvm" | |
| libvirt.graphics_type = "spice" | |
| libvirt.machine_arch = 'x86_64' | |
| libvirt.machine_type = "q35" | |
| libvirt.memory = 8192 | |
| libvirt.nested = true | |
| libvirt.nic_model_type = "virtio" | |
| libvirt.sound_type = "ich6" | |
| libvirt.video_type = "qxl" | |
| libvirt.management_network_guest_ipv6 = 'no' | |
| libvirt.cpu_mode = 'custom' | |
| libvirt.cpu_model = 'Haswell-IBRS' | |
| libvirt.cpu_fallback = 'forbid' | |
| libvirt.cpu_feature :name => 'hypervisor', :policy => 'disable' | |
| libvirt.cpu_feature :name => 'vmx', :policy => 'require' | |
| libvirt.channel :type => 'spicevmc', :target_name => 'com.redhat.spice.0', :target_type => 'virtio' | |
| libvirt.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio' | |
| libvirt.random :model => 'random' | |
| end | |
| node.vm.provision "shell", inline: common_script_0, privileged: true, powershell_elevated_interactive: true | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment