====== Rclone Google Drive Integration with KDE ======
This guide provides instructions for setting up and mounting a Google Drive remote using **rclone**, optimized for integration with the KDE desktop environment and its file manager, Dolphin. The configuration is robust for continuous desktop use, leveraging FUSE and rclone's VFS cache.
===== 1. Prerequisites and Installation =====
Ensure **rclone** and the necessary FUSE tools are installed. On most modern Linux systems, you will need `fuse3`.
# Example for Debian/Ubuntu (adapt as necessary for your distribution)
sudo apt update
sudo apt install rclone fuse3
===== 2. Configure the Google Drive Remote =====
Run the interactive rclone configuration tool to link your Google Drive account.
rclone config
Follow the prompts:
* Choose **n** for New remote.
* Name the remote (e.g., `Google Drive`). Since your original command used `Google Drive`, maintain that name or use backslashes when calling it.
* Select the storage type (**drive** for Google Drive).
* Follow the on-screen steps for **OAuth authentication**. When prompted, select **y** for auto-config if running on a desktop, which will open your browser for authentication.
* Confirm the settings with **y** and exit the configuration with **q**.
===== 3. FUSE Configuration for System Integration =====
To allow desktop applications (like Dolphin) to reliably access the mount created by your user, the security-sensitive [[https://rclone.org/rc/rclone/#allow-other|--allow-other]] option must be permitted system-wide.
1. Edit the main FUSE configuration file with superuser privileges:
sudo nano /etc/fuse.conf
2. Uncomment the line by removing the leading `#` character:
user_allow_other
3. Save the file and close the editor.
===== 4. Mount the Drive (Daemonized) =====
Create a local mount point and run the final mount command. The following options ensure stable desktop use:
* **`--allow-other`**: Required for non-mounting applications (KDE, Dolphin) to access the FUSE mount.
* **`--vfs-cache-mode full`**: Caches file data locally, necessary for random access reads/writes by desktop applications and reliability.
* **`--daemon`**: Runs the process in the background, freeing the terminal.
1. Create the mount directory (if it doesn't already exist):
mkdir -p ~/gdrive
2. Execute the mount command:
rclone mount "Google Drive": ~/gdrive \
--allow-other \
--dir-cache-time 72h \
--poll-interval 15s \
--vfs-cache-mode full \
--daemon
Note: The quotes are necessary around "Google Drive:" due to the space in the remote name.
The Google Drive contents are now accessible at `~/gdrive` in Dolphin.
===== 5. Unmounting and Automation =====
==== Unmounting ====
To cleanly stop the background mount process and unmount the directory, use `fusermount`:
fusermount -uz ~/gdrive
==== Automation (Optional) ====
For persistence across reboots, the recommended method is to set up a **systemd user unit**. This ensures the mount is started automatically under your user account when you log into your KDE session. Consult your distribution's documentation on creating a `~/.config/systemd/user/rclone-gdrive.service` file for this purpose.