Skip to content

Instantly share code, notes, and snippets.

@tinue
Last active July 25, 2024 08:04
Show Gist options
  • Save tinue/9d9ce9c09e9e771169b27f6d0e859c4e to your computer and use it in GitHub Desktop.
Save tinue/9d9ce9c09e9e771169b27f6d0e859c4e to your computer and use it in GitHub Desktop.
Simple file server for old retro clients, based on Samba / Raspberry Pi

Retro File Server

A common challenge with retro machines is transferring data from and to it. If the retro machine has an Ethernet adapter that can be enabled, then sharing data via a file server is a good solution for this challenge.
Unfortunately, these old systems use protocols that are dangerous and thus disabled on any modern file server, such as a NAS. Usually, these protocols can be re-enabled on a NAS, but I would advise against doing this.

Instead, this Gist shows how a dedicated Raspberry Pi can be used to make a file server that supports all of these old protocols.

A word of caution: Because these protocols are dangerous, never expose the Raspberry Pi to the internet! You will most likely immediately catch a trojan, and your Pi will be used to spam out mail or become part of a botnet for denial of service attacks.
Use the Pi only in your intranet, without any port forwarding, and only to perform the dedicated task of a retro file server.

Raspberry Pi Setup

Goal: Setup a Raspberry Pi with Samba, configured such that very old clients (such as OS/2 Warp, DOS or Windows 95) can access the shares. Because such a server is insecure anyway, allow access without authentication for any user including "guest".

Setup

Start with a fresh image of Raspberry Pi OS Lite. Perform the usual initial setup (apt update/upgrade, set host name, set timezone etc.). Then:

  • Create the shared data directory and allow unrestricted access to it: sudo mkdir /media/retro && sudo chmod 777 /media/retro
  • Install Samba: sudo apt -y install samba samba-common-bin.
  • Edit /etc/samba/smb.conf:
# Global settings
[global]
   workgroup = WORKGROUP
   # Set the netbios name to "retro" regardless of the server's name. This seems to work better for OS/2 clients.
   netbios name = retro
   # Enable logging
   log file = /var/log/samba/log.%m
   max log size = 1000
   logging = file
   server string = File server for retro clients
   # This is the default, it means that the Raspberry Pi handles security on its own.
   security = user
   # Allow the insecure v1 protocol
   ntlm auth = ntlmv1-permitted
   # Allow the very old LANMAN1 protocol, used e.g. by OS/2 or DOS.
   server min protocol = LANMAN1
   # Also allow the authentication protocols used by LANMAN1. Even allow plaintext auth.
   lanman auth = Yes
   client lanman auth = Yes
   client plaintext auth = Yes
   # Unknown ("bad") users are mapped to "nobody"
   map to guest = Bad User
   guest account = nobody

# Define the share named "retro"
[retro]
   comment = Shared data for guests
   path = /media/retro
   writable = yes
   printable = no
   # Regardless of the user that actually connects, always use "pi" when accessing files on the share.
   force user = pi
   # New files are read/write for the owner (pi), and read for the rest
   create mask = 0644
   # New directories are read/write and browsable for pi, and read/browsable for others
   directory mask = 0755
   # Allow guest access, and non-authenticated access
   public = yes
   guest ok = yes
  • Start samba: sudo systemctl start nmbd
  • Check if it is running: sudo systemctl status nmbd
  • Note: When I first wrote this guide, after the above steps, the Raspberry Pi created a server with its hostname as the SMB name. This is wrong! It should have used the name from smb.conf ("retro"). After a reboot, the correct name was used. With the Raspberry Pi OS of October 30, 2021, this no longer happened. So: If in doubt, do a reboot after the installation.

Client Setup

To do: Add notes for various clients. I could successfully connect anything I tried: OS/2 Warp 4.52, Windows NT 4.0, Windows 2000, Windows XP, and Windows 98. Windows 98 did not want to launch executables directly from the server, and I had to copy the files to the local disk first.
To write files to the server, use any modern client, such as a Mac with MacOS 12, or a PC with Windows 10/11.

History

  • 2021-12-23: Fix minor typos; Retest guide for Raspberry Pi OS based on Debian version 11 (bullseye)
@tinue
Copy link
Author

tinue commented May 20, 2023

Thanks for your comment. On the Windows 98 machine I installed a dubious "all in one" fix package, which might be the reason that I can't directly execute files from the share. Good to hear that it works in your case.
Unfortunately the old protocols are on their way out in Samba. As of v4.17, LANMAN is no longer there, and it looks like Debian 12 will use this version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment