Albert's homepage

Disposable SMB shares: how to wirelessly exchange files between iOS and Linux devices

While Arch Linux is my preferred OS for Personal Computers, my mobile device is an iPhone SE 1st Gen. Without any apps installed it's a perfectly fine dumb phone, which is just what I need.

Exchanging files with an iOS device works smoothly using libimobiledevice. However, it requires to use a cable each time you want do it. I found it tedious, so I decided to look for a wireless solution.

After some digging I found out, that the Files app in iOS >= 13 supports SMB. Since I didn't want to bother with configuring SAMBA system-wide and bring another package to my Arch Linux installation, I decided to go with disposable SMB shares. Here is how I do it.

Requirements

Linux side

Create a SMB share:

$ mkdir -p /tmp/ios && cd /tmp/ios

$ sudo systemctl start docker && sudo docker run --name="docker-smb" \
    -d --rm --entrypoint "" \
    -p 445:445 \
    -e "USER=samba" -e "PASS=secret" \
    -v `pwd`:/storage dockurr/samba \
    bash -c "echo vfs objects = fruit streams_xattr >> /etc/samba/smb.default && samba.sh"

Dispose the share when done:

$ sudo docker stop docker-smb

iOS side

At the first time you'll need to configure the server in the Files app:

Files Configuration - initiate Files Configuration - enter IP address of the server Files Configuration - set credentials Files Configuration - complete

NOTE: Remember to set Name/Password as samba/secret.

After that you'll be able to send using Share button and receive using the Files app:

Files Send - Share button dialog Files Send - choose server Files Receive using the Files app