Add support for boot and driver ISO image

Installing Windows 10 in VirtIO enabled Qemu requires additional drivers. This change makes it possible to exposed those drivers during a Windows 10 install.
This commit is contained in:
Martin Wimpress 2020-03-21 00:11:04 +00:00
parent e8ddb13e9b
commit c94b6a0a56
No known key found for this signature in database
GPG Key ID: 61DF940515E06DA3
1 changed files with 11 additions and 1 deletions

View File

@ -148,6 +148,16 @@ function vm_boot() {
echo " Existing disk state will be preserved, no writes will be committed."
fi
if [ -n "${iso}" ] && [ -e "${iso}" ]; then
local ISO_BOOT="-drive media=cdrom,file="${iso}",index=2"
echo " - Boot: ${iso}"
fi
if [ -n "${driver_iso}" ] && [ -e "${driver_iso}" ]; then
local ISO_DRIVER="-drive media=cdrom,file="${driver_iso}",index=3"
echo " - Drivers: ${driver_iso}"
fi
local cores="1"
local allcores=$(nproc --all)
if [ ${allcores} -ge 8 ]; then
@ -222,8 +232,8 @@ function vm_boot() {
# Boot the iso image
${QEMU} -name ${VMNAME},process=${VMNAME} \
${BIOS} \
-cdrom "${iso}" \
-drive id=disk,file=${disk_img},format=qcow2,if=virtio,aio=native,cache.direct=on \
${ISO_BOOT} ${ISO_DRIVER} \
-enable-kvm \
-machine q35,accel=kvm \
-cpu host,kvm=on \