mirror of
https://github.com/hectorm/docker-qemu-reactos
synced 2025-01-09 10:36:37 +00:00
Renamed variables "QEMU_" to "QEMU_VM_" to avoid conflict with environment variables supported by QEMU
This commit is contained in:
parent
b261afcbd2
commit
c4905ecf00
@ -60,16 +60,16 @@ RUN export DEBIAN_FRONTEND=noninteractive \
|
|||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# Environment
|
# Environment
|
||||||
ENV QEMU_CPU=2
|
ENV QEMU_VM_CPU=2
|
||||||
ENV QEMU_RAM=1024M
|
ENV QEMU_VM_RAM=1024M
|
||||||
ENV QEMU_DISK_SIZE=16G
|
ENV QEMU_VM_DISK_SIZE=16G
|
||||||
ENV QEMU_DISK_FORMAT=qcow2
|
ENV QEMU_VM_DISK_FORMAT=qcow2
|
||||||
ENV QEMU_KEYBOARD=en-us
|
ENV QEMU_VM_KEYBOARD=en-us
|
||||||
ENV QEMU_NET_DEVICE=e1000
|
ENV QEMU_VM_NET_DEVICE=e1000
|
||||||
ENV QEMU_NET_OPTIONS=hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900
|
ENV QEMU_VM_NET_OPTIONS=hostfwd=tcp::13389-:3389,hostfwd=tcp::15900-:5900
|
||||||
ENV QEMU_BOOT_ORDER=cd
|
ENV QEMU_VM_BOOT_ORDER=cd
|
||||||
ENV QEMU_BOOT_MENU=off
|
ENV QEMU_VM_BOOT_MENU=off
|
||||||
ENV QEMU_KVM=false
|
ENV QEMU_VM_KVM=false
|
||||||
|
|
||||||
# Create some directories for QEMU
|
# Create some directories for QEMU
|
||||||
RUN mkdir -p /var/lib/qemu/iso/ /var/lib/qemu/images/
|
RUN mkdir -p /var/lib/qemu/iso/ /var/lib/qemu/images/
|
||||||
|
20
README.md
20
README.md
@ -8,37 +8,37 @@ docker run --detach \
|
|||||||
--name qemu-reactos \
|
--name qemu-reactos \
|
||||||
--restart on-failure:3 \
|
--restart on-failure:3 \
|
||||||
--publish 127.0.0.1:6080:6080/tcp \
|
--publish 127.0.0.1:6080:6080/tcp \
|
||||||
--privileged --env QEMU_KVM=true \
|
--privileged --env QEMU_VM_KVM=true \
|
||||||
docker.io/hectormolinero/qemu-reactos:latest
|
docker.io/hectormolinero/qemu-reactos:latest
|
||||||
```
|
```
|
||||||
> The instance will be available through a web browser from: http://localhost:6080/vnc.html
|
> The instance will be available through a web browser from: http://localhost:6080/vnc.html
|
||||||
|
|
||||||
## Environment variables
|
## Environment variables
|
||||||
#### `QEMU_CPU`
|
#### `QEMU_VM_CPU`
|
||||||
Number of cores the VM is permitted to use (`2` by default).
|
Number of cores the VM is permitted to use (`2` by default).
|
||||||
|
|
||||||
#### `QEMU_RAM`
|
#### `QEMU_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).
|
||||||
|
|
||||||
#### `QEMU_DISK_SIZE`
|
#### `QEMU_VM_DISK_SIZE`
|
||||||
VM disk size (`16G` by default).
|
VM disk size (`16G` by default).
|
||||||
|
|
||||||
#### `QEMU_DISK_FORMAT`
|
#### `QEMU_VM_DISK_FORMAT`
|
||||||
VM disk format (`qcow2` by default).
|
VM disk format (`qcow2` by default).
|
||||||
|
|
||||||
#### `QEMU_KEYBOARD`
|
#### `QEMU_VM_KEYBOARD`
|
||||||
VM keyboard layout (`en-us` by default).
|
VM keyboard layout (`en-us` by default).
|
||||||
|
|
||||||
#### `QEMU_NET_DEVICE`
|
#### `QEMU_VM_NET_DEVICE`
|
||||||
VM network device (`e1000` by default).
|
VM network device (`e1000` by default).
|
||||||
|
|
||||||
#### `QEMU_BOOT_ORDER`
|
#### `QEMU_VM_BOOT_ORDER`
|
||||||
VM boot order (`cd` by default).
|
VM boot order (`cd` by default).
|
||||||
|
|
||||||
#### `QEMU_BOOT_MENU`
|
#### `QEMU_VM_BOOT_MENU`
|
||||||
VM boot menu (`off` by default).
|
VM boot menu (`off` by default).
|
||||||
|
|
||||||
#### `QEMU_KVM`
|
#### `QEMU_VM_KVM`
|
||||||
Start QEMU in KVM mode (`false` by default).
|
Start QEMU in KVM mode (`false` by default).
|
||||||
> The `--privileged` option is required to use KVM in the container.
|
> The `--privileged` option is required to use KVM in the container.
|
||||||
|
|
||||||
|
2
run.sh
2
run.sh
@ -40,7 +40,7 @@ printf -- '%s\n' "Creating \"${CONTAINER_NAME:?}\" container..."
|
|||||||
--publish '127.0.0.1:5900:5900/tcp' \
|
--publish '127.0.0.1:5900:5900/tcp' \
|
||||||
--publish '127.0.0.1:6080:6080/tcp' \
|
--publish '127.0.0.1:6080:6080/tcp' \
|
||||||
--publish '127.0.0.1:15900:15900/tcp' \
|
--publish '127.0.0.1:15900:15900/tcp' \
|
||||||
--privileged --env QEMU_KVM=true \
|
--privileged --env QEMU_VM_KVM=true \
|
||||||
"${IMAGE_NAME:?}" "$@" >/dev/null
|
"${IMAGE_NAME:?}" "$@" >/dev/null
|
||||||
|
|
||||||
printf -- '%s\n\n' 'Done!'
|
printf -- '%s\n\n' 'Done!'
|
||||||
|
@ -4,7 +4,7 @@ set -eu
|
|||||||
|
|
||||||
# Create ReactOS disk
|
# Create ReactOS disk
|
||||||
if [ ! -f /var/lib/qemu/images/reactos.img ]; then
|
if [ ! -f /var/lib/qemu/images/reactos.img ]; then
|
||||||
qemu-img create -f "${QEMU_DISK_FORMAT:?}" /var/lib/qemu/images/reactos.img "${QEMU_DISK_SIZE:?}"
|
qemu-img create -f "${QEMU_VM_DISK_FORMAT:?}" /var/lib/qemu/images/reactos.img "${QEMU_VM_DISK_SIZE:?}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start all services
|
# Start all services
|
||||||
|
@ -3,15 +3,15 @@
|
|||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
QEMU=$(command -v qemu-system-x86_64)
|
QEMU=$(command -v qemu-system-x86_64)
|
||||||
QEMU_ARGS="${QEMU_ARGS-} -smp ${QEMU_CPU:?} -m ${QEMU_RAM:?}"
|
QEMU_ARGS="${QEMU_ARGS-} -smp ${QEMU_VM_CPU:?} -m ${QEMU_VM_RAM:?}"
|
||||||
QEMU_ARGS="${QEMU_ARGS-} -vga std -display vnc=:0"
|
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/images/reactos.img,index=0,media=disk,format=${QEMU_VM_DISK_FORMAT:?}"
|
||||||
QEMU_ARGS="${QEMU_ARGS-} -drive file=/var/lib/qemu/iso/reactos.iso,index=2,media=cdrom,format=raw"
|
QEMU_ARGS="${QEMU_ARGS-} -drive file=/var/lib/qemu/iso/reactos.iso,index=2,media=cdrom,format=raw"
|
||||||
QEMU_ARGS="${QEMU_ARGS-} -boot order=${QEMU_BOOT_ORDER:?},menu=${QEMU_BOOT_MENU:?},splash-time=5000"
|
QEMU_ARGS="${QEMU_ARGS-} -boot order=${QEMU_VM_BOOT_ORDER:?},menu=${QEMU_VM_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-} -netdev user,id=n0,${QEMU_VM_NET_OPTIONS:?} -device ${QEMU_VM_NET_DEVICE:?},netdev=n0"
|
||||||
QEMU_ARGS="${QEMU_ARGS-} -usb -device usb-tablet"
|
QEMU_ARGS="${QEMU_ARGS-} -usb -device usb-tablet"
|
||||||
QEMU_ARGS="${QEMU_ARGS-} -k ${QEMU_KEYBOARD:?}"
|
QEMU_ARGS="${QEMU_ARGS-} -k ${QEMU_VM_KEYBOARD:?}"
|
||||||
if [ "${QEMU_KVM:?}" = true ]; then QEMU_ARGS="${QEMU_ARGS-} -enable-kvm"; fi
|
if [ "${QEMU_VM_KVM:?}" = true ]; then QEMU_ARGS="${QEMU_ARGS-} -enable-kvm"; fi
|
||||||
|
|
||||||
cd /var/lib/qemu/
|
cd /var/lib/qemu/
|
||||||
exec 2>&1
|
exec 2>&1
|
||||||
|
Loading…
Reference in New Issue
Block a user