mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-11-10 03:53:42 +08:00
Compare commits
11 Commits
v7.22
...
52fe712b6f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52fe712b6f | ||
|
|
7f400b6b59 | ||
|
|
9cb88a99e6 | ||
|
|
b967a471b5 | ||
|
|
f40127df01 | ||
|
|
8c5e0ee274 | ||
|
|
2adf0b292b | ||
|
|
1c9b793c75 | ||
|
|
00c4ef7795 | ||
|
|
619657adf2 | ||
|
|
41db7c1035 |
@@ -35,12 +35,15 @@ RUN set -eu && extra="" && \
|
|||||||
dnsmasq \
|
dnsmasq \
|
||||||
fakeroot \
|
fakeroot \
|
||||||
net-tools \
|
net-tools \
|
||||||
|
e2fsprogs \
|
||||||
qemu-utils \
|
qemu-utils \
|
||||||
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 +52,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
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -213,6 +213,13 @@ configureNAT() {
|
|||||||
error "$tuntap" && return 1
|
error "$tuntap" && return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
GATEWAY_MAC=$(echo "$VM_NET_MAC" | rev)
|
||||||
|
GATEWAY_MAC="02:${GATEWAY_MAC:0:14}"
|
||||||
|
|
||||||
|
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
|
||||||
@@ -389,6 +396,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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user