fix virtio drivers for qemu build of win2k8; optimize vagrantfile for libvirt qemu windows guest

This commit is contained in:
Dave Eargle 2019-11-27 17:26:51 -05:00
parent 6a17501824
commit 74d205d5a0
5 changed files with 43 additions and 8 deletions

2
.gitignore vendored
View File

@ -9,4 +9,4 @@ resources/drivers/
*.DS_Store
*.box
*.iso
*.vfd
*.swp

16
Vagrantfile vendored
View File

@ -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'

View File

@ -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

View File

@ -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

View File

@ -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"
}
}
}