From 97ae8b86a9a5c6b7dcdec12d931241faf3d62c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Molinero=20Fern=C3=A1ndez?= Date: Sat, 18 Jun 2022 14:09:44 +0200 Subject: [PATCH] Explicitly define network configuration and remove guestfwd option --- Dockerfile.m4 | 8 +++----- scripts/service/qemu/run | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile.m4 b/Dockerfile.m4 index a051080..fa7f0c5 100644 --- a/Dockerfile.m4 +++ b/Dockerfile.m4 @@ -82,7 +82,7 @@ RUN mkisofs -no-emul-boot -iso-level 4 -eltorito-boot loader/isoboot.bin -o /tmp && timeout 900 qemu-system-x86_64 \ -machine pc -smp 2 -m 512M -accel tcg \ -device VGA -display none -serial stdio \ - -device e1000,netdev=n0 -netdev user,id=n0,restrict=on \ + -device e1000,netdev=n0 -netdev user,id=n0,ipv4=on,ipv6=off,net=10.0.2.0/24,host=10.0.2.2,dns=10.0.2.3,dhcpstart=10.0.2.15,restrict=on \ -device ide-hd,id=disk0,bus=ide.0,drive=disk0 -blockdev driver=qcow2,node-name=disk0,file.driver=file,file.filename=/tmp/reactos.qcow2 \ -device ide-cd,id=cd0,bus=ide.1,drive=cd0 -blockdev driver=raw,node-name=cd0,file.driver=file,file.filename=/tmp/reactos.iso,read-only=on \ -boot order=cd,menu=off \ @@ -115,8 +115,6 @@ RUN export DEBIAN_FRONTEND=noninteractive \ ENV VM_CPU=2 ENV VM_RAM=1024M ENV VM_KEYBOARD=en-us -ENV VM_NET_GUESTFWD_OPTIONS=guestfwd=tcp:10.0.2.254:445-cmd:"nc 127.0.0.1 445" -ENV VM_NET_HOSTFWD_OPTIONS=hostfwd=tcp::2323-:23,hostfwd=tcp::5151-:51,hostfwd=tcp::3389-:3389 ENV VM_NET_EXTRA_OPTIONS= ENV VM_KVM=true ENV SVDIR=/etc/service/ @@ -156,8 +154,8 @@ FROM base AS test RUN if [ "$(uname -m)" = 'x86_64' ]; then \ container-init & \ printf '%s\n' 'The quick brown fox jumps over the lazy dog' > /mnt/in || exit 1; \ - printf '%s\n' '@echo off & smbclient -c "get /in C:/local; quit" //10.0.2.254/share noop & exit' | timeout 900 vmshell || exit 1; \ - printf '%s\n' '@echo off & smbclient -c "put C:/local /out; quit" //10.0.2.254/share noop & exit' | timeout 120 vmshell || exit 1; \ + printf '%s\n' '@echo off & smbclient -c "get /in C:/local; quit" //10.0.2.2/share noop & exit' | timeout 900 vmshell || exit 1; \ + printf '%s\n' '@echo off & smbclient -c "put C:/local /out; quit" //10.0.2.2/share noop & exit' | timeout 120 vmshell || exit 1; \ cmp -s /mnt/in /mnt/out || exit 1; \ fi diff --git a/scripts/service/qemu/run b/scripts/service/qemu/run index 2a3c2e4..e3b4d71 100755 --- a/scripts/service/qemu/run +++ b/scripts/service/qemu/run @@ -5,7 +5,7 @@ set -eu set -- set -- "$@" -machine pc -smp "${VM_CPU:?}" -m "${VM_RAM:?}" set -- "$@" -device VGA -display vnc=:0 -serial stdio -monitor unix:/run/qemu-monitor,server,nowait -set -- "$@" -device e1000,netdev=n0 -netdev user,id=n0,"${VM_NET_GUESTFWD_OPTIONS?}","${VM_NET_HOSTFWD_OPTIONS?}","${VM_NET_EXTRA_OPTIONS?}" +set -- "$@" -device e1000,netdev=n0 -netdev user,id=n0,ipv4=on,ipv6=off,net=10.0.2.0/24,host=10.0.2.2,dns=10.0.2.3,dhcpstart=10.0.2.15,hostfwd=tcp::2323-:23,hostfwd=tcp::5151-:51,hostfwd=tcp::3389-:3389,"${VM_NET_EXTRA_OPTIONS?}" set -- "$@" -device ide-hd,id=disk0,bus=ide.0,drive=disk0 -blockdev driver=qcow2,node-name=disk0,file.driver=file,file.filename=/var/lib/qemu/disk/reactos.qcow2 set -- "$@" -usb -device usb-tablet set -- "$@" -k "${VM_KEYBOARD:?}"