From d0d714ec11e60d577a119ae0730d7be8d4f924ee Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 18 Apr 2023 21:01:01 +0200 Subject: [PATCH 1/3] Background sleep --- agent/agent.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/agent/agent.sh b/agent/agent.sh index 6d67a54..f671098 100644 --- a/agent/agent.sh +++ b/agent/agent.sh @@ -48,7 +48,7 @@ function downloadUpdate { [[ remote_size -eq local_size ]] && return if ! curl -sfk -m 10 -o "${TMP}" "${URL}"; then - echo "$HEADER: curl error" && return + echo "$HEADER: curl error ($?)" && return fi if [ ! -f "${TMP}" ]; then @@ -66,7 +66,7 @@ function downloadUpdate { fi mv -f "${TMP}" "${SCRIPT}" - chmod +x "${SCRIPT}" + chmod 755 "${SCRIPT}" echo "$HEADER: succesfully installed update, please reboot." @@ -126,8 +126,7 @@ fi delay=5000 elapsed=$((($(date +%s%N) - ts)/1000000)) -if (( delay > elapsed )); then - echo "$HEADER: Ready..." +if [[ delay -gt elapsed ]]; then difference=$((delay-elapsed)) float=$(echo | awk -v diff="${difference}" '{print diff * 0.001}') sleep "$float" @@ -144,6 +143,6 @@ echo "-------------------------------------------" while true; do checkNMI - sleep 2 + sleep 2 & wait $! done From 01bddf699f3888125cc8b4908ab02738139dc118 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 18 Apr 2023 22:18:54 +0200 Subject: [PATCH 2/3] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 35571f7..151c101 100644 --- a/readme.md +++ b/readme.md @@ -113,7 +113,7 @@ $ docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop- CPU_CORES: "4" RAM_SIZE: "2048M" ``` - + * ### How do I install a specific version of vDSM? ### By default it installs vDSM 7.2, but if you want to use an older version you can add its URL to your compose file: From 134a2ac39acfdaa3a6ca89e9efa86f0538d4c843 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 18 Apr 2023 22:20:03 +0200 Subject: [PATCH 3/3] Update readme.md --- readme.md | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/readme.md b/readme.md index 151c101..0dbe7af 100644 --- a/readme.md +++ b/readme.md @@ -54,11 +54,22 @@ services: Via `docker run` ```bash -$ docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 60 kroese/virtual-dsm:latest +docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop-timeout 60 kroese/virtual-dsm:latest ``` ## FAQ + * ### How do I check if my system supports KVM? + + To check if your system supports KVM run these commands: + + ``` + sudo apt install cpu-checker + sudo kvm-ok + ``` + + If `kvm-ok` returns an error stating KVM acceleration cannot be used, you may need to change your BIOS settings. + * ### How do I change the size of the virtual disk? ### By default it is 16GB, but you can modify the `DISK_SIZE` setting in your compose file: @@ -81,11 +92,23 @@ $ docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop- Just replace `/home/user/data` with the path to the folder you want to use for storage. + * ### How do I change the amount of CPU/RAM? ### + + By default an amount of 512MB RAM and 1 vCPU is allocated to the container. + + To increase this you can add the following environment variabeles: + + ``` + environment: + CPU_CORES: "4" + RAM_SIZE: "2048M" + ``` + * ### How do I give the container a dedicated IP address? By default the container uses bridge networking, and is reachable by the IP of the docker host. - If you want to give it a seperate IP address, create a macvlan network that matches your local subnet: + If you want to give it a seperate IP address, create a macvlan network that matches your local subnet, for example: ``` $ docker network create -d macvlan \ @@ -100,20 +123,8 @@ $ docker run -it --rm -p 5000:5000 --device=/dev/kvm --cap-add NET_ADMIN --stop- --network vlan --ip=192.168.0.100 ``` - This has the advantage that you don't need to do any portmapping anymore. - - * ### How do I change the amount of CPU/RAM? ### - - By default an amount of 512MB RAM and 1 vCPU is allocated to the container. - - To increase this you can add the following environment variabeles: - - ``` - environment: - CPU_CORES: "4" - RAM_SIZE: "2048M" - ``` - + This also has the advantage that you don't need to do any portmapping anymore. + * ### How do I install a specific version of vDSM? ### By default it installs vDSM 7.2, but if you want to use an older version you can add its URL to your compose file: