Guest User

Untitled

a guest
Jan 19th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3.  
  4. vm_name = "asdf"
  5. vswitch_name = "xxx"
  6. data_disk_path = ""
  7. new_password = "xxx"
  8. mac_address = ""
  9. cpu_cores = 2
  10. ram_mb = 1536
  11.  
  12. Vagrant.configure("2") do |config|
  13. config.vm.provision "Copy setup files to guest",
  14. type: "file", source: "../Content", destination: "C:/Users/xxx/Vagrant"
  15.  
  16. # Standard initialization, nothing to see here. Do not modify this file.
  17. config.vm.provision "Initialize the VM", type: "shell",
  18. inline: "powershell -File C:/Users/xxx/Vagrant/Internal/Initialize-VM.ps1 -vmName \"#{vm_name}\""
  19.  
  20. config.vm.box = "xxx"
  21. config.vm.box_url = "xxx"
  22.  
  23. config.vm.guest = :windows
  24.  
  25. config.vm.provider "hyperv" do |hyperv|
  26. hyperv.vmname = vm_name
  27.  
  28. hyperv.cpus = cpu_cores
  29. hyperv.memory = ram_mb
  30.  
  31. if mac_address != ""
  32. hyperv.mac = mac_address
  33. end
  34.  
  35. # First boot can take a while, as it does the post-sysprep initialization. Just chill for a bit.
  36. hyperv.ip_address_timeout = 600
  37. end
  38.  
  39. config.vm.communicator = "winrm"
  40. # The transport we use provides encryption but not server authentication. No MITM protection, in other words.
  41. config.winrm.transport = :ssl
  42. config.winrm.ssl_peer_verification = false
  43. config.winrm.basic_auth_only = true
  44.  
  45. config.vm.network "public_network", bridge: vswitch_name
  46.  
  47. # Synced folders are not necessary and in fact, can be quite problematic.
  48. # The images may or may not support them but disable them just to be safe.
  49. config.vm.synced_folder ".", "/vagrant", disabled: true
  50.  
  51. config.winrm.username = "xxx"
  52. config.winrm.password = "xxx"
  53. end
Add Comment
Please, Sign In to add comment