Gekko_Dekko: ...does anybody there use bubblewrap with wine/native games as an alternative way to lock permissions (will it be access to third party files, processes or network)? If yes - can you, please, share some examples to use as reference?
Gekko_Dekko: ...And if you've meant firejail - iirc it actually uses bubblewrap for sandboxing purposes.
Gekko_Dekko: ...how to make games work without mounting whole root partition as read-only.
Often it's easiest to simply run the application as another user or group with restricted permissions.
For example, when I don't want games to "phone home" I use
sg to run them as my current user but with a specified "nonet" primary group (of which my user is already a member). I simply set up an
iptables rule to disallow internet access to the "nonet" group -- something like this
From scratch, assuming my user name is "xixas" and the game is Mirror's Edge: # sudo groupadd nonet
# sudo usermod -a -G nonet xixas
# sudo iptables -A OUTPUT -m owner --gid-owner nonet -j REJECT
# sg nonet 'wine /home/xixas/Games/mirrors-edge/drive_c/GOG Games/Mirror's Edge/Binaries/MirrorsEdge.exe'
Of course, you'd want to save your firewall rules somewhere with
iptables-save. And note that it's better to REJECT than to DROP, otherwise some applications will freeze waiting on a response.
Going a similar route, you could alternately use
setuid or
setgid on the executable to maintain the user or group state -- or if you're using wine you set aside a dedicated wine binary for gaming.
A lot of the time people turn to tools like chroot/bubblewrap/firejail/docker to sandbox things far beyond what is required.