NOTE: This guide has mostly been replaced by this Magisk module. I suggest you install it instead of messing around with the guide below!
Ever since Plex Cloud was retired last year, I’ve been searching for a good way to replace its functionality on my Shield PMS. While others have suggested either switching servers or using a VPS, none of those solutions fit the equipment I have or my small use-case to read and play 2TB+ of movies uploaded to the cloud by 2 to 4 people at once.
This solution works great. Real-world tests have movies loading in 5 seconds and media scans taking 3 to 8 seconds per file on a 400/25 Mbps connection. Seeking takes less than 5 seconds (you might be able to improve this via the --vfs options in rclone). Transcoding and remote playback also work here, but I don’t think the shield can handle more than 2 concurrent streams with rclone mount. Prove me wrong!
Ultimately, until integrating a direct connection with Google Drive gets implemented in the Plex back-end, the solution here is a working, but far from ideal measure to play media from the cloud on the Shield. The (1) overhead from Android’s implementation of FUSE, (2) Android’s SELinux permissions, and (3) the sheer time required prevents this from being optimal.
Below is the guide: I welcome feedback! I recommend you have some familiarity with linux and the console.
1 Root the shield using Magisk
2 Install Termux via Google Play
pkg install tsu nano rclone ssh- setup ssh (allows
ssh -p 8022 your.shield.ip)
2a)nano $PREFIX/etc/ssh/sshd_configand addPermitRootLogin yes(if you put sshd into your startup script below)… I highly recommend you enter these commands through ssh as it makes it way easier than typing stuff into the android keyboard.
2b) if you do not use ssh and instead use termux to enter the commands, be sure to puttsubefore all your commands
3 Install fbind via Magisk Manager > Modules
4 Install fusermount for Android
adb push fusermountmv fusermount /data/data/com.termux/files/usr/binchmod 700 fusermount-
cd /data/data/com.termux/files/usr/bin && ls -al(will show your Termux UID) chown {your termux UID} fusermount
5 Setup rclone and other directories
-
nano $HOME/.config/rclone/rclone.conf:
(you should probably setup rclone throughrclone configand you can do this through ssh or Termux)
[yourmount]
type = drive
scope = drive
client_id =
client_secret =
token =
-
mkdir /storage/emulated/0/Drive
all apps will be able to see this directory as the front for your rclone mount -
mkdir /storage/emulated/0/.mount
this is your fbind mount point, which is automatically replicated in /data/media/0/.mount and is your ghost mount point that will be bound to the Drive directory… it provides a funnel from the root permissions in /data/media/0/Drive to the readable directory at /storage/emulated/0/Drive -
mkdir /storage/emulated/0/temp(optional)
6 Execute the commands to start the mount and fbind:
tsu
rclone mount gdrive: /data/media/0/Drive \
--buffer-size 32M \
--vfs-cache-mode minimal \
--vfs-cache-max-size 4G \
--vfs-read-chunk-size 64M \
--dir-cache-time 72h \
--allow-other \
--allow-non-empty \
--fast-list \
--use-mmap \
--log-level INFO \
--log-file=/storage/emulated/0/temp/rclone-mount.log \
--daemon
-
su
fbind -b /data/media/0/.mount /data/media/0/Drive
7 Your mount should be readable by Plex at Internal Storage > Drive > root drive directory
8 To stop:
-
tsu
fusermount -uz /data/media/0/Drive -
su
fbind -u /data/media/0/.mount
9 Setup a Magisk boot script to automate rclone mount on Shield startup
nano /sbin/.magisk/img/.core/service.d/startup.sh- copy the below script to the file (same
rclone mountcommand as above):
script
#!/system/bin/sh
export PREFIX=/data/data/com.termux/files/usr
export HOME=/data/data/com.termux/files/home
export PATH=${PREFIX}/bin:${PREFIX}/bin/applets:$PATH
export LD_LIBRARY_PATH=${PREFIX}/lib:$LD_LIBRARY_PATH
sleep 15 # wait for final checks while Magisk boots
sshd -p 22
rclone mount gdrive: /data/media/0/Drive \
--buffer-size 32M \
--vfs-cache-mode minimal \
--vfs-cache-max-size 4G \
--vfs-read-chunk-size 64M \
--dir-cache-time 72h \
--allow-other \
--allow-non-empty \
--fast-list \
--use-mmap \
--log-level INFO \
--log-file=/storage/emulated/0/temp/rclone-mount.log \
--daemon
## Additional items for startup
# sleep 60 # wait for external drive to mount before transmission starts, and then set it as a low priority
# nice -n 15 transmission-daemon --log-error -e '/storage/emulated/0/temp/transmission-daemon.log'
-
chmod +x /sbin/.magisk/img/.core/service.d/startup.sh
10 A few notes:
-
I used to have an external drive, but that’s no longer needed since this can be run direct off the shield’s internal memory and storage with --vfs-cache. While an external drive is easier to manage under NVIDIA_SHIELD since it’s writable and can be connected to the Shield’s Samba server, your rclone drive mount will not work there because of Android’s weird permissions. It also is not optimal when using with
--vfs-cache-mode. vfs makes sense because you can manage the size of the cache which is stored in memory and not use any of the 16GB internal shield storage. If you need write access (--vfs-cache-mode minimalmeans rclone will download the file to disc if you are doing RW operations) you can control the size of the file with--vfs-cache-max-size. You will not be able to manage the rclone mount storage via the traditional methods. However,--vfs-cache-mode minimalenables deleting files with Plex. Checkout the rclone forums for more rclone related settings. -
Play around with the rclone mount settings, especially the
--vfs-cache-mode. I tried to optimize as much as possible given the Shield is memory constrained and the vfs-cache is memory intensive. Let me know if you find better settings specific for the Shield. -
Setup your own client_id in rclone to avoid some of the rate limiter bans that may prevent you from streaming smoothly.
-
This solution is only recommended for video media, although I use it with music too and don’t experience many problems.

(400Mbps down / 25 Mbps up).