Skip to content

Setting up a TNFS Server

mozzwald edited this page Sep 10, 2023 · 2 revisions

Overview

One of FujiNet's core features is its ability to access system disk images from a TNFS server. We use a slightly updated version of the TNFSD server created for the Spectranet project. TNFS communicates over UDP Port 16384. Please see our fork of the project to build your own: https://github.com/FujiNetWIFI/spectranet

The TNFSD code found in the project's tnfs/tnfsd directory has been built and tested with current versions of Linux and Windows (using MSYS2). It should also build on macOS and BSD derivatives, although only minimal testing has been done outside Linux and Windows.

The project has current builds of the 64-bit Linux ("tnfsd") and 64-bit Windows ("tnfsd.exe") binaries included in the tnfs/tnfsd/bin directory.

Recent builds for Linux/RasPi/Mac/Windows can also be found on the FujiNet.online Download Page.

FujiNet has been tested accessing a TNFS server both on a local network and across the internet.

Setting up TNFS on Raspberry Pi or Linux

Easy

Steve Boswell (@a8bit) has produced a pre-made Raspberry Pi image, which automatically sets up a TNFS server. Simply follow the instructions here: https://atari8bit.net/projects/software/fujinet-tnfs-server-image/

Advanced

  • Install raspbian lite
  • Run raspi-config
  • Set your hostname.
  • Set gpu memory to 16MB
  • Enable SSH if wanted
  • Set locale/timezone
  • Enable/set WiFi in raspi-config if needed.
  • exit raspi-config
  • sudo -i
  • apt-get install git
  • apt-get install samba samba-common-bin
  • git clone https://github.com/FujiNetWIFI/spectranet.git
  • cd spectranet
  • cd tnfs/tnfsd
  • make OS=LINUX DEBUG=Y
  • sudo cp bin/tnfsd /usr/local/sbin
  • useradd -m tnfs
  • mkdir -p /tnfs
  • chown tnfs:tnfs /tnfs
  • create file /etc/systemd/system/tnfsd.service and add into it:
[Unit]
Description=TNFS Server
After=remote-fs.target
After=syslog.target

[Service]
User=tnfs
Group=tnfs
ExecStart=/usr/local/sbin/tnfsd /tnfs

[Install]
WantedBy=multi-user.target
  • edit /etc/samba/smb.conf and add to bottom:
[tnfs]
        path = /tnfs
        writeable = Yes
        create mask = 0777
        directory mask = 0777
        public = yes
        force user = tnfs
        force group = tnfs
  • systemctl daemon-reload
  • systemctl enable tnfsd
  • systemctl start tnfsd
  • systemctl restart smbd
  • verify that you can access the share on your tnfs from the desired hostname

Setting Up TNFS On Windows 10

Give your Windows 10 PC a machine name, static IP address, and other values appropriate for your network. Typically a private home network will be in the “192.168.x.x” range, but there are other private ranges as well.

Download the pre-compiled binary FujiNet version of the TNFSD server.
[https://fujinet.online/download)

(Optional) Note that you can find the custom FujiNet tnfsd source code on Github if you want to build it yourself (and customize it). https://github.com/FujiNetWIFI/spectranet/tree/master/tnfs/tnfsd

Create a folder on the Windows 10 box named “C:\tnfsd”. Put the downloaded tnfsd.exe file in this folder. This is the server software.

Create a folder on the Windows 10 box named “C:\tnfsroot”. This is where you would put subfolders and Atari 8-bit disk images, etc.

On the Windows 10 box, right click Start. Click Search and enter “Firewall”. Click on “Allow an app through firewall”. Click on “Change settings”, then click on “Allow another app…”. Click “Browse…” and browse to the “C:\tnfsd\tnfsd.exe” file and click “Open”, then click “Add”. Next to the newly added “tnfsd.exe” app, check both the “Private” and “Public” checkboxes.

Right click Start, then click Computer Management. Click Task Scheduler. Click Create a Basic Task. Name it “TNFSD”. Set the trigger to “When the computer starts”. Set the action to “Start a program”. Browse to the “C:\tnfsd\tnfsd.exe” file and give it an argument of “C:\tnfsroot”. Check “Open the Properties dialog for this task when I click Finish”. When the properties open, select “Run whether user is logged on or not”, and “Run with highest privileges”. Click “Ok”. Reboot.

At this point, the TNFS server should be set up for your internal network. You should be able to enter the IP address of the TNFS server into the Fujinet and be able to browse and load files from the “C:\tnfsroot” folder that exist on the Windows 10 PC.

Once you have your TNFS server working, lock it down. Create a new user that has read only access to the tnfsroot folder, then make that new user the user account that runs the task created above and uncheck "Run with highest privileges".

Setting Up TNFS On MacOS

Need Info

Allow TNFS Access to the World

To make your TNFS server available on the public internet, on your router, configure “Port Forwarding” for UDP 16384 to the IP address of the local TNFS host machine. If you have a domain name and it is configured to point to your external IP address, you should be good. If you do not have a domain name registered and configured, use https://whatismyipaddress.com/ to get your external IP address. To test from an external Fujinet device, enter either your domain name or external IP address into an external Fujinet and try to browse/load files from your TNFS server.

Clone this wiki locally