Rclone, samba, headless vm, cannot mount with selinux enabled

Hello friends. Reading many threads that are just touching on the issues that I'm having and I am making best efforts to incorporate all of that feedback. Still coming up short regardless. Very appreciative of any help that can be provided

What is the problem you are having with rclone?

Running a Proxmox server with multiple VMs and looking to have a single headless Almalinux VM to capture all of my cloud storage and share via Samba. SMB shares are working and accessible, but as soon as I rclone mount to the cloud storage provider SMB loses access to the subdirectory within that share. (if I have a separate 'test' subdirectory within that share as a control, no issues with reading/writing).

Run the command 'rclone version' and share the full output of the command.

rclone v1.64.2

  • os/version: almalinux 9.3 (64 bit)
  • os/kernel: 5.14.0-362.8.1.el9_3.x86_64 (x86_64)
  • os/type: linux
  • os/arch: amd64
  • go/version: go1.21.3
  • go/linking: static
  • go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Multiple, let's say Google Drive for this example

rclone mount gdrive: /mnt/driveshare/G/ --vfs-cache-mode full --daemon --allow-other --allow-root

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX
team_drive =

A log from the command that you were trying to run with the -vv flag

DEBUG : rclone: Version "v1.64.2" starting with parameters ["rclone" "mount" "gdrive:" "/mnt/driveshare/G/" "--vfs-cache-mode" "full" "--daemon" "--allow-other" "--allow-root" "-vv"]
DEBUG : Creating backend with remote "gdrive:"
DEBUG : Using config file from "/home/XXXXX/.config/rclone/rclone.conf"
DEBUG : Google drive root '': 'root_folder_id = XXXXXXXXXXX' - save this in the config to speed up startup
DEBUG : rclone: Version "v1.64.2" finishing with parameters ["/usr/bin/rclone" "mount" "gdrive:" "/mnt/driveshare/G/" "--vfs-cache-mode" "full" "--daemon" "--allow-other" "--allow-root" "-vv"]

Relevant portion of the SMB conf attached

        path = /mnt/driveshare
        browsable = yes
        writable = yes
        create mask=0777
        directory mask=0777
        guest ok = no
        read only = no

In the environment, imagine the directory structure including /mnt/driveshare/G for the GDrive mount and /mnt/driveshare/test for the control.

Sharing works across all devices on my network including windows. I am able to read an empty G drive prior to rclone mount, and can read/write without issues to the /test subdir. As soon as I issue the rclone mount action as listed above, I will lose access.

I have found a workaround which allows the mounted rclone directory to be accessible if I disable SELINUX. While that was a great breakthrough for me in getting this operational, my preference would be not to have to resort to permanently disabling it. I would appreciate any suggestions on what I may be missing in order to have this work. Thanks for your support!

I think it is a problem for SELINUX community to advice unless somebody here has similar experience and found solution already...

IMO SELINUX does not like some aspect of such configuration.. If it was me I would try to change the way how I run mount - try if it works without daemon. Also might be worth to stop SMB, restart rclone mount and only then start SMB again - at the moment I think rclone mount starts over already running SMB which might be red flag for SELINUX.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.