Compare commits

...
15 Commits
Author SHA1 Message Date
Kroese a1e9936572 fix: Set MTU value (#911)
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-03-04 15:37:37 +01:00
Kroese 3675a50129 fix: Gateway MAC generation (#910)
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-03-03 13:57:53 +01:00
Kroese 91229152bd feat: Set MTU size for TAP interface (#909) 2025-03-03 13:40:15 +01:00
Kroese a1993e590a feat: Automaticly match MTU size (#908) 2025-03-03 12:20:16 +01:00
Kroese 52fe712b6f docs: Readme (#907)
Update / dockerHubDescription (push) Has been cancelled
2025-03-01 14:23:51 +01:00
Kroese 7f400b6b59 feat: Improve CPU detection (#905)
Build / Check (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-02-27 11:52:48 +01:00
Kroese 9cb88a99e6 feat: Allow bridge networks (#904) 2025-02-27 11:46:38 +01:00
Kroese b967a471b5 fix: Add e2fsprogs package (#902)
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-02-26 10:03:46 +01:00
Kroese f40127df01 feat: Make app name configurable (#900)
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-02-25 15:13:57 +01:00
Kroese 8c5e0ee274 fix: Generate local MAC address (#899)
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-02-24 21:01:55 +01:00
Kroese 2adf0b292b fix: Preserve gateway MAC address (#898)
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-02-24 03:48:42 +01:00
Kroese 1c9b793c75 fix: Move nginx config (#893)
Build / Check (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-02-15 02:36:07 +01:00
Kroese 00c4ef7795 feat: Remove existing TAP interface (#892)
Build / Check (push) Waiting to run
Build / Build (push) Blocked by required conditions
2025-02-14 20:19:12 +01:00
Kroese 619657adf2 docs: Add restart policy (#888)
Update / dockerHubDescription (push) Has been cancelled
2025-02-10 00:31:32 +01:00
Kroese 41db7c1035 feat: Improve CPU detection (#884)
Build / Check (push) Has been cancelled
Build / Build (push) Has been cancelled
2025-02-06 02:19:39 +01:00
6 changed files with 58 additions and 9 deletions

No files matched your search

+5 -1
View File
@@ -35,12 +35,16 @@ RUN set -eu && extra="" && \
dnsmasq \ dnsmasq \
fakeroot \ fakeroot \
net-tools \ net-tools \
e2fsprogs \
qemu-utils \ qemu-utils \
iputils-ping \
ca-certificates \ ca-certificates \
netcat-openbsd \ netcat-openbsd \
qemu-system-x86 \ qemu-system-x86 \
"$extra" && \ "$extra" && \
apt-get clean && \ apt-get clean && \
mkdir -p /etc/qemu && \
echo "allow br0" > /etc/qemu/bridge.conf && \
unlink /etc/nginx/sites-enabled/default && \ unlink /etc/nginx/sites-enabled/default && \
sed -i 's/^worker_processes.*/worker_processes 1;/' /etc/nginx/nginx.conf && \ sed -i 's/^worker_processes.*/worker_processes 1;/' /etc/nginx/nginx.conf && \
echo "$VERSION_ARG" > /run/version && \ echo "$VERSION_ARG" > /run/version && \
@@ -49,7 +53,7 @@ RUN set -eu && extra="" && \
COPY --chmod=755 ./src /run/ COPY --chmod=755 ./src /run/
COPY --chmod=755 ./web /var/www/ COPY --chmod=755 ./web /var/www/
COPY --chmod=755 --from=builder /qemu-host.bin /run/host.bin COPY --chmod=755 --from=builder /qemu-host.bin /run/host.bin
COPY --chmod=744 ./web/nginx.conf /etc/nginx/sites-enabled/web.conf COPY --chmod=744 ./web/conf/nginx.conf /etc/nginx/sites-enabled/web.conf
VOLUME /storage VOLUME /storage
EXPOSE 22 139 445 5000 EXPOSE 22 139 445 5000
+2 -4
View File
@@ -40,6 +40,7 @@ services:
- 5000:5000 - 5000:5000
volumes: volumes:
- /var/dsm:/storage - /var/dsm:/storage
restart: always
stop_grace_period: 2m stop_grace_period: 2m
``` ```
@@ -222,7 +223,7 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
After configuring the container for [macvlan](#how-do-i-assign-an-individual-ip-address-to-the-container), it is possible for DSM to become part of your home network by requesting an IP from your router, just like your other devices. After configuring the container for [macvlan](#how-do-i-assign-an-individual-ip-address-to-the-container), it is possible for DSM to become part of your home network by requesting an IP from your router, just like your other devices.
To enable this mode, add the following lines to your compose file: To enable this mode, in which the container and DSM will have separate IP addresses, add the following lines to your compose file:
```yaml ```yaml
environment: environment:
@@ -233,9 +234,6 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
- 'c *:* rwm' - 'c *:* rwm'
``` ```
> [!NOTE]
> In this mode, the container and DSM will each have their own separate IPs.
### How do I pass-through the GPU? ### How do I pass-through the GPU?
To pass-through your Intel GPU, add the following lines to your compose file: To pass-through your Intel GPU, add the following lines to your compose file:
+2 -2
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env bash #!/usr/bin/env bash
set -Eeuo pipefail set -Eeuo pipefail
APP="Virtual DSM" : "${APP:="Virtual DSM"}"
SUPPORT="https://github.com/vdsm/virtual-dsm" : "${SUPPORT:="https://github.com/vdsm/virtual-dsm"}"
cd /run cd /run
+44 -2
View File
@@ -4,6 +4,7 @@ set -Eeuo pipefail
# Docker environment variables # Docker environment variables
: "${MAC:=""}" : "${MAC:=""}"
: "${MTU:=""}"
: "${DHCP:="N"}" : "${DHCP:="N"}"
: "${NETWORK:="Y"}" : "${NETWORK:="Y"}"
: "${USER_PORTS:=""}" : "${USER_PORTS:=""}"
@@ -58,6 +59,12 @@ configureDHCP() {
fi ;; fi ;;
esac esac
if [[ "$MTU" != "0" ]] && [[ "$MTU" != "1500" ]]; then
if ! ip link set dev "$VM_NET_TAP" mtu "$MTU"; then
warn "Failed to set MTU size.."
fi
fi
while ! ip link set "$VM_NET_TAP" up; do while ! ip link set "$VM_NET_TAP" up; do
info "Waiting for MAC address $VM_NET_MAC to become available..." info "Waiting for MAC address $VM_NET_MAC to become available..."
sleep 2 sleep 2
@@ -213,6 +220,18 @@ configureNAT() {
error "$tuntap" && return 1 error "$tuntap" && return 1
fi fi
if [[ "$MTU" != "0" ]] && [[ "$MTU" != "1500" ]]; then
if ! ip link set dev "$VM_NET_TAP" mtu "$MTU"; then
warn "Failed to set MTU size.."
fi
fi
GATEWAY_MAC=$(echo "$VM_NET_MAC" | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/')
if ! ip link set dev "$VM_NET_TAP" address "$GATEWAY_MAC"; then
warn "Failed to set gateway MAC address.."
fi
while ! ip link set "$VM_NET_TAP" up promisc on; do while ! ip link set "$VM_NET_TAP" up promisc on; do
info "Waiting for TAP to become available..." info "Waiting for TAP to become available..."
sleep 2 sleep 2
@@ -338,6 +357,20 @@ getInfo() {
error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 27 error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 27
fi fi
if [ -z "$MTU" ]; then
MTU=$(cat "/sys/class/net/$VM_NET_DEV/mtu")
fi
if [ "$MTU" -gt "1500" ]; then
info "MTU size is too large: $MTU, ignoring..." && MTU="0"
fi
if [[ "${ADAPTER,,}" != "virtio-net-pci" ]]; then
if [[ "$MTU" != "0" ]] && [[ "$MTU" != "1500" ]]; then
warn "MTU size is $MTU, but cannot be set for $ADAPTER adapters!" && MTU="0"
fi
fi
if [ -z "$VM_NET_MAC" ]; then if [ -z "$VM_NET_MAC" ]; then
local file="$STORAGE/dsm.mac" local file="$STORAGE/dsm.mac"
[ -s "$file" ] && VM_NET_MAC=$(<"$file") [ -s "$file" ] && VM_NET_MAC=$(<"$file")
@@ -380,7 +413,10 @@ getInfo
html "Initializing network..." html "Initializing network..."
if [[ "$DEBUG" == [Yy1]* ]]; then if [[ "$DEBUG" == [Yy1]* ]]; then
info "Host: $HOST IP: $IP Gateway: $GATEWAY Interface: $VM_NET_DEV MAC: $VM_NET_MAC" mtu=$(cat "/sys/class/net/$VM_NET_DEV/mtu")
line="Host: $HOST IP: $IP Gateway: $GATEWAY Interface: $VM_NET_DEV MAC: $VM_NET_MAC MTU: $mtu"
[[ "$MTU" != "0" ]] && [[ "$MTU" != "$mtu" ]] && line+=" ($MTU)"
info "$line"
[ -f /etc/resolv.conf ] && grep '^nameserver*' /etc/resolv.conf [ -f /etc/resolv.conf ] && grep '^nameserver*' /etc/resolv.conf
echo echo
fi fi
@@ -389,6 +425,11 @@ if [[ "$IP" == "172.17."* ]]; then
warn "your container IP starts with 172.17.* which will cause conflicts when you install the Container Manager package inside DSM!" warn "your container IP starts with 172.17.* which will cause conflicts when you install the Container Manager package inside DSM!"
fi fi
if [[ -d "/sys/class/net/$VM_NET_TAP" ]]; then
info "Lingering interface will be removed..."
ip link delete "$VM_NET_TAP" || true
fi
if [[ "$DHCP" == [Yy1]* ]]; then if [[ "$DHCP" == [Yy1]* ]]; then
checkOS checkOS
@@ -440,6 +481,7 @@ else
fi fi
NET_OPTS+=" -device $ADAPTER,romfile=,netdev=hostnet0,mac=$VM_NET_MAC,id=net0" NET_OPTS+=" -device $ADAPTER,id=net0,netdev=hostnet0,romfile=,mac=$VM_NET_MAC"
[[ "$MTU" != "0" ]] && [[ "$MTU" != "1500" ]] && NET_OPTS+=",host_mtu=$MTU"
return 0 return 0
+5
View File
@@ -64,11 +64,16 @@ if [ -z "${CPU// /}" ] && grep -qi "model:" <<< "$CPI"; then
fi fi
CPU="${CPU// CPU/}" CPU="${CPU// CPU/}"
CPU="${CPU// 8 Core/}"
CPU="${CPU// 16 Core/}" CPU="${CPU// 16 Core/}"
CPU="${CPU// 32 Core/}"
CPU="${CPU// 64 Core/}"
CPU="${CPU// Processor/}" CPU="${CPU// Processor/}"
CPU="${CPU// Quad core/}" CPU="${CPU// Quad core/}"
CPU="${CPU// Core TM/ Core}" CPU="${CPU// Core TM/ Core}"
CPU="${CPU// with Radeon Graphics/}" CPU="${CPU// with Radeon Graphics/}"
CPU="${CPU// with Radeon Vega Graphics/}"
[ -z "${CPU// /}" ] && CPU="Unknown" [ -z "${CPU// /}" ] && CPU="Unknown"
# Check system # Check system
File renamed without changes.