Skip to content

Instantly share code, notes, and snippets.

@tuliocll
Created January 2, 2024 14:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuliocll/48e14b49148ce9bba22a345c8bb0d687 to your computer and use it in GitHub Desktop.
Save tuliocll/48e14b49148ce9bba22a345c8bb0d687 to your computer and use it in GitHub Desktop.
Samba config for Open PS2 Loader (PlayStation 2) with password support
# This setup works pretty well for OPL with a network link that travels through
# two UniFi switches and connects to a Samba server running inside Docker. The
# host OS is Debian with a ZFS filesystem and the container OS is also Debian.
# Latest Samba (4.11+).
[global]
# ======================
# General Samba settings
# ======================
log level = 1
workgroup = WORKGROUP
server string = PS2 Samba Server
server role = standalone server
log file = /dev/stdout
max log size = 0
ntlm auth = yes
# Disable printers.
load printers = no
printing = bsd
printcap name = /etc/printcap
printcap cache time = 0
disable spoolss = yes
pam password change = yes
map to guest = bad user
usershare allow guests = yes
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
force user =
force group = users
# ===========================
# PlayStations 2 OPL settings
# ===========================
# Lower the minimum protocol to NT1 (a SMB1 dialect), this is required since
# Samba 4.11 changed the default and deprecated SMB1.
# See https://github.com/ifcaro/Open-PS2-Loader/issues/86 and
# https://github.com/ps2dev/ps2sdk/issues/72 for future SMB2 support.
server min protocol = NT1
server signing = disabled
smb encrypt = disabled
# Tweak socket options for lower delay. We also set TCP_KEEPIDLE to 20s which is
# about what it takes to reset the console and launch OPL, this avoids keeping
# file locks around for too long. We could try to optimize socket buffer sizes
# but Linux should do this automatically.
# TODO(mafredri): Do more testing with TCP_QUICKACK.
socket options = TCP_NODELAY TCP_KEEPIDLE=20 IPTOS_LOWDELAY SO_KEEPALIVE
# Disable keepalive to avoid hanging onto locks. Should not be needed
# due to SO_KEEPALIVE and helps with FMV audio stutter.
keepalive = 0
# ------------------------------------
# Attempt to speed up reads and writes
# ------------------------------------
# This setting only works for oplocked files but OPL doesn't oplock.
write cache size = 0
# Speed up directory listings.
getwd cache = yes
# Remove audio stutter in FMVs.
large readwrite = yes
# Disable asynchronous reads and writes.
aio read size = 0
aio write size = 0
# This might help with performance as the system doesn't need to check locks.
# OPL is the only client so we don't care about locks anyway.
strict locking = no
# ----------
# ZFS tuning
# ----------
# Don't listen to client requests for sync.
strict sync = no
# ZFS does not support preallocation (copy-on-write FS).
strict allocate = no
# Disable low-latency file operations for better performance.
read raw = no
write raw = no
# ----
# Misc
# ----
# Allow symlinks, useful for symlinking saves for multi-disk games.
follow symlinks = yes
[PS2]
comment = PlayStation 2
path = /media/user/DISK/PS2
browsable = yes
guest ok = yes
public = yes
available = yes
read only = no
veto files = /._*/.apdisk/.AppleDouble/.DS_Store/.TemporaryItems/.Trashes/desktop.ini/ehthumbs.db/Network Trash Folder/Temporary Items/Thumbs.db/
delete veto files = yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment