Added support for mounting ISOs

This commit is contained in:
Héctor Molinero Fernández 2021-11-14 14:08:28 +01:00
parent 01b5d31067
commit b1c15bd06a
2 changed files with 13 additions and 2 deletions

View File

@ -115,7 +115,7 @@ COPY --from=build --chown=root:root /tmp/novnc/ /opt/novnc/
COPY --from=build --chown=root:root /tmp/websockify/ /opt/novnc/utils/websockify/

# Copy ReactOS disk
COPY --from=build --chown=root:root /tmp/reactos.qcow2 /var/lib/qemu/reactos.qcow2
COPY --from=build --chown=root:root /tmp/reactos.qcow2 /var/lib/qemu/image/reactos.qcow2

# Copy Samba config
COPY --chown=root:root ./config/samba/ /etc/samba/

View File

@ -6,7 +6,7 @@ set --
set -- "$@" -smp "${VM_CPU:?}" -m "${VM_RAM:?}"
set -- "$@" -serial stdio -monitor unix:/run/qemu-monitor,server,nowait -device VGA -display vnc=:0
set -- "$@" -device e1000,netdev=n0 -netdev user,id=n0,"${VM_NET_GUESTFWD_OPTIONS?}","${VM_NET_HOSTFWD_OPTIONS?}","${VM_NET_EXTRA_OPTIONS?}"
set -- "$@" -drive file=/var/lib/qemu/reactos.qcow2,index=0,media=disk,format=qcow2
set -- "$@" -drive file=/var/lib/qemu/image/reactos.qcow2,index=0,media=disk,format=qcow2
set -- "$@" -usb -device usb-tablet -k "${VM_KEYBOARD:?}"

if [ "${VM_KVM:?}" = true ] && [ -c /dev/kvm ]; then
@ -15,6 +15,17 @@ else
set -- "$@" -accel tcg
fi

iso_i=2
for iso in /var/lib/qemu/iso/*; do
[ -f "${iso:?}" ] || continue
set -- "$@" -drive file="${iso:?}",index="${iso_i:?}",media=cdrom,format=raw
iso_i="$((iso_i + 1))"
done

if [ "${iso_i:?}" -gt 2 ]; then
set -- "$@" -boot order=dc,menu=on,splash-time=5000
fi

cd /var/lib/qemu/
exec 2>&1
exec /usr/bin/qemu-system-x86_64 "$@"