mirror of
https://github.com/hectorm/docker-qemu-reactos
synced 2025-01-08 01:55:30 +00:00
Unattended install of ReactOS
This commit is contained in:
parent
88a1b868a8
commit
2adbc66a7c
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.inf eol=crlf
|
@ -12,7 +12,10 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
|||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
unzip \
|
genisoimage \
|
||||||
|
p7zip-full \
|
||||||
|
qemu-system-x86 \
|
||||||
|
qemu-utils \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Download noVNC
|
# Download noVNC
|
||||||
@ -36,7 +39,18 @@ ARG REACTOS_ISO_URL=https://downloads.sourceforge.net/project/reactos/ReactOS/0.
|
|||||||
ARG REACTOS_ISO_CHECKSUM=ec2776422ed45f8ee7488030eadd7ea40b4276cee04c5e5e5a3f1a5a68c978a7
|
ARG REACTOS_ISO_CHECKSUM=ec2776422ed45f8ee7488030eadd7ea40b4276cee04c5e5e5a3f1a5a68c978a7
|
||||||
RUN curl -Lo /tmp/reactos.zip "${REACTOS_ISO_URL:?}"
|
RUN curl -Lo /tmp/reactos.zip "${REACTOS_ISO_URL:?}"
|
||||||
RUN printf '%s' "${REACTOS_ISO_CHECKSUM:?} /tmp/reactos.zip" | sha256sum -c
|
RUN printf '%s' "${REACTOS_ISO_CHECKSUM:?} /tmp/reactos.zip" | sha256sum -c
|
||||||
RUN unzip -p /tmp/reactos.zip 'ReactOS-*.iso' > /tmp/reactos.iso
|
RUN 7z e /tmp/reactos.zip -so '*.iso' > /tmp/reactos.iso \
|
||||||
|
&& 7z x /tmp/reactos.iso -o/tmp/reactos/ \
|
||||||
|
&& rm -f /tmp/reactos.iso
|
||||||
|
COPY --chown=root:root ./data/iso/ /tmp/reactos/
|
||||||
|
RUN mkisofs -no-emul-boot -iso-level 4 -eltorito-boot loader/isoboot.bin -o /tmp/reactos.iso /tmp/reactos/ \
|
||||||
|
&& qemu-img create -f qcow2 /tmp/reactos.qcow2 124G \
|
||||||
|
&& timeout 900 qemu-system-x86_64 \
|
||||||
|
-accel tcg -smp 2 -m 512 -serial stdio -display none \
|
||||||
|
-drive file=/tmp/reactos.qcow2,index=0,media=disk,format=qcow2 \
|
||||||
|
-drive file=/tmp/reactos.iso,index=2,media=cdrom,format=raw \
|
||||||
|
-boot order=cd,menu=off \
|
||||||
|
-netdev user,id=n0 -device e1000,netdev=n0
|
||||||
|
|
||||||
##################################################
|
##################################################
|
||||||
## "main" stage
|
## "main" stage
|
||||||
@ -63,24 +77,19 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
|||||||
# Environment
|
# Environment
|
||||||
ENV VM_CPU=2
|
ENV VM_CPU=2
|
||||||
ENV VM_RAM=1024M
|
ENV VM_RAM=1024M
|
||||||
ENV VM_DISK_SIZE=16G
|
|
||||||
ENV VM_KEYBOARD=en-us
|
ENV VM_KEYBOARD=en-us
|
||||||
ENV VM_NET_OPTIONS=hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900
|
ENV VM_NET_OPTIONS=hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900
|
||||||
ENV VM_BOOT_ORDER=cd
|
|
||||||
ENV VM_KVM=true
|
ENV VM_KVM=true
|
||||||
ENV SVDIR=/etc/service/
|
ENV SVDIR=/etc/service/
|
||||||
|
|
||||||
# Create some directories for QEMU
|
|
||||||
RUN mkdir -p /var/lib/qemu/iso/ /var/lib/qemu/images/
|
|
||||||
|
|
||||||
# Copy noVNC
|
# Copy noVNC
|
||||||
COPY --from=build --chown=root:root /tmp/novnc/ /opt/novnc/
|
COPY --from=build --chown=root:root /tmp/novnc/ /opt/novnc/
|
||||||
|
|
||||||
# Copy Websockify
|
# Copy Websockify
|
||||||
COPY --from=build --chown=root:root /tmp/websockify/ /opt/novnc/utils/websockify/
|
COPY --from=build --chown=root:root /tmp/websockify/ /opt/novnc/utils/websockify/
|
||||||
|
|
||||||
# Copy ReactOS ISO
|
# Copy ReactOS disk
|
||||||
COPY --from=build --chown=root:root /tmp/reactos.iso /var/lib/qemu/iso/reactos.iso
|
COPY --from=build --chown=root:root /tmp/reactos.qcow2 /var/lib/qemu/reactos.qcow2
|
||||||
|
|
||||||
# Copy services
|
# Copy services
|
||||||
COPY --chown=root:root ./scripts/service/ /etc/service/
|
COPY --chown=root:root ./scripts/service/ /etc/service/
|
||||||
|
@ -23,15 +23,9 @@ Number of cores the VM is permitted to use (`2` by default).
|
|||||||
#### `VM_RAM`
|
#### `VM_RAM`
|
||||||
Amount of memory the VM is permitted to use (`1024M` by default).
|
Amount of memory the VM is permitted to use (`1024M` by default).
|
||||||
|
|
||||||
#### `VM_DISK_SIZE`
|
|
||||||
VM disk size (`16G` by default).
|
|
||||||
|
|
||||||
#### `VM_KEYBOARD`
|
#### `VM_KEYBOARD`
|
||||||
VM keyboard layout (`en-us` by default).
|
VM keyboard layout (`en-us` by default).
|
||||||
|
|
||||||
#### `VM_BOOT_ORDER`
|
|
||||||
VM boot order (`cd` by default).
|
|
||||||
|
|
||||||
#### `VM_KVM`
|
#### `VM_KVM`
|
||||||
Start QEMU in KVM mode (`true` by default).
|
Start QEMU in KVM mode (`true` by default).
|
||||||
> The `--device /dev/kvm` option is required for this variable to take effect.
|
> The `--device /dev/kvm` option is required for this variable to take effect.
|
||||||
|
46
data/iso/reactos/unattend.inf
Normal file
46
data/iso/reactos/unattend.inf
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
[Unattend]
|
||||||
|
Signature = "$ReactOS$"
|
||||||
|
|
||||||
|
UnattendSetupEnabled = yes
|
||||||
|
|
||||||
|
DestinationDiskNumber = 0
|
||||||
|
DestinationPartitionNumber = 1
|
||||||
|
InstallationDirectory = ReactOS
|
||||||
|
AutoPartition = 1
|
||||||
|
FormatPartition = 1
|
||||||
|
; 0: FAT
|
||||||
|
; 1: BtrFS
|
||||||
|
FsType = 0
|
||||||
|
; 0: Skips MBR installation
|
||||||
|
; 1: Install MBR on floppy
|
||||||
|
; 2: Install MBR on hdd
|
||||||
|
MBRInstallType = 2
|
||||||
|
|
||||||
|
FullName = "Owner"
|
||||||
|
OrgName = "Org"
|
||||||
|
ComputerName = "REACTOS"
|
||||||
|
; AdminPassword = "password"
|
||||||
|
|
||||||
|
; TimeZoneIndex lists:
|
||||||
|
; https://docs.microsoft.com/en-us/previous-versions/windows/embedded/ms912053(v=winembedded.10)
|
||||||
|
TimeZoneIndex = 85
|
||||||
|
DisableAutoDaylightTimeSet = 1
|
||||||
|
|
||||||
|
; LocaleID lists:
|
||||||
|
; https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c
|
||||||
|
LocaleID = 409
|
||||||
|
|
||||||
|
; 0: ReactOS Server
|
||||||
|
; 1: ReactOS Workstation
|
||||||
|
ProductOption = 0
|
||||||
|
|
||||||
|
DisableGeckoInst = no
|
||||||
|
|
||||||
|
[GuiRunOnce]
|
||||||
|
%SystemRoot%\system32\shutdown.exe /s /t 5
|
||||||
|
|
||||||
|
[Display]
|
||||||
|
BitsPerPel = 32
|
||||||
|
XResolution = 1440
|
||||||
|
YResolution = 900
|
||||||
|
VRefresh = 0
|
@ -2,11 +2,6 @@
|
|||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Create ReactOS disk
|
|
||||||
if [ ! -f /var/lib/qemu/images/reactos.img ]; then
|
|
||||||
qemu-img create -f qcow2 /var/lib/qemu/images/reactos.img "${VM_DISK_SIZE:?}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
for s in "${SVDIR:?}"/*; do sv force-stop "${s:?}" >/dev/null 2>&1; done
|
for s in "${SVDIR:?}"/*; do sv force-stop "${s:?}" >/dev/null 2>&1; done
|
||||||
kill -HUP "${RUNSVDIRPID:?}"; wait "${RUNSVDIRPID:?}"
|
kill -HUP "${RUNSVDIRPID:?}"; wait "${RUNSVDIRPID:?}"
|
||||||
|
@ -5,10 +5,8 @@ set -eu
|
|||||||
set --
|
set --
|
||||||
set -- "$@" -smp "${VM_CPU:?}" -m "${VM_RAM:?}"
|
set -- "$@" -smp "${VM_CPU:?}" -m "${VM_RAM:?}"
|
||||||
set -- "$@" -serial stdio -monitor unix:/run/qemu-monitor,server,nowait -device VGA -display vnc=:0
|
set -- "$@" -serial stdio -monitor unix:/run/qemu-monitor,server,nowait -device VGA -display vnc=:0
|
||||||
set -- "$@" -drive file=/var/lib/qemu/images/reactos.img,index=0,media=disk,format=qcow2
|
set -- "$@" -drive file=/var/lib/qemu/reactos.qcow2,index=0,media=disk,format=qcow2
|
||||||
set -- "$@" -drive file=/var/lib/qemu/iso/reactos.iso,index=2,media=cdrom,format=raw
|
set -- "$@" -netdev user,id=n0,"${VM_NET_OPTIONS?}"
|
||||||
set -- "$@" -boot order="${VM_BOOT_ORDER:?}",menu=off
|
|
||||||
set -- "$@" -netdev user,id=n0,"${VM_NET_OPTIONS:?}"
|
|
||||||
set -- "$@" -device e1000,netdev=n0
|
set -- "$@" -device e1000,netdev=n0
|
||||||
set -- "$@" -usb -device usb-tablet
|
set -- "$@" -usb -device usb-tablet
|
||||||
set -- "$@" -k "${VM_KEYBOARD:?}"
|
set -- "$@" -k "${VM_KEYBOARD:?}"
|
||||||
|
Loading…
Reference in New Issue
Block a user