protonscr

How to isolating games so that they could never touch my $HOME folder?

steamopen
ValveSoftware/steam-for-linux#10898 · opened 2024-05-15 by Neutron3529 · updated 2024-06-08 · 3 comments · github
NNeutron3529 2024-05-15 github

Your system information

  • Steam client version (build number or date): Startup - updater built May 13 2024 21:00:30
  • Distribution (e.g. Ubuntu): Arch Linux
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes
  • Steam Logs: steam-logs.tar.gz
  • GPU: Nvidia

Please describe your issue in as much detail as possible:

I want to isolate the game from my $HOME folder, enforce them using a new home folder, I make several attempts, all of them either have some shortcoming or failed to execute.

I have noticed that, steam have some sandbox tools, but I don't know how to use them.

Steps for reproducing this issue:

The most recent attemp is that, using export HOME=/me/fakehome before steam is launched.
This makes several game using the fakehome folder as its home, but there are many games (e.g., Factorio, Feud) which still write ~/.factorio or ~/.pref rather than /me/fakehome/*

I also tried export PRESSURE_VESSEL_HOME=/me/fakehome, wish the pressure-vessel-wrap could using the new home rather than the real home, but it also fails. Factorio still tried to access my HOME folder.

An ancient attempt is that, using sandboxes like bubblewrap to isolate the steam client, but it have a disadvantage:
I have a program which use nvml library to tuning the mem frequency and gpu clock while playing games.
This program have a suid bit which grants the ability to control the graphical cards. Unfortuantely, bubblewrap erase the owner to nobody, thus the program become a normal program, could no longer tuning the gpu clocks.

Hhubertnnn 2024-05-16 github

Have you tried the export HOME before installing the game, or just before starting it?
Its possible that wineprefix already has symlinks pointing to your old $HOME created during game installation.

Mmajor-gnuisance 2024-05-26 github

The most recent attemp is that, using export HOME=/me/fakehome before steam is launched. This makes several game using the fakehome folder as its home, but there are many games (e.g., Factorio, Feud) which still write ~/.factorio or ~/.pref rather than /me/fakehome/*

My hunch for those is that they are guessing your home location based on the username.

Think something like:
factorio_dir=/home/$USER/.factorio

Instead of:
factorio_dir=$HOME/.factorio

Maybe you can trick it into behaving correctly by manipulating the USER environment variable.
Maybe with USER=../../me/fakehome :rofl:

TTurmfalke2 2024-06-08 github

In dota this is possible using PRESSURE_VESSEL_SHARE_HOME=0 in the launch options.

Nothing extracted yet.