From 3a871e4ac5cf3b76b1f77bce577e8d3136136665 Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 26 Mar 2024 02:28:13 +0100 Subject: [PATCH] fix: Folder sharing on XP and Vista (#313) --- docker-compose.yml | 2 ++ readme.md | 2 ++ src/samba.sh | 24 ++++++++++++++++++++---- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0f8bf97..fc2fbf9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,8 @@ services: windows: image: dockurr/windows container_name: windows + environment: + VERSION: "win11" devices: - /dev/kvm cap_add: diff --git a/readme.md b/readme.md index 5afeda2..bfbc5f1 100644 --- a/readme.md +++ b/readme.md @@ -29,6 +29,8 @@ services: windows: image: dockurr/windows container_name: windows + environment: + VERSION: "win11" devices: - /dev/kvm cap_add: diff --git a/src/samba.sh b/src/samba.sh index 5cc1cc8..eb262af 100644 --- a/src/samba.sh +++ b/src/samba.sh @@ -23,7 +23,7 @@ SAMBA="/etc/samba/smb.conf" echo " security = user" echo " guest account = nobody" echo " map to guest = Bad User" - echo " server min protocol = SMB2" + echo " server min protocol = NT1" echo "" echo " # disable printing services" echo " load printers = no" @@ -41,7 +41,7 @@ SAMBA="/etc/samba/smb.conf" echo " force group = root" } > "$SAMBA" -{ echo "--------------------------------------------------------" +{ echo "--------------------------------------------------------" echo " $APP for Docker v$( "$SHARE/readme.txt" -smbd -D -wsdd -i dockerbridge -p -n "host.lan" & +! smbd && smbd --debug-stdout + +isXP="N" + +if [ -f "$STORAGE/windows.old" ]; then + MT=$(<"$STORAGE/windows.old") + if [[ "${MT,,}" == "pc-q35-2"* ]]; then + isXP="Y" + fi +fi + +if [[ "$isXP" == [Yy1]* ]]; then + # Enable NetBIOS on Windows XP + ! nmbd && nmbd --debug-stdout +else + # Enable Web Service Discovery + wsdd -i dockerbridge -p -n "host.lan" & +fi return 0