diff --git a/Dockerfile b/Dockerfile index 4319d0d..0e6db71 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,10 @@ ENV QEMU_RAM=1024M ENV QEMU_DISK_SIZE=16G ENV QEMU_DISK_FORMAT=qcow2 ENV QEMU_KEYBOARD=en-us +ENV QEMU_NET_DEVICE=rtl8139 +ENV QEMU_NET_OPTIONS=hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900 +ENV QEMU_BOOT_ORDER=cd +ENV QEMU_BOOT_MENU=off ENV QEMU_KVM=false # Install system packages @@ -42,7 +46,10 @@ COPY --chown=root:root scripts/service/ /etc/service/ # Copy scripts COPY --chown=root:root scripts/bin/ /usr/local/bin/ -# Expose noVNC port +# Expose ports +## VNC +EXPOSE 5900/tcp +## noVNC EXPOSE 6080/tcp CMD ["/usr/local/bin/docker-foreground-cmd"] diff --git a/README.md b/README.md index 6acfeeb..81f4192 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,15 @@ VM disk format (`qcow2` by default). #### `QEMU_KEYBOARD` VM keyboard layout (`en-us` by default). +#### `QEMU_NET_DEVICE` +VM network device (`rtl8139` by default). + +#### `QEMU_BOOT_ORDER` +VM boot order (`cd` by default). + +#### `QEMU_BOOT_MENU` +VM boot menu (`off` by default). + #### `QEMU_KVM` Start QEMU in KVM mode (`false` by default). > The `--privileged` option is required to use KVM in the container. diff --git a/scripts/service/qemu/run b/scripts/service/qemu/run index 09f8acb..10c5a99 100755 --- a/scripts/service/qemu/run +++ b/scripts/service/qemu/run @@ -7,8 +7,8 @@ QEMU_ARGS="${QEMU_ARGS-} -smp ${QEMU_CPU} -m ${QEMU_RAM}" QEMU_ARGS="${QEMU_ARGS-} -vga std -display vnc=:0" QEMU_ARGS="${QEMU_ARGS-} -drive file=/var/lib/qemu/images/reactos.img,index=0,media=disk,format=${QEMU_DISK_FORMAT}" QEMU_ARGS="${QEMU_ARGS-} -drive file=/var/lib/qemu/iso/reactos.iso,index=2,media=cdrom,format=raw" -QEMU_ARGS="${QEMU_ARGS-} -boot order=cd,menu=on,splash-time=5000" -QEMU_ARGS="${QEMU_ARGS-} -netdev user,id=n0,hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900 -device rtl8139,netdev=n0" +QEMU_ARGS="${QEMU_ARGS-} -boot order=${QEMU_BOOT_ORDER},menu=${QEMU_BOOT_MENU},splash-time=5000" +QEMU_ARGS="${QEMU_ARGS-} -netdev user,id=n0,${QEMU_NET_OPTIONS} -device ${QEMU_NET_DEVICE},netdev=n0" QEMU_ARGS="${QEMU_ARGS-} -usb -device usb-tablet" QEMU_ARGS="${QEMU_ARGS-} -k ${QEMU_KEYBOARD}" if [ "${QEMU_KVM}" = true ]; then QEMU_ARGS="${QEMU_ARGS-} -enable-kvm"; fi