Compare commits

..
6 Commits
Author SHA1 Message Date
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
4 changed files with 22 additions and 8 deletions

No files matched your search

+3
View File
@@ -37,11 +37,14 @@ RUN set -eu && extra="" && \
net-tools \
e2fsprogs \
qemu-utils \
iputils-ping \
ca-certificates \
netcat-openbsd \
qemu-system-x86 \
"$extra" && \
apt-get clean && \
mkdir -p /etc/qemu && \
echo "allow br0" > /etc/qemu/bridge.conf && \
unlink /etc/nginx/sites-enabled/default && \
sed -i 's/^worker_processes.*/worker_processes 1;/' /etc/nginx/nginx.conf && \
echo "$VERSION_ARG" > /run/version && \
+1 -4
View File
@@ -223,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.
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
environment:
@@ -234,9 +234,6 @@ kubectl apply -f https://raw.githubusercontent.com/vdsm/virtual-dsm/refs/heads/m
- 'c *:* rwm'
```
> [!NOTE]
> In this mode, the container and DSM will each have their own separate IPs.
### How do I pass-through the GPU?
To pass-through your Intel GPU, add the following lines to your compose file:
+16 -4
View File
@@ -4,6 +4,7 @@ set -Eeuo pipefail
# Docker environment variables
: "${MAC:=""}"
: "${MTU:=""}"
: "${DHCP:="N"}"
: "${NETWORK:="Y"}"
: "${USER_PORTS:=""}"
@@ -58,6 +59,10 @@ configureDHCP() {
fi ;;
esac
if ! ip link set dev "$VM_NET_TAP" mtu "$MTU"; then
warn "Failed to set MTU size.."
fi
while ! ip link set "$VM_NET_TAP" up; do
info "Waiting for MAC address $VM_NET_MAC to become available..."
sleep 2
@@ -213,8 +218,11 @@ configureNAT() {
error "$tuntap" && return 1
fi
GATEWAY_MAC=$(echo "$VM_NET_MAC" | rev)
GATEWAY_MAC="02:${GATEWAY_MAC:0:14}"
if ! ip link set dev "$VM_NET_TAP" mtu "$MTU"; then
warn "Failed to set MTU size.."
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.."
@@ -345,6 +353,10 @@ getInfo() {
error "$ADD_ERR -e \"VM_NET_DEV=NAME\" to specify another interface name." && exit 27
fi
if [ -z "$MTU" ]; then
MTU=$(cat "/sys/class/net/$VM_NET_DEV/mtu")
fi
if [ -z "$VM_NET_MAC" ]; then
local file="$STORAGE/dsm.mac"
[ -s "$file" ] && VM_NET_MAC=$(<"$file")
@@ -387,7 +399,7 @@ getInfo
html "Initializing network..."
if [[ "$DEBUG" == [Yy1]* ]]; then
info "Host: $HOST IP: $IP Gateway: $GATEWAY Interface: $VM_NET_DEV MAC: $VM_NET_MAC"
info "Host: $HOST IP: $IP Gateway: $GATEWAY Interface: $VM_NET_DEV MAC: $VM_NET_MAC MTU: $MTU"
[ -f /etc/resolv.conf ] && grep '^nameserver*' /etc/resolv.conf
echo
fi
@@ -452,6 +464,6 @@ else
fi
NET_OPTS+=" -device $ADAPTER,romfile=,netdev=hostnet0,mac=$VM_NET_MAC,id=net0"
NET_OPTS+=" -device $ADAPTER,romfile=,netdev=hostnet0,mac=$VM_NET_MAC,host_mtu=$MTU,id=net0"
return 0
+2
View File
@@ -72,6 +72,8 @@ CPU="${CPU// Processor/}"
CPU="${CPU// Quad core/}"
CPU="${CPU// Core TM/ Core}"
CPU="${CPU// with Radeon Graphics/}"
CPU="${CPU// with Radeon Vega Graphics/}"
[ -z "${CPU// /}" ] && CPU="Unknown"
# Check system