Compare commits
15 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9546b11150 | ||
![]() |
ffc4bb39c2 | ||
![]() |
41da658176 | ||
![]() |
caa7bc311d | ||
![]() |
72738ce2a3 | ||
![]() |
d5cb0b8c71 | ||
![]() |
038c4c6e14 | ||
![]() |
f89cb831c4 | ||
![]() |
a100af1fc5 | ||
![]() |
56cb411a23 | ||
![]() |
7622677489 | ||
![]() |
18dee3c07d | ||
![]() |
105db123af | ||
![]() |
846c232bd0 | ||
![]() |
0e5cca6a1e |
8 changed files with 41 additions and 25 deletions
2
.github/ISSUE_TEMPLATE/1-issue.yml
vendored
2
.github/ISSUE_TEMPLATE/1-issue.yml
vendored
|
@ -21,6 +21,7 @@ body:
|
|||
attributes:
|
||||
label: Docker compose
|
||||
description: The compose file (or otherwise the `docker run` command used).
|
||||
render: yaml
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
@ -28,6 +29,7 @@ body:
|
|||
attributes:
|
||||
label: Docker log
|
||||
description: The logfile of the container (as shown by `docker logs qemu`).
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
|
2
.github/ISSUE_TEMPLATE/3-bug.yml
vendored
2
.github/ISSUE_TEMPLATE/3-bug.yml
vendored
|
@ -23,6 +23,7 @@ body:
|
|||
attributes:
|
||||
label: Docker compose
|
||||
description: The compose file (or otherwise the `docker run` command used).
|
||||
render: yaml
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
@ -30,6 +31,7 @@ body:
|
|||
attributes:
|
||||
label: Docker log
|
||||
description: The logfile of the container (as shown by `docker logs qemu`).
|
||||
render: shell
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
|
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
@ -46,8 +46,8 @@ jobs:
|
|||
with:
|
||||
context: git
|
||||
images: |
|
||||
${{ secrets.DOCKERHUB_REPO }}
|
||||
ghcr.io/${{ github.repository }}
|
||||
${{ secrets.DOCKERHUB_REPO }}
|
||||
tags: |
|
||||
type=raw,value=latest,priority=100
|
||||
type=raw,value=${{ vars.MAJOR }}.${{ vars.MINOR }}
|
||||
|
|
|
@ -19,6 +19,7 @@ RUN set -eu && \
|
|||
wget \
|
||||
7zip \
|
||||
curl \
|
||||
fdisk \
|
||||
nginx \
|
||||
procps \
|
||||
seabios \
|
||||
|
@ -33,12 +34,12 @@ RUN set -eu && \
|
|||
iputils-ping \
|
||||
genisoimage \
|
||||
ca-certificates \
|
||||
netcat-openbsd \
|
||||
qemu-system-arm \
|
||||
qemu-efi-aarch64 && \
|
||||
qemu-system-arm && \
|
||||
apt-get clean && \
|
||||
mkdir -p /etc/qemu && \
|
||||
echo "allow br0" > /etc/qemu/bridge.conf && \
|
||||
wget "https://snapshot.debian.org/archive/debian/20250128T092032Z/pool/main/e/edk2/qemu-efi-aarch64_2024.11-5_all.deb" -O /tmp/aavmf.deb -q --timeout=10 && \
|
||||
dpkg -i /tmp/aavmf.deb && \
|
||||
mkdir -p /usr/share/novnc && \
|
||||
wget "https://github.com/novnc/noVNC/archive/refs/tags/v${VERSION_VNC}.tar.gz" -O /tmp/novnc.tar.gz -q --timeout=10 && \
|
||||
tar -xf /tmp/novnc.tar.gz -C /tmp/ && \
|
||||
|
@ -59,9 +60,9 @@ COPY --chmod=755 ./src /run/
|
|||
VOLUME /storage
|
||||
EXPOSE 22 5900 8006
|
||||
|
||||
ENV BOOT="alpine"
|
||||
ENV CPU_CORES="2"
|
||||
ENV RAM_SIZE="2G"
|
||||
ENV DISK_SIZE="16G"
|
||||
ENV BOOT="http://example.com/image.iso"
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "-s", "/run/entry.sh"]
|
||||
|
|
|
@ -49,7 +49,7 @@ services:
|
|||
##### Via Docker CLI:
|
||||
|
||||
```bash
|
||||
docker run -it --rm --name qemu -e "BOOT=alpine" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v ${PWD:-.}/qemu:/storage --stop-timeout 120 qemux/qemu-arm
|
||||
docker run -it --rm --name qemu -e "BOOT=alpine" -p 8006:8006 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/qemu:/storage" --stop-timeout 120 qemux/qemu-arm
|
||||
```
|
||||
|
||||
##### Via Kubernetes:
|
||||
|
@ -60,7 +60,7 @@ kubectl apply -f https://raw.githubusercontent.com/qemus/qemu-arm/refs/heads/mas
|
|||
|
||||
##### Via Github Codespaces:
|
||||
|
||||
[](https://github.com/codespaces/new?repo=626637620&machine=basicLinux32gb)
|
||||
[](https://codespaces.new/qemus/qemu)
|
||||
|
||||
## FAQ 💬
|
||||
|
||||
|
@ -301,12 +301,12 @@ kubectl apply -f https://raw.githubusercontent.com/qemus/qemu-arm/refs/heads/mas
|
|||
|
||||
### How do I pass-through a disk?
|
||||
|
||||
It is possible to pass-through disk devices directly by adding them to your compose file in this way:
|
||||
It is possible to pass-through disk devices or partitions directly by adding them to your compose file in this way:
|
||||
|
||||
```yaml
|
||||
devices:
|
||||
- /dev/sdb:/disk1
|
||||
- /dev/sdc:/disk2
|
||||
- /dev/sdc1:/disk2
|
||||
```
|
||||
|
||||
Use `/disk1` if you want it to become your main drive, and use `/disk2` and higher to add them as secondary drives.
|
||||
|
|
|
@ -100,10 +100,11 @@ else
|
|||
fi
|
||||
|
||||
SM_BIOS=""
|
||||
PS="/sys/class/dmi/id/product_serial"
|
||||
|
||||
if [ -s "/sys/class/dmi/id/product_serial" ]; then
|
||||
if [ -s "$PS" ] && [ -r "$PS" ]; then
|
||||
|
||||
BIOS_SERIAL=$(</sys/class/dmi/id/product_serial)
|
||||
BIOS_SERIAL=$(<"$PS")
|
||||
BIOS_SERIAL="${BIOS_SERIAL//[![:alnum:]]/}"
|
||||
|
||||
if [ -n "$BIOS_SERIAL" ]; then
|
||||
|
|
|
@ -12,7 +12,6 @@ SERIAL_OPTS="-serial $SERIAL"
|
|||
CPU_OPTS="-cpu $CPU_FLAGS -smp $SMP"
|
||||
RAM_OPTS=$(echo "-m ${RAM_SIZE^^}" | sed 's/MB/M/g;s/GB/G/g;s/TB/T/g')
|
||||
MON_OPTS="-monitor $MONITOR -name $PROCESS,process=$PROCESS,debug-threads=on"
|
||||
[ -n "$USB" ] && [[ "${USB,,}" != "no"* ]] && USB_OPTS="-device $USB -device usb-kbd -device usb-tablet"
|
||||
MAC_OPTS="-machine type=${MACHINE},secure=${SECURE},dump-guest-core=off${KVM_OPTS}"
|
||||
|
||||
[ -n "$UUID" ] && MAC_OPTS+=" -uuid $UUID"
|
||||
|
@ -23,12 +22,15 @@ DEV_OPTS+=" -device virtio-rng-pci,rng=objrng0,id=rng0,bus=pcie.0"
|
|||
|
||||
if [[ "${BOOT_MODE,,}" != "windows"* ]]; then
|
||||
DEV_OPTS+=" -device virtio-balloon-pci,id=balloon0,bus=pcie.0"
|
||||
if [ -d "/shared" ]; then
|
||||
fi
|
||||
|
||||
if [ -d "/shared" ] && [[ "${BOOT_MODE,,}" != "windows"* ]]; then
|
||||
DEV_OPTS+=" -fsdev local,id=fsdev0,path=/shared,security_model=none"
|
||||
DEV_OPTS+=" -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=shared"
|
||||
fi
|
||||
fi
|
||||
|
||||
[ -n "$USB" ] && [[ "${USB,,}" != "no"* ]] && USB_OPTS="-device $USB -device usb-kbd -device usb-tablet"
|
||||
|
||||
ARGS="$DEF_OPTS $CPU_OPTS $RAM_OPTS $MAC_OPTS $DISPLAY_OPTS $MON_OPTS $SERIAL_OPTS ${USB_OPTS:-} $NET_OPTS $DISK_OPTS $BOOT_OPTS $DEV_OPTS $ARGUMENTS"
|
||||
ARGS=$(echo "$ARGS" | sed 's/\t/ /g' | tr -s ' ')
|
||||
|
||||
|
|
16
src/proc.sh
16
src/proc.sh
|
@ -34,10 +34,10 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||
KVM_ERR=""
|
||||
|
||||
if [ ! -e /dev/kvm ]; then
|
||||
KVM_ERR="(device file missing)"
|
||||
KVM_ERR="(/dev/kvm is missing)"
|
||||
else
|
||||
if ! sh -c 'echo -n > /dev/kvm' &> /dev/null; then
|
||||
KVM_ERR="(no write access)"
|
||||
KVM_ERR="(/dev/kvm is unwriteable)"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -46,8 +46,16 @@ if [[ "$KVM" != [Nn]* ]]; then
|
|||
if [[ "$OSTYPE" =~ ^darwin ]]; then
|
||||
warn "you are using macOS which has no KVM support, this will cause a major loss of performance."
|
||||
else
|
||||
error "KVM acceleration not available $KVM_ERR, this will cause a major loss of performance."
|
||||
error "See the FAQ on how to diagnose the cause, or continue without KVM by setting KVM=N (not recommended)."
|
||||
kernel=$(uname -a)
|
||||
case "${kernel,,}" in
|
||||
*"microsoft"* )
|
||||
error "Please bind '/dev/kvm' as a volume in the optional container settings when using Docker Desktop." ;;
|
||||
*"synology"* )
|
||||
error "Please make sure that Synology VMM (Virtual Machine Manager) is installed and that '/dev/kvm' is binded to this container." ;;
|
||||
*)
|
||||
error "KVM acceleration is not available $KVM_ERR, this will cause a major loss of performance."
|
||||
error "See the FAQ for possible causes, or continue without it by adding KVM: \"N\" (not recommended)." ;;
|
||||
esac
|
||||
[[ "$DEBUG" != [Yy1]* ]] && exit 88
|
||||
fi
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue