Skip to content

Sharing files and folders

Coder of Salvation / Leon van Kammen edited this page Mar 23, 2018 · 8 revisions

Sharing files and folders between ChromeOS and your chroot

The /etc/crouton/shares file in your chroot defines directories to map into the chroot from the host.
Order is important: be sure to mount directories before you mount subdirectories of those mounts.

Outside the chroot, the only directories that can be mapped are subdirectories of the following locations:

  • downloads: ~/Downloads
  • shared: /mnt/stateful_partition/crouton/shared
  • encrypted: ~/crouton/shared

Inside the chroot, any absolute or user-relative path (~/x or ~user/x) is OK. Using a path that already exists in the chroot will result in that path being overmounted and difficult to access.

Syntax is as follows:

HOSTDIR CHROOTDIR [OPTIONS]

Directory names can have spaces (if quoted), but no quote characters or relative path elements (..'s).
Options can be any fstab-like options to mount. If unspecified, "exec" is assumed.

Examples:

Share a home directory encrypted by the current user's unsynced profile

encrypted/home ~

Share an unencrypted directory between chroots.

shared/home ~/Share

Absolute directories on the chroot side work too

shared/bin /usr/local/bin exec,suid

Share a noexec path that has spaces, and a specific user home directory

"encrypted/stupid example" "~omg/Why are you even doing this?" noexec

Expose the whole chroot to chromeos

WARNING: dont delete things unless you want to delete them.

Most chrome-apps don't allow access to the home-folder (only USB and Downloads-folder) The simplest workaround is:

  1. buy a tiny usb stick and plug it into your chromebook:
  2. create an empty directory on it, called 'crouton'
  3. then enter your crouton chroot, and run this command:
mount --bind / /media/removable/YOURUSBDISK/crouton

TODO automation using fstab

Clone this wiki locally