Bottles
Search…
Use system home
How to use the system home and not the sandboxed one
Warning, this procedure can expose your system (and therefore your personal files) to dangers, as we are going to break the Bottles sandbox.

What's the homedir?

Each user has a personal homedir (/home/your_username), this is the place when you can store your personal files, like videos, photos or documents. This path is also used for cache files .cache and software configurations .config.

How runners use my homedir?

Each runner when make a new windows prefix (we call these bottles here), create a similar Windows structure:
1
._ bottles/
2
|_ your_bottle/
3
|_ bottle.yml
4
|_ drive_c/
5
|_ ProgramData/
6
|_ Program Files/
7
|_ Program Files (x86)/
8
|_ users/
9
|_ Public/
10
|_ your_username/
11
|_ windows/
Copied!
It generate a folder in the users/ path, for the current logged in user (e.g. I'm currently logged as mirko, so the runner will create a mirko/ folder inside users/. It also create a Public folder but it is not our interest right now.
Each user folder contains some symlink to the original homedir:
1
..
2
|_ users/
3
|_ mirko
4
|_ AppData
5
|_ Contacts
6
|_ Desktop -> ~/Desktop
7
|_ Documents -> ~/Documents
8
|_ Downloads -> ~/Downloads
9
|_ Favorites
10
|_ Links
11
|_ Music -> ~/Music
12
|_ Pictures -> ~/Pictures
13
|_ Saved Games
14
|_ Searches
15
|_ Temp
16
|_ Videos -> ~/Videos
Copied!
So each program installed in the bottle, can see your files from the linked folders.

Sand-boxed userdir (homedir)

Starting from Bottles 2021.10.14, the userdir path is sand-boxed, so the above symlinks doesn't exists.
Creating a new bottle, Bottles detect if it is running under Flatpak, then remove these symlinks and make them as normal folders inside the bottle. As a result, each program can only works with files inside the sand-boxed userdir (sharable across programs).

How to revert this?

While this is a practice discouraged by Bottles and we take no responsibility for what may happen after exposing your homedir to the runner, there is a very simple way to do it.
First we need to expose the homedir to Bottles, giving it the right permission (read here how to achieve this). Once the homedir is exposed, get into a terminal and move to the Bottles flatpak path:
1
cd ~/.var/app/com.usebottles.bottles/data/bottles/bottles
Copied!
then find the bottle you want to give access to the homedir (e.g. it is called Testing in our case), so move to the userdir:
1
cd Testing/drive_c/users/your_username/ && ls -l
Copied!
remove the folders you want to expose (e.g. Documents):
1
rm -r Documents
Copied!
then recreate as symlink (e.g. for Documents):
1
ln -s ~/Documents Documents
Copied!
and this is all!
Last modified 8h ago