mirror of
https://github.com/dockur/windows.git
synced 2025-10-27 11:25:49 +00:00
fix: Samba for user-mode networking (#1132)
This commit is contained in:
parent
f454fa7b34
commit
a3a2b3fb09
3 changed files with 18 additions and 0 deletions
10
src/samba.sh
10
src/samba.sh
|
|
@ -14,6 +14,10 @@ if [[ "$DHCP" == [Yy1]* ]]; then
|
|||
interface="$VM_NET_DEV"
|
||||
fi
|
||||
|
||||
if [[ "${NETWORK,,}" == "user"* ]]; then
|
||||
interface="127.0.0.1"
|
||||
fi
|
||||
|
||||
addShare() {
|
||||
local dir="$1"
|
||||
local name="$2"
|
||||
|
|
@ -107,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue