Update setting-up-a-shared-folder.md#87
Merged
aleasto merged 1 commit intowaydroid:masterfrom Jan 23, 2026
Merged
Conversation
added bindfs mount option
|
Please merge this! it could have saved me hours of research |
|
Here's how you do a bi-directional mount using bindfs. I would appreciate if this guide could be added too. This is useful for allowing waydroid to write files into your linux host. For example, if we want to link our host First get the UID waydroid uses for folders. export WAYDROID_ID=$(sudo stat -c '%u' ~/.local/share/waydroid/data/media)next, we can use a command like this to mount a linux folder into waydroid. sudo bindfs \
--perms=u=rwx,g=rwx,o=rx \
--force-group=$WAYDROID_ID \
~/LINUX_HOST_FOLDER \
~/.local/share/waydroid/data/media/0/WAYDROID_FOLDERBash script version (Click to reveal)#!/usr/bin/env bash
# Exit on errors
set -e
# Usage check
if [ $# -ne 2 ]; then
echo "Usage: $0 <host_folder> <waydroid_subfolder>"
exit 1
fi
HOST_FOLDER="$1"
WAYDROID_SUB="$2"
WAYDROID_BASE="$HOME/.local/share/waydroid/data/media/0"
TARGET_FOLDER="$WAYDROID_BASE/$WAYDROID_SUB"
# Check host folder exists
if [ ! -d "$HOST_FOLDER" ]; then
echo "Error: Host folder '$HOST_FOLDER' does not exist"
exit 1
fi
# Detect Waydroid UID dynamically
if ! WAYDROID_UID=$(sudo stat -c '%u' "$WAYDROID_BASE" 2>/dev/null); then
echo "Error: Could not determine Waydroid UID from '$WAYDROID_BASE'"
exit 1
fi
# Create target folder if it doesn't exist
sudo mkdir -p "$TARGET_FOLDER"
# Perform the bindfs mount
sudo bindfs \
--perms=u=rwx,g=rwx,o=rx \
--force-group="$WAYDROID_UID" \
"$HOST_FOLDER" \
"$TARGET_FOLDER"
echo "Mounted '$HOST_FOLDER' → '$TARGET_FOLDER' with Waydroid UID $WAYDROID_UID"Usage# Allows waydroid to access host ~/Downloads folder. it will be available as Download inside of waydroid's filesystem
./bind-to-waydroid.sh ~/Downloads Download |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
added bindfs mount option