Close

Network servers on a phone

A project log for UNIX workstation on a phone

Not just running Linux on it, but finding a user input solution.

lion-mclionheadlion mclionhead 05/08/2020 at 20:100 Comments

NFSD & HTTPD are key requirements in making a phone useful.  Of course, if a phone has NFSD, it doesn't need HTTPD.

Using a phone's wifi for network services is theoretically ideal, but after 8 years of using a web server on a phone's wifi, the experience has been pretty bad.  The mane problems are the phone's wifi constantly going down, the phone constantly restarting the server, & the phone server sometimes being very slow.  IOS won't even allow a server to run in the background.  Phones turn their wifi off based on inactivity & tethering, despite the icon showing it on.  A typical lion commute involves enabling tethering twice a day, then switching between 2 access points, so servers on phone wifi have constantly changing addresses & require a lot of fenegling to connect to.


A practical phone based server needs to be accessed through ADB.  ADB itself supports a network device, but not on crippled phones.  PPP over ADB, ADB over TCP are all disabled, too.

Its only option is redirecting the stdio of ADB to a kernel driver on the host & running a user space network program on the phone.  The user space network program would forward packets to the phone's kernel.  The host would look like a local application on the phone.   It would not want to run the NFS server & web server itself because that loses the standard socket interface for connecting programs.

There's still a user space NFSD, https://github.com/unfs3/unfs3

Then, an ordinary text editor, compiler, or media player on the host could access files on the phone like a normal disk.

ADB allows automatically running a program & reading stdout, but not writing stdin.  It would take some magic to run adb shell with stdio redirected to a program on the host.

Discussions