Gaming · 10 min read

How to Sandbox Windows Games on Linux: ClamAV, Proton and Bubblewrap

Scan Windows games with ClamAV, isolate Wine and Proton with Bubblewrap, and verify network isolation through real-world testing.

LinuxSecurityWineProtonBubblewrapHeroniteClamAV

An actual, tested approach to making your entirely legitimate Windows game collection a little less trusting.

A Windows game is an executable. A Linux desktop running Wine or Proton is still your desktop. Put those two facts together and the usual advice — “it's Windows malware, it can't hurt Linux” — starts to sound like a poor security policy.

This isn't an argument against Linux gaming, Wine, or game modding. It's an argument for least privilege: give an unknown executable the access it needs to run, rather than every file, network connection, and service your user account can access.

We worked through this on a CachyOS machine running KDE Plasma on Wayland, using ClamAV to inspect game folders and Heronite to launch games with per-game Bubblewrap isolation. We also verified the isolation while a game was running, rather than trusting that a checkbox meant what we hoped it meant.

The short version: antivirus helps identify known threats; sandboxing limits what an executable can do if the antivirus misses something. Neither is a guarantee, and they solve different problems.

What Wine and Proton do — and don't do

Wine and Proton provide Windows compatibility on Linux. They are not, on their own, general-purpose malware containment systems.

An unrestricted Wine program can potentially access parts of your Linux filesystem through Wine drive mappings, including directories readable or writable by your Linux account. Depending on how the program is launched, it may also have ordinary network access.

A Windows executable that does not behave correctly under Wine might fail harmlessly. But assuming all Windows malware is harmless on Linux is a gamble, especially when your machine also contains SSH keys, development workspaces, browser profiles, and credentials.

The right question is not simply “is this file infected?” It is also: “What would this process be allowed to touch if it were?”

The stack we used

LayerJobWhat it cannot guarantee
ClamAVScan downloaded executables, DLLs, archives, and other files against known signaturesA clean result does not establish that a file is safe
HeroniteManage individual Windows games and their Wine/Proton configurationIts sandbox must actually be enabled for each game
BubblewrapRestrict filesystem mounts, process namespaces, and networkingExposed host sockets, drivers, and vulnerabilities still matter
A dedicated Wine prefixKeep each game's Windows-like environment separateThe prefix itself remains writable and can be contaminated
KDE WaylandBetter separate native desktop applications from legacy X11 clientsXWayland clients sharing an X server can still interact

Heronite documents Linux sandboxing through Bubblewrap with a private home directory and network restrictions. This is a per-game option, not a reason to assume every new entry is protected automatically.

Step 1: Scan before launching

On CachyOS or another Arch-based system, install the relevant tools using your package manager. For example:

bash
sudo pacman -S --needed clamav bubblewrap
sudo freshclam

Then scan a directory recursively, keeping a timestamped log:

bash
GAME_DIR="$HOME/Games/Windows"
LOG="$HOME/clamav-games-$(date +%Y%m%d-%H%M%S).log"

clamscan \
  --recursive \
  --infected \
  --alert-exceeds-max=yes \
  --max-filesize=2048M \
  --max-scansize=2048M \
  --follow-dir-symlinks=0 \
  --follow-file-symlinks=0 \
  --log="$LOG" \
  "$GAME_DIR"

printf 'ClamAV exit status: %s\nLog: %s\n' "$?" "$LOG"

Replace GAME_DIR with your own folder. If you use fish rather than Bash, its variable assignment and exit-status syntax differs; the clamscan options are the same.

The useful pieces:

  • --recursive inspects subdirectories.
  • --infected shows detections rather than printing every scanned file.
  • --alert-exceeds-max=yes reports certain incomplete scans as Heuristics.Limits.Exceeded alerts.
  • The symlink options avoid wandering into unrelated directories through symlinks.
  • The log gives you a record to compare with later scans.

A size-limit alert is not proof of malware. It means you have a coverage problem to investigate. Very large files can exceed ClamAV's technical limits even when configured generously. Equally, an exit status of zero means no detections or reported errors under that scan configuration — not that every byte was proven harmless.

How to interpret a noisy detection list

Our test library contained repeated alerts for a bundled Visual C++ redistributable. On inspection, many copies had the exact same SHA-256 hash. That told us we were looking at one repeated file, not a different threat in every game folder.

We also encountered two older game executables with reports from several antivirus engines. The available reports did not prove they were malicious, but the signal was strong enough that we did not run those copies again and retired the files.

The practical workflow is:

  1. Record the exact detection name and path.
  2. Calculate the file's SHA-256 (sha256sum /path/to/file.exe).
  3. Look up the hash on VirusTotal before considering uploading the file itself. Uploaded files may be shared with security researchers; do not upload confidential or proprietary software without permission.
  4. Check the age of the analysis and whether independent engines agree.
  5. Don't create blanket antivirus exceptions simply because a game is supposed to work.

This is triage, not a mathematical “number of detections = probability of infection” exercise.

Step 2: Run games with least privilege

In Heronite, open the game's settings, go to Sandbox, and enable Run in a sandbox. Heronite's documentation says the game then runs through Bubblewrap with no network and no access to your home folder, with exceptions you can grant for the network or for specific folders. The exact options and wording can change between releases, so treat the list below as the capabilities to look for rather than literal menu labels. For an offline single-player game, start with:

  • Network access: none.
  • Game files: read-only where possible (our launch log, below, showed a read-only bind for the game directory).
  • Extra host folders: none.
  • Extra devices: none beyond what the game genuinely needs.
  • Wine prefix: unique to that game.

If a game needs extra permissions, add only what is necessary and re-evaluate its risk. A multiplayer game that genuinely needs internet access has a different threat model than an offline game.

Heronite's launcher logs can show the Bubblewrap arguments used for a real launch. In our test, they included:

text
--unshare-net
--ro-bind-try /path/to/game /path/to/game
--bind /path/to/private-sandbox-home /home/user
--setenv HERONITE_SANDBOX 1

That is stronger evidence than a screenshot of a settings toggle. The exact arguments and paths vary by machine and version.

Step 3: Verify that the game really cannot phone home

Here's where the investigation becomes much more interesting.

A game that has been told it has no network access might still open TCP or UDP sockets. An open socket is not the same as a successful internet connection. The real question is whether the game's network namespace contains usable interfaces and routes.

Find the game process while it is running:

bash
ps -eo pid,comm,args | grep -Ei 'wine|proton|\.exe' | head -40

Choose the PID of the game executable, not the Heronite launcher. Then inspect its namespace:

bash
PID=12345  # replace with your game's PID

printf 'Host namespace: '
readlink /proc/self/ns/net
printf 'Game namespace: '
readlink "/proc/$PID/ns/net"

sudo nsenter --target "$PID" --net -- ip -br addr
sudo nsenter --target "$PID" --net -- ip route
sudo nsenter --target "$PID" --net -- ss -tunap

In our real test, the host and game had different network namespace IDs. Inside the game's namespace, the only interface was loopback (127.0.0.1 and ::1), there was no default route, and there were no observed external connections.

Interestingly, Wine had a UDP socket and a TCP listener bound to 0.0.0.0:47584.

That could look alarming at first glance. But 0.0.0.0 means “all IPv4 interfaces in this namespace.” If the namespace has only loopback and no route to a physical or virtual network interface, that listener is not exposed to the household LAN through normal IP networking.

The result was meaningful: the game had no ordinary IP path to the internet or local network at the time of inspection. It was not a claim that the executable had never attempted a connection, nor that every possible communication channel was blocked.

Step 4: Verify filesystem isolation, too

Network isolation solves only part of the problem. Check the launch plan for a private replacement home directory, read-only game mounts, and the absence of extra writable host folders.

For a controlled smoke test, create a harmless canary file in your real home directory and try to access it from a benign Windows command shell launched under the same game's Heronite sandbox. In our test, the file could not be found from inside the sandbox.

A failed canary read is useful evidence, but not a full filesystem audit. Check the actual Bubblewrap bind mounts rather than assuming a prefix alone prevents access to the rest of your files.

The remaining problem: X11, XWayland, and desktop sockets

The test uncovered one meaningful residual risk. The Bubblewrap command still allowed access to the host X11 socket and authentication material.

X11 has historically permitted considerable interaction among applications connected to the same server. Running KDE on Wayland helps protect native Wayland applications, but XWayland applications that share a server are not isolated from each other merely because they're on a Wayland desktop.

Our practical precautions are:

  • Use a native Wayland desktop session.
  • Restrict Legacy X11 App Support input permissions in KDE, and review the application allowlist.
  • Prefer Wine's native Wayland path when supported and verify the resulting launch command; enabling an option does not necessarily remove a host X11 socket mount.
  • Consider a private XWayland server, for example through a carefully verified Gamescope configuration, for older games.
  • Avoid keeping sensitive legacy X11 applications open while testing less-trusted games.

This is a residual display and inter-process communication risk, not proof that a game accessed your password manager or keyboard.

What the results actually proved

We ended up with three different kinds of evidence:

  1. Antivirus results: one test game directory scanned 229 files with zero ClamAV detections. That is useful, but not a guarantee.
  2. Runtime containment: the actual game process had a distinct network namespace, loopback only, and no external route. That is direct evidence about its ordinary IP networking at the time.
  3. Incident follow-up: after investigating a separate suspicious game, the isolated Wine environment scanned clean and basic host persistence checks found no obvious anomalies. That is reassuring, but does not prove that compromise was impossible.

It's important not to turn any one of these results into an invented “100% safe” verdict.

A repeatable baseline

For an unfamiliar Windows game, our default is now scan → assess detections → sandbox → verify the actual process → retire anything suspicious.

If the file is genuinely concerning — particularly when several independent scanners identify a backdoor or file infector — don't use the sandbox as an excuse to run it anyway. Replace it from a trustworthy source or test it in a disposable, tightly restricted VM if you have a legitimate analysis need.

The broader lesson has nothing to do with games. The same thinking applies to vendor installers, customer-supplied project assets, creative-software plugins, and other third-party binaries: don't confuse a file that opens successfully with a file that deserves your trust.

Frequently asked questions

Does Proton automatically sandbox Windows malware?
No. Wine/Proton provides compatibility; OS-level containment is a separate control and depends on how the process is launched.

Can Windows malware steal Linux files through Wine?
Potentially. If the process can read host files through its runtime mappings and permissions, those files may be accessible regardless of the executable's original target platform.

Does 0.0.0.0 mean my game is exposed to the internet?
Not by itself. It refers to all interfaces in the process's current network namespace. Inspect that namespace's interfaces and routes.

Is a zero-detection ClamAV scan enough?
No. A clean scan only means the scanner did not report a known threat under the chosen limits and signatures.

Does running KDE Wayland eliminate X11 risks?
No. Native Wayland has stronger client separation, but games may still run through XWayland and share its X server with other X11 applications.


From games to production workstations: nCrypt applies the same least-privilege and verification principles to technical systems that businesses depend on. If you need a defined security, infrastructure, or workflow problem investigated and implemented, start with nCrypt.

Sources and further reading

Test environment: CachyOS, KDE Plasma Wayland, Heronite with Proton-CachyOS and Bubblewrap. Observations are from one configuration on 28 November 2026; behaviour can vary across software and versions.