Land #431, fix virtio drivers for qemu build

This commit is contained in:
Jeffrey Martin 2020-08-21 13:57:22 -05:00
commit b0eaed0ae8
No known key found for this signature in database
GPG Key ID: 0CD9BBC2AF15F171
5 changed files with 41 additions and 7 deletions

1
.gitignore vendored
View File

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

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

@ -316,4 +316,4 @@
"resources_dir": "{{template_dir}}/../../resources",
"box_version": "0.1.0"
}
}
}