From 02d11507957063a1f729f8eeea3e908427c78c0f Mon Sep 17 00:00:00 2001 From: Kroese Date: Tue, 18 Mar 2025 19:08:14 +0100 Subject: [PATCH] Update samba.sh --- src/samba.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/samba.sh b/src/samba.sh index 13fa4a5..2d96326 100644 --- a/src/samba.sh +++ b/src/samba.sh @@ -15,8 +15,7 @@ if [[ "$DHCP" == [Yy1]* ]]; then fi if [[ "${NETWORK,,}" == "user"* ]]; then - hostname="$IP" - interface="$VM_NET_DEV" + interface="127.0.0.1" fi addShare() { @@ -112,8 +111,14 @@ done if ! smbd; then error "Samba daemon failed to start!" smbd -i --debug-stdout || true +else + if [[ "${NETWORK,,}" == "user"* ]]; then + NET_OPTS="${NET_OPTS/,hostfwd/,guestfwd=tcp:${VM_NET_IP%.*}.1:445-tcp:127.0.0.1:445,hostfwd}" + fi fi +[[ "${NETWORK,,}" == "user"* ]] && return 0 + if [[ "${BOOT_MODE:-}" == "windows_legacy" ]]; then # Enable NetBIOS on Windows 7 and lower if ! nmbd; then