forked from ruzickap/packer-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile-windows.template
61 lines (54 loc) · 2.75 KB
/
Vagrantfile-windows.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Vagrant.configure("2") do |config|
config.vm.provider :libvirt do |libvirt|
libvirt.disk_bus = "virtio"
libvirt.driver = "kvm"
libvirt.graphics_type = "spice"
libvirt.nic_model_type = "virtio"
libvirt.sound_type = "ich6"
libvirt.video_type = "qxl"
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'
# Enable Hyper-V enlightments: https://blog.wikichoon.com/2014/07/enabling-hyper-v-enlightenments-with-kvm.html
libvirt.hyperv_feature :name => 'relaxed', :state => 'on'
# stimer can not be enabled because it needs clock / hypervclock (https://bugzilla.redhat.com/show_bug.cgi?id=1816670) settings which are not supported by vagrant-libvirt
# https://github.com/ruzickap/packer-templates/issues/154
# libvirt.hyperv_feature :name => 'stimer', :state => 'on'
libvirt.hyperv_feature :name => 'synic', :state => 'on'
libvirt.hyperv_feature :name => 'vapic', :state => 'on'
libvirt.hyperv_feature :name => 'vpindex', :state => 'on'
libvirt.memory = 2048
end
config.vm.provider :virtualbox do |virtualbox|
virtualbox.customize ["modifyvm", :id, "--vram", "32"]
virtualbox.customize ["modifyvm", :id, "--audioout", "on"]
virtualbox.customize ["modifyvm", :id, "--clipboard-mode", "bidirectional"]
virtualbox.gui = true
if RUBY_PLATFORM =~ /darwin/
virtualbox.customize ["modifyvm", :id, '--audio', 'coreaudio']
elsif RUBY_PLATFORM =~ /mingw|mswin|bccwin|cygwin|emx/
virtualbox.customize ["modifyvm", :id, '--audio', 'dsound']
elsif RUBY_PLATFORM =~ /linux/
virtualbox.customize ["modifyvm", :id, '--audio', 'alsa']
end
end
# Port forward for RDP
config.vm.network :forwarded_port, guest: 3389, host: 3389, id: "rdp", auto_correct:true
# Port forward for WinRM
config.vm.network :forwarded_port, guest: 5986, host: 5986, id: "winrm-ssl", auto_correct:true
config.vm.network :forwarded_port, guest: 5985, host: 5985, id: "winrm", auto_correct:true
config.vm.boot_timeout = 1000
config.vm.communicator = "winrm"
config.vm.guest = :windows
config.windows.halt_timeout = 15
config.winrm.password = "vagrant"
config.winrm.retry_limit = 30
config.winrm.username = "vagrant"
# Disable NFS sharing (==> default: Mounting NFS shared folders...)
config.vm.synced_folder ".", "/vagrant", type: "nfs", disabled: true
if Vagrant.has_plugin?("vagrant-winrm-syncedfolders")
config.vm.synced_folder ".", "/vagrant", type: "winrm"
else
config.vm.synced_folder ".", "/vagrant", disabled: true
end
end