Skip to content

Instantly share code, notes, and snippets.

@landonb
Last active November 13, 2024 04:51
Show Gist options
  • Save landonb/f1639d9a2c9a764831bde51f48ea05f4 to your computer and use it in GitHub Desktop.
Save landonb/f1639d9a2c9a764831bde51f48ea05f4 to your computer and use it in GitHub Desktop.
Windows Vagrantfile example
Vagrant.configure("2") do |config|
# Other box urls: https://www.bram.us/2014/09/24/modern-ie-vagrant-boxes
config.vm.box = "modern.ie/win7-ie11"
config.vm.box_url = 'http://aka.ms/vagrant-win7-ie11'
# big timeout since windows boot is very slow
config.vm.boot_timeout = 500
# Port forward WinRM (Windows Remote Management) and RDP
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
# winrm config, uses modern.ie default user/password.
# If other credentials are used must be changed here
config.vm.communicator = "winrm"
config.winrm.host = "localhost"
config.winrm.username = "IEUser"
config.winrm.password = "Passw0rd!"
config.vm.guest = :windows
# Shared folders
config.vm.synced_folder "/home/user/Dropbox", "/Dropbox"
config.vm.provider "virtualbox" do |vb|
vb.gui = true
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--vram", "128"]
vb.customize ["modifyvm", :id, "--cpus", "2"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 10000]
vb.customize ['modifyvm', :id, '--clipboard', 'bidirectional']
vb.customize ["modifyvm", :id, "--usb", "on"]
vb.customize ["modifyvm", :id, "--usbxhci", "on"]
end
end
@dude2222
Copy link

Thank you for this - it's super helpful.

@laurobmb
Copy link

laurobmb commented Feb 9, 2022

Thank you for this - it's super helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment