diff --git a/.gitignore b/.gitignore index a93a88e..edc90be 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ resources/drivers/ *.DS_Store *.box *.iso -*.vfd +*.swp diff --git a/Vagrantfile b/Vagrantfile index 667e06b..a23fb97 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -27,6 +27,22 @@ Vagrant.configure("2") do |config| win2k8.vm.network "private_network", type: "dhcp" + win2k8.vm.provider "libvirt" do |v| + v.memory = 4096 + v.cpus = 2 + v.video_type = 'qxl' + v.input :type => "tablet", :bus => "usb" + v.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio' + v.channel :type => 'spicevmc', :target_name => 'com.redhat.spice.0', :target_type => 'virtio' + v.graphics_type = "spice" + + # Enable Hyper-V enlightenments: https://blog.wikichoon.com/2014/07/enabling-hyper-v-enlightenments-with-kvm.html + v.hyperv_feature :name => 'stimer', :state => 'on' + v.hyperv_feature :name => 'relaxed', :state => 'on' + v.hyperv_feature :name => 'vapic', :state => 'on' + v.hyperv_feature :name => 'synic', :state => 'on' + end + # Configure Firewall to open up vulnerable services case ENV['MS3_DIFFICULTY'] when 'easy' diff --git a/packer/scripts/virtio-win-drivers.sh b/packer/scripts/virtio-win-drivers.sh index 776339e..43e1518 100755 --- a/packer/scripts/virtio-win-drivers.sh +++ b/packer/scripts/virtio-win-drivers.sh @@ -1,7 +1,9 @@ #!/usr/bin/env bash # URI for downloading the latest WHQL'd Virtio drivers -virtio_uri="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win_amd64.vfd" +virtio_release="virtio-win-0.1.117_amd64" +virtio_release_folder="virtio-win-0.1.117-1" +virtio_uri="https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/${virtio_release_folder}/${virtio_release}.vfd" # le flag have_tools=true @@ -35,10 +37,10 @@ if [ ! -x /usr/bin/7z ]; then fi if [ "$have_tools" = true ]; then - if [ -f ".virtio-stable.vfd" ]; then - echo ".virtio-stable.vfd already exists, skipping download." + if [ -f ".${virtio_release}.vfd" ]; then + echo ".${virtio_release}.vfd already exists, skipping download." else - echo "Downloading and extracting virtio stable drivers." - wget -c "${virtio_uri}" -O .virtio-stable.vfd && 7z x -oresources/drivers/virtio .virtio-stable.vfd txtsetup.oem disk1 amd64/Win2008 + echo "Downloading and extracting virtio ${virtio_release} drivers." + wget -c "${virtio_uri}" -O ".${virtio_release}.vfd" && 7z x -oresources/drivers/virtio/"${virtio_release}" ".${virtio_release}.vfd" amd64/Win2008R2 fi fi diff --git a/packer/templates/vagrantfile-windows_2008_r2.template b/packer/templates/vagrantfile-windows_2008_r2.template index 771256d..e2279eb 100644 --- a/packer/templates/vagrantfile-windows_2008_r2.template +++ b/packer/templates/vagrantfile-windows_2008_r2.template @@ -46,4 +46,21 @@ Vagrant.configure("2") do |config| v.vmx["RemoteDisplay.vnc.port"] = "5900" v.vmx["scsi0.virtualDev"] = "lsisas1068" end + + win2k8.vm.provider "libvirt" do |v| + v.memory = "2048" + v.cpus = "2" + v.video_type = 'qxl' + v.input :type => "tablet", :bus => "usb" + v.channel :type => 'unix', :target_name => 'org.qemu.guest_agent.0', :target_type => 'virtio' + v.channel :type => 'spicevmc', :target_name => 'com.redhat.spice.0', :target_type => 'virtio' + v.graphics_type = "spice" + + # Enable Hyper-V enlightenments: https://blog.wikichoon.com/2014/07/enabling-hyper-v-enlightenments-with-kvm.html + v.hyperv_feature :name => 'stimer', :state => 'on' + v.hyperv_feature :name => 'relaxed', :state => 'on' + v.hyperv_feature :name => 'vapic', :state => 'on' + v.hyperv_feature :name => 'synic', :state => 'on' + end + end diff --git a/packer/templates/windows_2008_r2.json b/packer/templates/windows_2008_r2.json index f3814c2..3d75e84 100644 --- a/packer/templates/windows_2008_r2.json +++ b/packer/templates/windows_2008_r2.json @@ -131,7 +131,7 @@ "{{user `resources_dir`}}/certs/microsoft_root_2011.cer", "{{user `resources_dir`}}/certs/thawte_primary_root.cer", "{{user `resources_dir`}}/certs/utn-userfirst.cer", - "./resources/drivers/virtio/*" + "./resources/drivers/virtio/virtio-win-0.1.117_amd64/amd64/Win2008R2/*" ], "qemuargs": [ [ @@ -316,4 +316,4 @@ "resources_dir": "{{template_dir}}/../../resources", "box_version": "0.1.0" } -} \ No newline at end of file +}