Containing Chrome on Debian 13 workstation
user: I'm interested to run Chrome browser in on my Debian 13 workstation, but I would like it contained or restricted from doing much of anything with the internal working of the Debian 13 operating system and security of my laptop. Do you have suggestions or input on this?
assistant: Yes — good instinct 👍. Running Chrome in a **restricted / contained environment** on Debian 13 is a solid way to protect your workstation. Chrome is fast and feature-rich, but it’s also proprietary, closed-source, and tends to want deep system integration. You can keep it under control by isolating it. Here are a few approaches (from lighter to stronger containment):
---
### 1. **Firejail (lightweight sandboxing)**
- Firejail uses Linux namespaces and seccomp to confine applications.
- Very simple to apply:
```bash
apt install firejail
firejail google-chrome-stable
```
- Benefits: restricts filesystem access, blocks access to hidden files, limits networking if configured.
- Can be combined with AppArmor profiles for even tighter security.
---
### 2. **Flatpak / Snap (containerized packaging)**
- If you install Chrome via **Flatpak** or **Snap**, it runs with stricter sandboxing by default.
- Flatpak especially gives you granular control over permissions with `flatpak override`.
- For example, install Chromium via Flatpak:
```bash
apt install flatpak
flatpak install flathub org.chromium.Chromium
```
- Downside: Chrome itself (Google’s branded build) isn’t on Flathub, but Chromium is.
---
### 3. **Chroot / systemd-nspawn (medium isolation)**
- You can create a **minimal Debian chroot** (or use `debootstrap`) and run Chrome inside it.
- Run with:
```bash
systemd-nspawn -D /srv/chrome-chroot
```
- This keeps Chrome away from your main filesystem while still being lighter than a full VM.
---
### 4. **QEMU/KVM Virtual Machine (full isolation)**
- Install Chrome inside a VM (QEMU/KVM + virt-manager).
- Completely separates Chrome from your host.
- Strongest security, but heavier on resources.
---
### 5. **Bubblewrap / bwrap (custom sandboxing)**
- Similar to Firejail but more configurable.
- Often used under the hood by Flatpak.
- Example sandbox:
```bash
bwrap --ro-bind /usr /usr \
--ro-bind …
user: its mostly for compatibility or but also I'd like to use it whilst utilizing Googles services and using ChatGPT with as well.
assistant: Got it 👍 — so Chrome would be your “secondary browser” mainly for:
- **Compatibility** (sites that require Chrome specifically).
- **Google services** (Gmail, Drive, Meet, etc.).
- **ChatGPT** (where you don’t want to mix it with your primary browser sessions).
That means you want Chrome accessible but **not able to poke around the rest of Debian 13**.
Here’s what I’d suggest for *your exact use case*:
---
### 🔹 Best Balance: Firejail with Chrome
- **Pros**: Lightweight, runs natively, no VM overhead.
- **Cons**: Not as strong as a full VM.
Steps:
```bash
apt install firejail
firejail --private google-chrome-stable
```
- `--private` gives Chrome a **fresh home directory every run** (no history, no cookies saved unless you explicitly allow it).
- You can create a **persistent private profile** if you *do* want bookmarks and saved passwords:
```bash
firejail --private=~/chrome-profile google-chrome-stable
```
- This way Chrome only sees `~/chrome-profile` and nothing else in your system.
---
### 🔹 Alternative: Chromium Flatpak
- Install via Flathub:
```bash
flatpak install flathub org.chromium.Chromium
```
- Benefits: auto-updates, sandbox by default, permission control with:
```bash
flatpak override org.chromium.Chromium --nofilesystem=host
flatpak override org.chromium.Chromium --unshare=network
```
- Downside: it’s **Chromium** (no Google-proprietary features like Widevine DRM unless added).
---
### 🔹 Paranoid Mode: Run Chrome in a VM
- Create a **QEMU/KVM VM** with minimal Debian or Fedora, install Chrome inside.
- You can snapshot and reset as needed.
- Best for isolating Google logins completely.
- But uses more resources (RAM/CPU).
---
✅ Recommendation for you:
Since you’ll actually *use* Chrome (Google accounts + ChatGPT), the sweet spot is **Firejail with a persistent private profile**. That way it feels like a normal browser, but it can’t see the rest of your laptop. If you want *absolu…
user: yes, lets go with the firejail solution, put a script together
assistant: Awesome—let’s lock Chrome down with Firejail and give you two launchers:
- **Chrome (Strict)** → max isolation for sketchy sites/testing
- **Chrome (Google Services)** → still sandboxed, but with the bits Google needs (DBus, camera/mic optional)
I’ll give you a **single-line** create-make-run flow (your preferred style) that drops a full setup script in your home directory, installs what’s needed, and puts wrappers + desktop entries in place.
---
### One-liner to create, chmod, and run the setup script
```bash
nano ~/firejail-chrome-setup.sh && chmod +x ~/firejail-chrome-setup.sh && ~/firejail-chrome-setup.sh
```
### Paste this into the editor, save, exit, and the one-liner will run it
```bash
#!/usr/bin/env bash
set -euo pipefail
# =========================
# Chrome + Firejail setup
# Debian 13 (Trixie)
# Creates two launchers:
# - chrome-strict
# - chrome-google
# =========================
EMOJI_OK="✅"
EMOJI_RUN="🚀"
EMOJI_INFO="ℹ️"
EMOJI_WARN="⚠️"
EMOJI_LOCK="🔒"
# ---------- sanity checks ----------
if [[ $EUID -ne 0 ]]; then
echo "$EMOJI_WARN Please run as root (you prefer root over sudo). Aborting."
exit 1
fi
# Detect the primary non-root user/home (best-effort)
TARGET_USER="${SUDO_USER:-$(logname 2>/dev/null || echo "")}"
if [[ -z "${TARGET_USER}" || "${TARGET_USER}" == "root" ]]; then
# Fallback to the first real user with a home under /home
TARGET_USER="$(ls /home 2>/dev/null | head -n1 || true)"
fi
if [[ -z "${TARGET_USER}" ]]; then
echo "$EMOJI_WARN Could not determine non-root user. Using root's home."
TARGET_USER="root"
TARGET_HOME="/root"
else
TARGET_HOME="/home/${TARGET_USER}"
fi
echo "$EMOJI_INFO Using user: ${TARGET_USER} home: ${TARGET_HOME}"
# ---------- install packages ----------
echo "$EMOJI_RUN Installing Firejail (and profiles) …"
apt-get update -y
apt-get install -y firejail firejail-profiles apparmor apparmor-utils
# ---------- optional: enable firecfg for system-wide .desktop integration ----------
# W…
user: I just tried to launch Chrome from my app launcher but nothing happens
adam@laptop:~$ su -
Password:
root@laptop:~# nano ~/firejail-chrome-setup.sh && chmod +x ~/firejail-chrome-setup.sh && ~/firejail-chrome-setup.sh
ℹ Using user: adam home: /home/adam
🚀 Installing Firejail (and profiles) …
Get:1 http://security.debian.org/debian-security trixie-security InRelease [43.4 kB]
Hit:2 https://deb.nodesource.com/node_22.x nodistro InRelease
Get:3 http://security.debian.org/debian-security trixie-security/main Sources [41.6 kB]
Get:4 http://security.debian.org/debian-security trixie-security/main amd64 Packages [40.4 kB]
Get:5 https://deb.opera.com/opera-stable stable InRelease [2,416 B]
Get:6 http://security.debian.org/debian-security trixie-security/main Translation-en [27.0 kB]
Hit:7 http://deb.debian.org/debian trixie InRelease
Get:8 http://deb.debian.org/debian trixie-updates InRelease [47.3 kB]
Get:9 https://brave-browser-apt-release.s3.brave.com stable InRelease [7,547 B]
Get:10 https://brave-browser-apt-release.s3.brave.com stable/main amd64 Packages [24.0 kB]
Get:11 https://brave-browser-apt-release.s3.brave.com stable/main arm64 Packages [24.0 kB]
Get:12 https://deb.opera.com/opera-stable stable/non-free amd64 Packages [1,157 B]
Fetched 259 kB in 3s (75.3 kB/s)
Reading package lists... Done
W: https://deb.nodesource.com/node_22.x/dists/nodistro/InRelease: Policy will reject signature within a year, see --audit for details
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apparmor is already the newest version (4.1.0-1).
apparmor set to manually installed.
The following package was automatically installed and is no longer required:
linux-image-6.12.38+deb13-amd64
Use 'apt autoremove' to remove it.
The following additional packages will be installed:
python3-apparmor python3-libapparmor
Suggested packages:
vim-addon-manager
The following NEW packages will be installed:
apparmor-utils firejail firejail…
assistant: Thanks for the full log — the script ran successfully, created the wrappers and the `.desktop` files, but the fact that nothing happens when you launch from the menu usually means one of these:
---
### 1. **Google Chrome package not installed**
The wrappers point to `/usr/bin/google-chrome-stable`. If that binary doesn’t exist, nothing will start.
Check with:
```bash
which google-chrome-stable
```
If it says *not found*, you need to install Chrome first:
```bash
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
apt install ./google-chrome-stable_current_amd64.deb
```
---
### 2. **Wrong binary name**
On some Debian installs, the binary may be called `google-chrome` instead of `google-chrome-stable`.
Check with:
```bash
ls /usr/bin/google-chrome*
```
If you see `/usr/bin/google-chrome` but not `google-chrome-stable`, edit the wrappers:
```bash
nano /usr/local/bin/chrome-strict
nano /usr/local/bin/chrome-google
```
…and replace `/usr/bin/google-chrome-stable` with `/usr/bin/google-chrome`.
---
### 3. **Desktop cache not refreshed**
Sometimes `.desktop` entries don’t show until the cache is rebuilt. Run:
```bash
update-desktop-database ~/.local/share/applications
```
Then log out/in or run `chrome-strict` manually from terminal to confirm.
---
### 4. **Sandbox blocking too much**
If Chrome binary exists but still doesn’t launch, try running from terminal to see the error:
```bash
chrome-strict
```
or
```bash
chrome-google
```
If Firejail denies something, you’ll get output like “cannot access /etc/…” which we can relax.
---
👉 Suggestion: first check **if Chrome is actually installed** (`which google-chrome-stable`).
Do you want me to modify the script so it **auto-installs Chrome** if missing and adjusts the wrapper automatically to the correct binary?
user: Chrome was not installed. I didn't think I had to mention the obvious. So now I need you to give me the commands to install it. I want Google Chrome to use their own Primary and Secondary Google DNS servers, so include that if you can
assistant: Got it 👍 — makes sense. Let’s install **Google Chrome Stable** on Debian 13 and make sure it uses **Google DNS (8.8.8.8 + 8.8.4.4)** inside the Firejail sandbox.
---
### 1. Add Google’s signing key + repo
```bash
wget -q -O- https://dl.google.com/linux/linux_signing_key.pub | gpg --dearmor -o /usr/share/keyrings/google-chrome.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome.gpg] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
apt update
```
---
### 2. Install Chrome Stable
```bash
apt install google-chrome-stable -y
```
This gives you `/usr/bin/google-chrome-stable`.
---
### 3. Adjust Firejail wrappers for Google DNS
Your wrappers from earlier defaulted to **Cloudflare (1.1.1.1) + Quad9 (9.9.9.9)**.
Let’s edit them to **Google DNS** instead:
```bash
sed -i 's/--dns=1.1.1.1 --dns=9.9.9.9/--dns=8.8.8.8 --dns=8.8.4.4/' /usr/local/bin/chrome-strict
sed -i 's/--dns=1.1.1.1 --dns=9.9.9.9/--dns=8.8.8.8 --dns=8.8.4.4/' /usr/local/bin/chrome-google
```
---
### 4. Test it
Launch from terminal to verify:
```bash
chrome-google
```
or
```bash
chrome-strict
```
Inside the browser, go to:
```
chrome://dns
```
and you should see it resolving via Google’s DNS.
---
👉 Do you want me to also **force Chrome to ignore system DNS** and *always* use 8.8.8.8/8.8.4.4, even outside Firejail, by adding a Chromium flag (`--host-resolver-rules`)? That way you’re guaranteed Google DNS regardless of system config.
user: yes
assistant: Perfect 👍 — we’ll hard-wire Chrome to always use **Google DNS (8.8.8.8 + 8.8.4.4)**, even if your system resolver is different.
That’s done with the Chromium flag:
```
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost"
--dns-over-https-servers=https://dns.google/dns-query
```
This forces all non-localhost DNS lookups through Google’s DNS.
---
### 1. Edit both Firejail wrappers
Run this to patch them in one shot:
```bash
sed -i '/google-chrome-stable/ s|"$@"|--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" --dns-over-https-servers=https://dns.google/dns-query "$@"|' /usr/local/bin/chrome-strict
sed -i '/google-chrome-stable/ s|"$@"|--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" --dns-over-https-servers=https://dns.google/dns-query "$@"|' /usr/local/bin/chrome-google
```
---
### 2. Double-check the wrappers
Example tail of `/usr/local/bin/chrome-google` should now look like this:
```bash
/usr/bin/google-chrome-stable --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query "$@"
```
---
### 3. Test it
From terminal:
```bash
chrome-google
```
Inside Chrome, visit:
```
chrome://net-internals/#dns
```
- You should see lookups going out via **8.8.8.8 / 8.8.4.4**.
- You can also run:
```bash
firejail --noprofile --netfilter=default dig google.com @8.8.8.8
```
to confirm your sandbox DNS path.
---
✅ At this point:
- **All Chrome traffic in Firejail → Google DNS only.**
- Doesn’t matter what `/etc/resolv.conf` or systemd-resolved is doing.
---
Do you want me to also **block all other DNS servers** at the sandbox level (iptables/netfilter), so even if Chrome tried to bypass, it could *only* talk to 8.8.8.8/8.8.4.4?
user: Installing:
google-chrome-stable
Summary:
Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 27
Download size: 121 MB
Space needed: 396 MB / 54.6 GB available
Get:1 http://dl.google.com/linux/chrome/deb stable/main amd64 google-chrome-stable amd64 140.0.7339.185-1 [121 MB]
Fetched 121 MB in 1min 2s (1,946 kB/s)
Selecting previously unselected package google-chrome-stable.
(Reading database ... 501208 files and directories currently installed.)
Preparing to unpack .../google-chrome-stable_140.0.7339.185-1_amd64.deb ...
Unpacking google-chrome-stable (140.0.7339.185-1) ...
Setting up google-chrome-stable (140.0.7339.185-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
Processing triggers for gnome-menus (3.36.0-3) ...
Processing triggers for mate-menus (1.26.1-1) ...
Processing triggers for man-db (2.13.1-1) ...
Processing triggers for mailcap (3.74) ...
Processing triggers for desktop-file-utils (0.28-1) ...
root@laptop:~# sed -i 's/--dns=1.1.1.1 --dns=9.9.9.9/--dns=8.8.8.8 --dns=8.8.4.4/' /usr/local/bin/chrome-strict
sed -i 's/--dns=1.1.1.1 --dns=9.9.9.9/--dns=8.8.8.8 --dns=8.8.4.4/' /usr/local/bin/chrome-google
root@laptop:~# exit
logout
adam@laptop:~$ chrome-google
Error: seccomp already enabled
adam@laptop:~$
assistant: Nice — Chrome is installed correctly 🎉, but that **“Error: seccomp already enabled”** means Firejail is being asked to enable seccomp twice.
That happened because:
- The **system-wide Firejail profile** for `google-chrome` (`/etc/firejail/google-chrome.profile`) already enables seccomp.
- Your wrapper also adds `--seccomp`.
- Firejail complains when seccomp is activated twice.
---
### ✅ Fix: Remove the redundant `--seccomp` flag from your wrappers
Run this to clean both wrappers:
```bash
sudo sed -i 's/--seccomp //g' /usr/local/bin/chrome-strict
sudo sed -i 's/--seccomp //g' /usr/local/bin/chrome-google
```
---
### 🔎 Check wrapper endings
After the fix, the final exec line in `/usr/local/bin/chrome-google` should look like:
```bash
/usr/bin/google-chrome-stable --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query "$@"
```
---
### 🚀 Try again
Now launch:
```bash
chrome-google
```
or from the menu: **Chrome (Google Services Sandbox)**.
---
Would you also like me to **add a Firejail netfilter ruleset** so the sandbox can *only* connect to `8.8.8.8` and `8.8.4.4` for DNS, and block all other DNS servers? That would hard-lock Chrome into Google DNS at the network level too.
user: i tried to launch it from my app launcher and still nothing happens
adam@laptop:~$ su -
Password:
root@laptop:~# sudo sed -i 's/--seccomp //g' /usr/local/bin/chrome-strict
sudo sed -i 's/--seccomp //g' /usr/local/bin/chrome-google
root@laptop:~# cat /usr/local/bin/chrome-google
#!/usr/bin/env bash
# 🔒 Chrome (Google Services) via Firejail
# - Allows DBus so keyring/portal bits work
# - Allows camera/mic if you pass --device flags (commented examples below)
exec firejail \
--quiet \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/google" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
--whitelist="/home/adam/Downloads" \
# To permit webcam/mic uncomment one or both of these lines:
# --device=video0 \
# --allow-pulseaudio \
/usr/bin/google-chrome-stable --no-first-run --new-window "$@"
root@laptop:~#
assistant: You actually hit a subtle bash gotcha in the wrapper: we left a `\` line-continuation right before some **commented lines**. In a GUI launch, that makes the whole `exec firejail ...` command malformed → nothing happens. Let’s fix the wrappers (and also tighten them up a bit so they’re reliable).
Run these as **root**:
```bash
# --- Rewrite /usr/local/bin/chrome-google (clean, no broken continuations) ---
cat > /usr/local/bin/chrome-google <<'EOF'
#!/usr/bin/env bash
# Chrome (Google Services) via Firejail
# Sandboxed, allows keyring/portals; Google DNS forced (DoH), private profile.
exec firejail \
--quiet \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/google" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
--whitelist="/home/adam/Downloads" \
/usr/bin/google-chrome-stable --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-google
# --- Rewrite /usr/local/bin/chrome-strict (no /tmp blacklist, still tight) ---
cat > /usr/local/bin/chrome-strict <<'EOF'
#!/usr/bin/env bash
# Chrome (Strict) via Firejail
# Maximum isolation for sketchy sites/testing; private, no DBus, no 3D.
exec firejail \
--quiet \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/strict" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--nodbus \
--no3d \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
/usr/bin/google-chrome-stable --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-strict
# Rebuild your local desktop launcher…
user: I should exit root before I do that right? or open a new terminal window?
assistant: Exactly 👍 — once you’ve rewritten the wrappers as **root**, you should exit back to your normal user (`adam`) before testing.
So the flow is:
1. Do the `cat > /usr/local/bin/...` fixes **as root** (because those files live in `/usr/local/bin`).
2. When done, run:
```bash
exit
```
to drop back to your `adam@laptop` shell.
3. Now test the launchers as your normal user:
```bash
chrome-google
chrome-strict
```
(This way they run inside your user’s sandbox, not as root.)
No need for a whole new terminal window — just `exit` is fine.
👉 Do you want me to also give you the exact commands to re-test from the GUI menu once you’re back as `adam`?
user: root@laptop:~# exit
logout
adam@laptop:~$ chrome-strict
Error: networking feature is disabled in Firejail configuration file /etc/firejail/firejail.config
adam@laptop:~$ chrome-google
Error: networking feature is disabled in Firejail configuration file /etc/firejail/firejail.config
adam@laptop:~$
assistant: Ah, now we’re getting somewhere ✅
That error means Firejail has **networking disabled globally** in its main config file `/etc/firejail/firejail.config`. By default, Debian ships with very conservative defaults — looks like `netfilter` and `dns` sandboxing are locked out.
---
### 🔧 Fix: enable networking features in Firejail
Open the config as root:
```bash
nano /etc/firejail/firejail.config
```
Look for these lines (near the top):
```ini
# Networking support
netfilter no
dns no
```
Change them to:
```ini
netfilter yes
dns yes
```
Save and exit.
---
### 🌀 Restart Firejail
Apply the new config (no service restart needed, just pick up the changes):
```bash
firejail --version
```
(That forces Firejail to re-read its configs.)
---
### 🚀 Try again
As your `adam` user:
```bash
chrome-google
chrome-strict
```
They should now open the browser, with DNS locked to 8.8.8.8/8.8.4.4 and sandboxing intact.
---
👉 Do you want me to also prep a **custom netfilter ruleset** (in `/etc/firejail/chrome-google.net`) that **only allows DNS to 8.8.8.8 + 8.8.4.4 and HTTPS to the wider internet**? That would make the sandbox *bulletproof*: Chrome can’t leak to your LAN or other DNS servers.
user: i dont see it, can you just tell me what the firejail.config file should look like for what we are trying to do
root@laptop:~# cat /etc/firejail/firejail.config
# This is Firejail system-wide configuration file. The file contains
# keyword-argument pairs, one per line. Most features are enabled by default.
# Use 'yes' or 'no' as configuration values.
# Allow programs to display a tray icon (warning: allows escaping the sandbox;
# see https://github.com/netblue30/firejail/discussions/4053)
# allow-tray no
# Enable AppArmor functionality, default enabled.
# apparmor yes
# Number of ARP probes sent when assigning an IP address for --net option,
# default 2. This is a partial implementation of RFC 5227. A 0.5 seconds
# timeout is implemented for each probe. Increase this number to 4 if your
# local layer 2 network uses RSTP (IEEE 802.1w). Permitted values are
# between 1 and 30.
# arp-probes 2
# Enable or disable bind support, default enabled.
# bind yes
# Allow (DRM) execution in browsers, default disabled.
# browser-allow-drm no
# Disable U2F in browsers, default enabled.
# browser-disable-u2f yes
# Enable or disable chroot support, default disabled
# chroot no
# Enable or disable dbus handling, default enabled.
# dbus yes
# Disable /mnt, /media, /run/mount and /run/media access. By default access
# to these directories is enabled. Unlike --disable-mnt profile option this
# cannot be overridden by --noblacklist or --ignore.
# disable-mnt no
# Enable or disable file transfer support, default enabled.
# file-transfer yes
# Enable Firejail green prompt in terminal, default disabled
# firejail-prompt no
# Force use of nonewprivs. This mitigates the possibility of
# a user abusing firejail's features to trick a privileged (suid
# or file capabilities) process into loading code or configuration
# that is partially under their control. Default disabled.
# force-nonewprivs no
# Allow sandbox joining as a regular user, default enabled.
# root user can always joi…
assistant: Thanks for pasting the whole file 👍 — I see what’s happening.
In your `/etc/firejail/firejail.config`, the **`restricted-network yes`** line is enabled, while **`network yes`** is commented.
That combination means:
- Networking is considered “restricted”.
- Regular users (like `adam`) can only use `--net=none`.
- So when our wrappers try `--netfilter` and `--dns`, Firejail blocks them → *“networking feature is disabled”*.
---
### ✅ Recommended config for your use case
Since you want Chrome sandboxed **with networking and custom DNS**, you should explicitly allow networking and keep netfilter/dns features available.
Edit as root:
```bash
nano /etc/firejail/firejail.config
```
Change these lines:
```ini
# Enable or disable networking features, default enabled.
network yes
# Enable or disable restricted network support, default disabled.
restricted-network no
```
Leave the rest alone. Save and exit.
---
### 🔄 Apply changes
No daemon restart needed; Firejail reads this each run. Just test:
```bash
exit # if still root
chrome-google
```
---
### 🚀 Result
- `chrome-google` and `chrome-strict` should now launch fine.
- They’ll be sandboxed, use Google DNS (8.8.8.8 + 8.8.4.4), and obey your whitelist rules.
---
👉 Do you want me to also draft a **minimal netfilter ruleset** (`/etc/firejail/chrome-google.net`) so Chrome can only:
- resolve via Google DNS,
- and access the wider internet (80/443),
while blocking all LAN IP ranges? This would stop Chrome from ever touching your router or local devices.
user: adam@laptop:~$ chrome-google
Error: no suitable /usr/bin/google-chrome-stable executable found
assistant: Good catch. Firejail is complaining because `/usr/bin/google-chrome-stable` is a **shell launcher script**, and the stock Firejail profile for Chrome expects to wrap a real ELF binary. Easiest fix: point our wrappers to Chrome’s **real binary** at `/opt/google/chrome/chrome`.
Do this as **root**:
```bash
# 1) Verify both files exist (just to see it)
ls -l /usr/bin/google-chrome-stable /opt/google/chrome/chrome
# 2) Rewrite both wrappers to call the real binary
cat > /usr/local/bin/chrome-google <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/google" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
--whitelist="/home/adam/Downloads" \
/opt/google/chrome/chrome --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-google
cat > /usr/local/bin/chrome-strict <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/strict" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--nodbus \
--no3d \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
/opt/google/chrome/chrome --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-strict
```
If you haven’t already, ensure Firejail allows networking for non-root:
```bash
# In /etc/firejail/firejail.config set:
# network yes
# restricted-network no
# (uncomment/change those lines), then save.
```
Now drop back to your user and test:
```bash
exit # if you're still roo…
assistant: Thanks for the screenshot and terminal output — that clears it up.
The problem is that Firejail says:
```
Error: no suitable /opt/google/chrome/chrome executable found
```
But Chrome *should* be there. Let’s verify what exactly got installed:
---
### 1. Check Chrome’s installed paths
Run this:
```bash
ls -l /opt/google/chrome/
ls -l /usr/bin/google-chrome*
```
This will show if the real binary is under `/opt/google/chrome/` (normal) or if Debian packaged it differently.
---
### 2. Confirm which binary works
Try running directly:
```bash
/opt/google/chrome/chrome --version
/usr/bin/google-chrome-stable --version
/usr/bin/google-chrome --version
```
At least one should print the version (e.g., `Google Chrome 140.0...`).
---
### 3. Adjust the wrapper
Whichever one actually works, we’ll put into `/usr/local/bin/chrome-google` and `/usr/local/bin/chrome-strict`.
Example fix if `/usr/bin/google-chrome-stable` works:
```bash
sudo sed -i 's|/opt/google/chrome/chrome|/usr/bin/google-chrome-stable|' /usr/local/bin/chrome-*
```
---
So let’s first run step 1 + 2 (the `ls` and `--version` tests). That will tell us where the real binary is hiding, and we’ll point the wrappers there.
👉 Can you paste the output of those checks?
user: actually, i stop after your 2nd step to show you what I have so far
adam@laptop:~$ ls -l /opt/google/chrome/
total 320732
-rwxr-xr-x 1 root root 269180120 Sep 16 21:08 chrome
-rw-r--r-- 1 root root 1012846 Sep 16 21:08 chrome_100_percent.pak
-rw-r--r-- 1 root root 1899584 Sep 16 21:08 chrome_200_percent.pak
-rwxr-xr-x 1 root root 1971784 Sep 16 21:08 chrome_crashpad_handler
-rwxr-xr-x 1 root root 4352832 Sep 16 21:08 chrome-management-service
-rwsr-xr-x 1 root root 15328 Sep 16 21:08 chrome-sandbox
-rw-r--r-- 1 root root 7 Sep 16 21:08 CHROME_VERSION_EXTRA
drwxr-xr-x 2 root root 4096 Sep 18 14:15 cron
-rw-r--r-- 1 root root 482 Sep 16 21:08 default-app-block
drwxr-xr-x 2 root root 4096 Sep 18 14:15 default_apps
-rwxr-xr-x 1 root root 1585 Sep 16 21:08 google-chrome
-rw-r--r-- 1 root root 10467680 Sep 16 21:08 icudtl.dat
-rw-r--r-- 1 root root 244288 Sep 16 21:08 libEGL.so
-rw-r--r-- 1 root root 6548568 Sep 16 21:08 libGLESv2.so
-rw-r--r-- 1 root root 14581536 Sep 16 21:08 liboptimization_guide_internal.so
-rw-r--r-- 1 root root 26672 Sep 16 21:08 libqt5_shim.so
-rw-r--r-- 1 root root 28992 Sep 16 21:08 libqt6_shim.so
-rw-r--r-- 1 root root 4146672 Sep 16 21:08 libvk_swiftshader.so
-rw-r--r-- 1 root root 608816 Sep 16 21:08 libvulkan.so.1
drwxr-xr-x 2 root root 12288 Sep 18 14:15 locales
drwxr-xr-x 2 root root 4096 Sep 18 14:15 MEIPreload
drwxr-xr-x 2 root root 4096 Sep 18 14:15 PrivacySandboxAttestationsPreloaded
-rw-r--r-- 1 root root 10577 Sep 16 21:08 product_logo_128.png
-rw-r--r-- 1 root root 787 Sep 16 21:08 product_logo_16.png
-rw-r--r-- 1 root root 1281 Sep 16 21:08 product_logo_24.png
-rw-r--r-- 1 root root 38037 Sep 16 21:08 product_logo_256.png
-rw-r--r-- 1 root root 1810 Sep 16 21:08 product_logo_32.png
-rw-r--r-- 1 root root 7611 Sep 16 21:08 product_logo_32.xpm
-rw-r--r-- 1 root root 3095 Sep 16 21:08 product_logo_48.png
-rw-r--…
assistant: You’re super close. Firejail is refusing the Chrome binary because the **Chrome profile uses `private-bin`** (whitelists which executables may launch). When the target binary isn’t in that list, you get:
```
Error: no suitable /opt/google/chrome/chrome executable found
```
### Quick fix (recommended): ignore the `private-bin` rule
Patch both wrappers to tell Firejail to ignore that directive:
```bash
sudo sed -i 's|--profile=/etc/firejail/google-chrome.profile|--profile=/etc/firejail/google-chrome.profile --ignore=private-bin|' /usr/local/bin/chrome-google
sudo sed -i 's|--profile=/etc/firejail/google-chrome.profile|--profile=/etc/firejail/google-chrome.profile --ignore=private-bin|' /usr/local/bin/chrome-strict
```
Now try:
```bash
chrome-google
# or
chrome-strict
```
### If you prefer not to use `--ignore`
You can **extend the profile** instead, allowing Chrome’s real binary path:
```bash
mkdir -p ~/.config/firejail
# Append to your local profile overlay:
printf 'noblacklist /opt/google/chrome\nprivate-bin /opt/google/chrome/chrome\n' >> ~/.config/firejail/google-chrome.local
```
(Then remove `--ignore=private-bin` from the wrappers if you go this route.)
### Sanity checks (only if it still balks)
- Confirm networking is allowed for users in `/etc/firejail/firejail.config`:
```
network yes
restricted-network no
```
- Verify the binary runs outside Firejail (you already did, and it does):
```
/opt/google/chrome/chrome --version
```
- Try launching verbosely once to see any other denial:
```
firejail --debug --trace /opt/google/chrome/chrome --version
```
If you want, I can also drop in an **optional netfilter ruleset** to block all RFC1918/LAN access and allow only DNS to 8.8.8.8/8.8.4.4 plus web (80/443).
user: adam@laptop:~$ su -
Password:
root@laptop:~# sudo sed -i 's|--profile=/etc/firejail/google-chrome.profile|--profile=/etc/firejail/google-chrome.profile --ignore=private-bin|' /usr/local/bin/chrome-google
sudo sed -i 's|--profile=/etc/firejail/google-chrome.profile|--profile=/etc/firejail/google-chrome.profile --ignore=private-bin|' /usr/local/bin/chrome-strict
root@laptop:~# exit
logout
adam@laptop:~$ chrome-google
Error: please use --profile after --ignore
adam@laptop:~$ chrome-strict
Error: please use --profile after --ignore
adam@laptop:~$
assistant: Yep—that message is from Firejail’s arg parser: **`--ignore` must come *before* `--profile`**. Let’s fix both wrappers by rewriting them with the correct order.
Run as **root**:
```bash
cat > /usr/local/bin/chrome-google <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--ignore=private-bin \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/google" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
--whitelist="/home/adam/Downloads" \
/opt/google/chrome/chrome --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-google
cat > /usr/local/bin/chrome-strict <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--ignore=private-bin \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/strict" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--nodbus \
--no3d \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
/opt/google/chrome/chrome --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-strict
```
Then drop back to your user and test:
```bash
exit
chrome-google
# or
chrome-strict
```
If anything still complains, run once to see verbose errors:
```bash
firejail --debug --trace --ignore=private-bin --profile=/etc/firejail/google-chrome.profile /opt/google/chrome/chrome --version
```
(But the corrected order should do it.)
user: Cannot access .local file globals.local: No such file or directory, skipping...
Found chromium-common.profile profile in /etc/firejail directory
Reading profile /etc/firejail/chromium-common.profile
Cannot access .local file chromium-common.local: No such file or directory, skipping...
Found whitelist-run-common.inc profile in /etc/firejail directory
Reading profile /etc/firejail/whitelist-run-common.inc
Cannot access .local file whitelist-run-common.local: No such file or directory, skipping...
conditional BROWSER_DISABLE_U2F, nou2f
conditional BROWSER_DISABLE_U2F, private-dev
Found blink-common.profile profile in /etc/firejail directory
Reading profile /etc/firejail/blink-common.profile
Cannot access .local file blink-common.local: No such file or directory, skipping...
Found disable-common.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-common.inc
Cannot access .local file disable-common.local: No such file or directory, skipping...
Found disable-devel.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-devel.inc
Cannot access .local file disable-devel.local: No such file or directory, skipping...
Found disable-exec.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-exec.inc
Cannot access .local file disable-exec.local: No such file or directory, skipping...
Found disable-interpreters.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-interpreters.inc
Cannot access .local file disable-interpreters.local: No such file or directory, skipping...
Found disable-programs.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-programs.inc
Cannot access .local file disable-programs.local: No such file or directory, skipping...
Found disable-xdg.inc profile in /etc/firejail directory
Reading profile /etc/firejail/disable-xdg.inc
Cannot access .local file disable-xdg.local: No such file or directory, skipping...
Found whitelist-common.inc profile …
user: the verbose output is too large to paste here
assistant: Boom — your debug log shows the smoking gun:
> **Disable /opt**
The stock Firejail Chrome profile **blacklists `/opt`**, so when we try to run the real binary at `/opt/google/chrome/chrome`, it disappears inside the sandbox. That’s why you saw “no suitable … executable found”.
Fix = allow `/opt` and (since we’re calling the real binary) bypass the `private-bin` constraint.
### Patch both wrappers (as root)
```bash
cat > /usr/local/bin/chrome-google <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--ignore=private-bin \
--noblacklist=/opt \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/google" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
--whitelist="/home/adam/Downloads" \
/opt/google/chrome/chrome --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-google
cat > /usr/local/bin/chrome-strict <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--ignore=private-bin \
--noblacklist=/opt \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/strict" \
--private-cache \
--nonewprivs --caps.drop=all --noroot \
--nodbus \
--no3d \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
/opt/google/chrome/chrome --no-first-run --new-window \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-strict
```
### Test (as your normal user)
```bash
exit # if you’re still root
chrome-google
# or
chrome-strict
```
If you want to sanity-check first, run a dry run with version only:
```bash
firejail --quiet --ignore=private-bin --noblacklist…
user: after I applied your changes, now I see this:
adam@laptop:~$ chrome-google
[0918/160211.734686:WARNING:chrome/app/chrome_main_linux.cc:82] Read channel stable from /opt/google/chrome/CHROME_VERSION_EXTRA
[3:3:0918/160211.800307:FATAL:sandbox/linux/services/credentials.cc:134] Check failed: . : Permission denied (13)
[0918/160211.803755:ERROR:third_party/crashpad/crashpad/util/linux/scoped_ptrace_attach.cc:27] ptrace: Operation not permitted (1)
adam@laptop:~$ firejail --quiet --ignore=private-bin --noblacklist=/opt \
--profile=/etc/firejail/google-chrome.profile \
/opt/google/chrome/chrome --version
[0918/160220.035209:WARNING:chrome/app/chrome_main_linux.cc:82] Read channel stable from /opt/google/chrome/CHROME_VERSION_EXTRA
Google Chrome 140.0.7339.185
adam@laptop:~$
assistant: That crash is Chrome’s **setuid sandbox** failing inside Firejail:
```
FATAL ... credentials.cc:134 Permission denied
```
Firejail (and our wrapper’s `--nonewprivs`) prevents the setuid helper from working. The clean fix is to make Chrome use its **unprivileged user-namespace sandbox** instead.
### 1) Add `--disable-setuid-sandbox` to both wrappers
Run as root:
```bash
# google launcher
sed -i 's|/opt/google/chrome/chrome --no-first-run|/opt/google/chrome/chrome --disable-setuid-sandbox --no-first-run|' /usr/local/bin/chrome-google
# strict launcher
sed -i 's|/opt/google/chrome/chrome --no-first-run|/opt/google/chrome/chrome --disable-setuid-sandbox --no-first-run|' /usr/local/bin/chrome-strict
```
### 2) Ensure user namespaces are enabled (usually true on Debian 13)
Still as root, check:
```bash
sysctl kernel.unprivileged_userns_clone
# if it prints kernel.unprivileged_userns_clone = 0, enable it:
sysctl -w kernel.unprivileged_userns_clone=1
printf 'kernel.unprivileged_userns_clone=1\n' >/etc/sysctl.d/99-userns.conf
```
### 3) Test as your normal user
```bash
exit # if you’re root
chrome-google # should launch
# or
chrome-strict
```
If anything *still* complains, try one quick sanity check:
```bash
firejail --quiet --ignore=private-bin --noblacklist=/opt \
--profile=/etc/firejail/google-chrome.profile \
/opt/google/chrome/chrome --disable-setuid-sandbox --version
```
You should see the Chrome version without the fatal error.
---
Want me to lock in a **netfilter ruleset** next (block all LAN ranges; allow only DNS to 8.8.8.8/8.8.4.4 and web ports 80/443)? It’s a nice final hardening step.
user: adam@laptop:~$ su -
Password:
root@laptop:~# # google launcher
sed -i 's|/opt/google/chrome/chrome --no-first-run|/opt/google/chrome/chrome --disable-setuid-sandbox --no-first-run|' /usr/local/bin/chrome-google
root@laptop:~# # strict launcher
sed -i 's|/opt/google/chrome/chrome --no-first-run|/opt/google/chrome/chrome --disable-setuid-sandbox --no-first-run|' /usr/local/bin/chrome-strict
root@laptop:~# sysctl kernel.unprivileged_userns_clone
kernel.unprivileged_userns_clone = 1
root@laptop:~# exit
logout
adam@laptop:~$ chrome-google
[0918/160739.064300:WARNING:chrome/app/chrome_main_linux.cc:82] Read channel stable from /opt/google/chrome/CHROME_VERSION_EXTRA
[3:3:0918/160739.111127:FATAL:sandbox/linux/services/credentials.cc:134] Check failed: . : Permission denied (13)
[0918/160739.112252:ERROR:third_party/crashpad/crashpad/util/linux/scoped_ptrace_attach.cc:27] ptrace: Operation not permitted (1)
adam@laptop:~$ chrome-strict
[0918/160745.099125:WARNING:chrome/app/chrome_main_linux.cc:82] Read channel stable from /opt/google/chrome/CHROME_VERSION_EXTRA
[10:10:0918/160745.109717:FATAL:sandbox/linux/services/credentials.cc:134] Check failed: . : Permission denied (13)
[0918/160745.109944:ERROR:third_party/crashpad/crashpad/util/linux/scoped_ptrace_attach.cc:27] ptrace: Operation not permitted (1)
adam@laptop:~$ firejail --quiet --ignore=private-bin --noblacklist=/opt \
--profile=/etc/firejail/google-chrome.profile \
/opt/google/chrome/chrome --disable-setuid-sandbox --version
[0918/160751.153671:WARNING:chrome/app/chrome_main_linux.cc:82] Read channel stable from /opt/google/chrome/CHROME_VERSION_EXTRA
Google Chrome 140.0.7339.185
adam@laptop:~$
assistant: Great debugging—your trace shows the culprit now: Chrome’s own sandbox is still getting in the way when combined with Firejail + our flags.
Easiest, reliable path on Debian with Firejail is to **let Firejail be the sandbox** and tell Chrome to **skip its internal sandbox**. This is a common setup (Chrome still runs fully confined by Firejail’s namespaces/seccomp/AppArmor).
### Patch the wrappers to use Chrome’s wrapper and disable its sandbox
Run as **root**:
```bash
# Use the distro wrapper (handles env), allow /opt, and disable Chrome’s sandbox.
cat > /usr/local/bin/chrome-google <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--ignore=private-bin \
--noblacklist=/opt \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/google" \
--private-cache \
--caps.drop=all --noroot \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
--whitelist="/home/adam/Downloads" \
/usr/bin/google-chrome-stable --no-first-run --new-window \
--no-sandbox \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-google
cat > /usr/local/bin/chrome-strict <<'EOF'
#!/usr/bin/env bash
exec firejail \
--quiet \
--ignore=private-bin \
--noblacklist=/opt \
--profile=/etc/firejail/google-chrome.profile \
--private="/home/adam/Chrome-Firejail/strict" \
--private-cache \
--caps.drop=all --noroot \
--nodbus \
--no3d \
--netfilter \
--dns=8.8.8.8 --dns=8.8.4.4 \
--whitelist="/home/adam/Chrome-Firejail/Shared" \
/usr/bin/google-chrome-stable --no-first-run --new-window \
--no-sandbox \
--host-resolver-rules="MAP * ~NOTFOUND , EXCLUDE localhost" \
--dns-over-https-servers=https://dns.google/dns-query \
"$@"
EOF
chmod +x /usr/local/bin/chrome-strict
```
Now exit root and test:
```bash
exit
chrome-google
# or
chrome-strict
```
#### W…
assistant: Nice — we’re up! 🎉
Two things you’re seeing:
1) **Green terminal spam**: lots of `ERROR:dbus/... Permission denied` and `at-spi/bus_1: No such file`.
- Harmless. It’s Chrome trying to talk to DBus services we’re not exposing in the sandbox (system bus, accessibility bus).
- If you want fewer logs, we can allow just the user bus (`--dbus-user`) or also the system bus (`--dbus-system`). I’ll show that below.
2) **Banner at top of Chrome**:
> “You are using an unsupported command-line flag: `--host-resolver-rules=MAP * ~NOTFOUND , EXCLUDE localhost` …”
That warning is because of the resolver flag. We don’t actually need that anymore. We can keep Google DNS **without** scary flags by using a Chrome **policy** and Firejail’s DNS/netfilter.
Here’s a clean fix that removes the banner and keeps your DNS lock:
---
## A) Enforce Google DoH via Chrome policy (no warning banner)
Run as **root**:
```bash
# Create managed policy directory
mkdir -p /etc/opt/chrome/policies/managed
# Enforce Secure DNS with Google (DoH)
cat > /etc/opt/chrome/policies/managed/secure-dns.json <<'EOF'
{
"DnsOverHttpsMode": "secure",
"DnsOverHttpsTemplates": "https://dns.google/dns-query"
}
EOF
```
This makes Chrome always use Google DoH (and removes the need for `--host-resolver-rules`).
---
## B) Tidy the wrappers (drop the flag that triggers the banner)
Run as **root**:
```bash
# Remove the host-resolver-rules line from both wrappers
sed -i '/--host-resolver-rules=/d' /usr/local/bin/chrome-google
sed -i '/--host-resolver-rules=/d' /usr/local/bin/chrome-strict
```
(We’ll keep `--no-sandbox` because Firejail is your sandbox. That combination is stable.)
Optional: if you want to quiet a few DBus errors in **chrome-google** (not strict), allow the user/session bus:
```bash
# Add --dbus-user right after --quiet (idempotent add)
sed -i 's|--quiet \\|--quiet \\\n --dbus-user \\|g' /usr/local/bin/chrome-google
```
> If you want the strict launcher to also be quie…
user: now it does not load, and letting you know that previously, i was not able to reach any website when it did load. i saw a message in the terminal saying Warning: maxDynamicUniformBuffersPerPipelineLayout artificially reduced from 1000000 to 16 to fit dynamic offset allocation limit.
adam@laptop:~$ su -
Password:
root@laptop:~# # Create managed policy directory
mkdir -p /etc/opt/chrome/policies/managed
root@laptop:~# # Enforce Secure DNS with Google (DoH)
cat > /etc/opt/chrome/policies/managed/secure-dns.json <<'EOF'
{
"DnsOverHttpsMode": "secure",
"DnsOverHttpsTemplates": "https://dns.google/dns-query"
}
EOF
root@laptop:~# # Remove the host-resolver-rules line from both wrappers
sed -i '/--host-resolver-rules=/d' /usr/local/bin/chrome-google
root@laptop:~# sed -i '/--host-resolver-rules=/d' /usr/local/bin/chrome-strict
root@laptop:~# # Add --dbus-user right after --quiet (idempotent add)
sed -i 's|--quiet \\|--quiet \\\n --dbus-user \\|g' /usr/local/bin/chrome-google
root@laptop:~# exit
logout
adam@laptop:~$ chrome-google
Error: invalid --dbus-user command line option
adam@laptop:~$
assistant: Good news: we can fix both issues fast.
## 1) Remove the bad flag and get Chrome loading again
Your Firejail (0.9.74) doesn’t support `--dbus-user`, so Chrome bailed. Also, your earlier “can’t reach sites” was because we enabled `--netfilter` without a rules file (the default can be too tight).
Run these as **root**:
```bash
# Drop the unsupported flag and the default netfilter (for now)
sed -i '/--dbus-user/d' /usr/local/bin/chrome-google
sed -i '/--netfilter[ =]/d' /usr/local/bin/chrome-google
sed -i '/--dbus-user/d' /usr/local/bin/chrome-strict
sed -i '/--netfilter[ =]/d' /usr/local/bin/chrome-strict
```
Back to your user, test:
```bash
exit
chrome-google
```
You should be able to browse sites now.
(The Vulkan `maxDynamicUniformBuffersPerPipelineLayout` warning is harmless.)
---
## 2) Keep Google DNS + DoH (no scary banner)
You already installed the policy file, so we **don’t** need the resolver flag. We’ll keep:
- Firejail `--dns=8.8.8.8 --dns=8.8.4.4` (sandbox resolv.conf),
- Chrome policy forcing DoH to `https://dns.google/dns-query`.
That combination is clean and stable.
---
## 3) (Optional but recommended) Add a proper netfilter ruleset
Once basic browsing works, you can re-enable network hardening with a rules file that:
- allows only DNS to 8.8.8.8 / 8.8.4.4,
- allows web (80/443) to the internet,
- blocks all LAN ranges,
- allows loopback and established connections.
As **root**:
```bash
cat > /etc/firejail/chrome-webonly.net <<'EOF'
*filter
:INPUT ACCEPT [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:0]
# Allow loopback
-A OUTPUT -o lo -j ACCEPT
# Allow established/related
-A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Block RFC1918/LAN & link-local
-A OUTPUT -d 10.0.0.0/8 -j REJECT
-A OUTPUT -d 172.16.0.0/12 -j REJECT
-A OUTPUT -d 192.168.0.0/16 -j REJECT
-A OUTPUT -d 169.254.0.0/16 -j REJECT
-A OUTPUT -d 100.64.0.0/10 -j REJECT
# Allow DNS to Google (UDP & TCP 53)
-A OUTPUT -p udp -d 8.8.8.8 --dport 53 -j ACCEPT
-A OUTPUT -p …
user: yes, now I can browse. does my Terminal output look ok and normal?
root@laptop:~# exit
logout
adam@laptop:~$ chrome-google
[3:26:0918/163215.399754:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Failed to connect to socket /run/firejail/mnt/dbus/system: Permission denied
Could not find color scheme "BreezeLight" falling back to BreezeLight
[3:49:0918/163216.837886:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Failed to connect to socket /run/firejail/mnt/dbus/system: Permission denied
[3:49:0918/163216.837936:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Failed to connect to socket /run/firejail/mnt/dbus/system: Permission denied
(google-chrome-stable:3): dbind-WARNING **: 16:32:16.885: Couldn't connect to accessibility bus: Failed to connect to socket /run/user/1000/at-spi/bus_1: No such file or directory
[3:26:0918/163216.996011:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Failed to connect to socket /run/firejail/mnt/dbus/system: Permission denied
[3:26:0918/163216.996066:ERROR:dbus/bus.cc:408] Failed to connect to the bus: Failed to connect to socket /run/firejail/mnt/dbus/system: Permission denied
[3:3:0918/163216.996071:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.systemd1.Manager.StartTransientUnit: object_path= /org/freedesktop/systemd1: org.freedesktop.DBus.Error.InvalidArgs: Process 3 is a kernel thread, refusing.
[3:3:0918/163217.006039:ERROR:dbus/object_proxy.cc:573] Failed to call method: org.freedesktop.DBus.Properties.GetAll: object_path= /org/freedesktop/UPower/devices/DisplayDevice: unknown error type:
[3:30:0918/163220.977892:ERROR:google_apis/gcm/engine/registration_request.cc:291] Registration response error message: DEPRECATED_ENDPOINT
Created TensorFlow Lite XNNPACK delegate for CPU.
[3:81:0918/163246.915278:ERROR:content/browser/browser_main_loop.cc:286] GLib: g_main_context_pop_thread_default: assertion 'stack != NULL' failed
[3:83:0918/163246.915266:ERROR:content/browser/browser_main_lo…
assistant: Short answer: **yes — that output is expected with our sandbox**. Here’s what you’re seeing and whether to worry:
- `Failed to connect to ... dbus ... Permission denied` → normal. We don’t expose the **system** DBus inside the jail. Chrome tries; we say “no.”
- `dbind-WARNING ... Couldn't connect to accessibility bus` → normal unless you use screen readers. (We’re not passing the a11y bus through.)
- `StartTransientUnit ... refusing` / `UPower ... GetAll` → Chrome poking systemd/UPower on the **system bus**; blocked by design.
- `DEPRECATED_ENDPOINT` (GCM) → Google deprecated an old push endpoint; Chrome logs it and moves on.
- `GLib: g_main_context_pop_thread_default ...` → harmless GTK noise seen in sandboxes.
- `Created TensorFlow Lite XNNPACK delegate` → info (Chromium ML features).
- `SSL ... net_error -101` → with our netfilter, **UDP/443 (QUIC)** is blocked; Chrome may log errors as it falls back to TCP/TLS. Harmless if pages load.
If it’s browsing fine, you’re good.
---
### Optional cleanups (noise reduction / quality-of-life)
1) **Quiet Chrome logs** (keep errors but hide info/warnings)
Add to both wrappers (after `--new-window` is fine):
```bash
--log-level=2
```
Or nuke almost all logs:
```bash
--log-level=3
```
2) **Avoid keyring/DBus prompts** (if you ever see them)
Add:
```bash
--password-store=basic
```
3) **Allow QUIC (UDP/443)** for best performance (removes some -101 noise)
If you want QUIC, add two rules to `/etc/firejail/chrome-webonly.net` under the HTTP/HTTPS section:
```iptables
-A OUTPUT -p udp --dport 443 -j ACCEPT
-A OUTPUT -p udp -d 8.8.8.8 --dport 853 -j ACCEPT
-A OUTPUT -p udp -d 8.8.4.4 --dport 853 -j ACCEPT
```
(The 853 lines are only if you ever want DNS-over-QUIC; not required today since we pinned DoH over HTTPS.)
4) **Want fewer DBus errors in the “Google Services” launcher?**
We can pass the user session bus (not supported via a flag in your Fi…
user: I was playing around with the Chrome app and then in crashed. I saw this at the end of the terminal
[0918/164717.922634:ERROR:third_party/crashpad/crashpad/handler/linux/exception_handler_server.cc:143] tgkill: Permission denied (13)
adam@laptop:~$
assistant: That line is harmless—it’s Chrome’s crash reporter (“crashpad”) trying to signal/attach inside the Firejail sandbox:
```
... crashpad ... tgkill: Permission denied (13)
```
Firejail blocks that, so you see the error when Chrome crashes for some other reason (most often GPU/VAAPI/Wayland quirks). Two quick fixes:
## 1) Stop crashpad noise (and a little overhead)
Add flags to **both** wrappers to disable crash reporting:
```bash
sudo sed -i 's|/usr/bin/google-chrome-stable|/usr/bin/google-chrome-stable --disable-breakpad --enable-crash-reporter=0|' /usr/local/bin/chrome-google
sudo sed -i 's|/usr/bin/google-chrome-stable|/usr/bin/google-chrome-stable --disable-breakpad --enable-crash-reporter=0|' /usr/local/bin/chrome-strict
```
## 2) Stabilize rendering (common cause of crashes)
Under sandboxes, GPU/VAAPI is the usual culprit. Make the **strict** launcher software-rendered; keep the Google one “normal” unless it still crashes.
```bash
# Strict: force software GL, disable VAAPI
sudo sed -i 's|/usr/bin/google-chrome-stable|/usr/bin/google-chrome-stable --disable-gpu --use-gl=swiftshader --disable-features=VaapiVideoDecoder|' /usr/local/bin/chrome-strict
```
(If the **Google Services** launcher also crashes, run the same line on `/usr/local/bin/chrome-google` too.)
## 3) Optional QoL flags
Cut noisy logs and avoid keyring prompts:
```bash
sudo sed -i 's|/usr/bin/google-chrome-stable|/usr/bin/google-chrome-stable --log-level=2 --password-store=basic|' /usr/local/bin/chrome-google
sudo sed -i 's|/usr/bin/google-chrome-stable|/usr/bin/google-chrome-stable --log-level=2 --password-store=basic|' /usr/local/bin/chrome-strict
```
## 4) Quick health check
If it ever misbehaves again, try a throwaway profile (isolates extensions/settings):
```bash
chrome-strict --temp-profile
# or
chrome-google --temp-profile
```
If the temp profile is stable, an extension or profile flag was the trigger.
---
### TL;DR
- The “tgkill: Permission denied” is just crashpad failing insi…
user: right now, all this seems like too much a hassle now. what do you think about letting Chrome just run on Debian 13 without jail?
assistant: That’s a fair reaction 👍 — you’ve already seen that Chrome under Firejail takes some wrangling. Let’s weigh it out.
---
## 🚀 Running Chrome “plain” (no Firejail)
**Pros**
- It *just works*: all DBus, GPU, extensions, and Google services run normally.
- No extra wrapper scripts to babysit.
- Better performance (hardware video decode, GPU acceleration).
- Fewer warnings/errors cluttering your terminal.
**Cons**
- Chrome’s own sandbox still protects against renderer exploits, but it has deep hooks into your system (DBus, systemd, keyring, UPower, etc.).
- Google gets full telemetry unless you turn it off.
- If Chrome gets compromised, it can see more of your host environment than in a jail.
---
## 🛡️ Middle-ground security options without Firejail
1. **Run Chrome under its own user account**
- Create a user like `chromeuser`, and only launch Chrome there.
- Keeps its config, cache, and permissions isolated from your main `adam` account.
2. **Flatpak Chromium**
- If you’re fine with Chromium (open-source build, fewer Google extras), install it via Flatpak.
- It comes sandboxed by default with portal access control.
- Example:
```bash
sudo apt install flatpak
flatpak install flathub org.chromium.Chromium
flatpak run org.chromium.Chromium
```
3. **Virtual Machine**
- Run a small VM with Debian or Fedora, install Chrome inside, and use it for Google services only.
- Strong isolation, but heavier on resources.
---
## ✅ Recommendation
If your goal is just **convenience + reliability**:
👉 Install Chrome normally (`google-chrome-stable`) and use it alongside Brave/Chromium/Firefox.
If your goal is **security without the hassle**:
👉 Use Chromium Flatpak — it’s lightweight, auto-updating, and still sandboxed by Flatpak.
If your goal is **maximum separation**:
👉 Keep Chrome inside a VM (QEMU/KVM) and treat it like a disposable environment.
---
Would you like me to giv…
user: lets just run stock Chrome on my laptop. so what do we have to do to undo everything we did here? should we uninstall things?
assistant: 👍 Got it — let’s strip things back so Chrome is just the plain Debian 13 install, no wrappers, no Firejail interference. You don’t need to nuke everything, just clean up the stuff we layered on.
---
## 🔄 Undo Steps
### 1. Remove our custom wrappers
These override the real Chrome:
```bash
sudo rm -f /usr/local/bin/chrome-google /usr/local/bin/chrome-strict
```
### 2. Remove our desktop launchers
They pointed to those wrappers:
```bash
rm -f ~/.local/share/applications/chrome-google.desktop
rm -f ~/.local/share/applications/chrome-strict.desktop
update-desktop-database ~/.local/share/applications || true
```
After this, only the official **Google Chrome** launcher will remain in your menu.
### 3. Clean up Firejail overrides (optional)
We added a local profile overlay:
```bash
rm -rf ~/.config/firejail
```
If you don’t plan to use Firejail for other apps, you could even uninstall it:
```bash
sudo apt remove --purge firejail firejail-profiles apparmor-utils python3-apparmor python3-libapparmor -y
```
But you can also leave it — it doesn’t affect Chrome once wrappers are gone.
### 4. Remove Chrome policy (if you want full stock defaults)
We pinned DNS-over-HTTPS via policy. If you want Chrome back to normal behavior:
```bash
sudo rm -f /etc/opt/chrome/policies/managed/secure-dns.json
```
If you’d like to **keep Google DoH enforced**, just leave that file.
---
## ✅ After cleanup
- Launch Chrome from the app menu as normal (the icon labeled just “Google Chrome”).
- Or from terminal:
```bash
google-chrome-stable
```
That’s the stock experience — Chrome’s own sandbox, GPU, everything works, no Firejail.
---
👉 Do you want me to also give you a one-liner that does **all the cleanup at once** (remove wrappers, launchers, overrides, optional packages)?
user: yes, write a script
we will keep firejail for future use
we will use Googles DNS with Chrome
assistant: Perfect. We’ll make a cleanup script that:
- Removes our wrappers (`chrome-google`, `chrome-strict`)
- Removes the custom desktop entries
- Removes our Firejail overrides (but **keeps Firejail installed**)
- Keeps the Google DNS-over-HTTPS **policy** in place (so Chrome always uses Google DNS)
---
### One-liner to create, chmod, and run the script
```bash
nano ~/chrome-cleanup.sh && chmod +x ~/chrome-cleanup.sh && ~/chrome-cleanup.sh
```
### Paste this into the editor
```bash
#!/usr/bin/env bash
set -euo pipefail
EMOJI_OK="✅"
EMOJI_INFO="ℹ️"
EMOJI_BROOM="🧹"
echo "$EMOJI_BROOM Cleaning up custom Chrome sandbox setup…"
# 1. Remove custom wrappers
rm -f /usr/local/bin/chrome-google /usr/local/bin/chrome-strict
echo "$EMOJI_OK Removed wrappers from /usr/local/bin"
# 2. Remove custom desktop launchers
rm -f ~/.local/share/applications/chrome-google.desktop
rm -f ~/.local/share/applications/chrome-strict.desktop
update-desktop-database ~/.local/share/applications || true
echo "$EMOJI_OK Removed custom desktop launchers"
# 3. Remove local Firejail overrides (but keep Firejail installed for other use)
rm -rf ~/.config/firejail
echo "$EMOJI_OK Removed local Firejail overrides"
# 4. Keep Google DNS policy for Chrome
POLICY_FILE="/etc/opt/chrome/policies/managed/secure-dns.json"
if [[ -f "$POLICY_FILE" ]]; then
echo "$EMOJI_INFO Keeping Chrome DNS policy at $POLICY_FILE"
else
echo "$EMOJI_INFO No Chrome DNS policy found, skipping"
fi
echo "$EMOJI_OK Cleanup complete."
echo "$EMOJI_INFO Launch stock Chrome from your app menu or with: google-chrome-stable"
```
---
### ✅ After running
- Your menu will show just **Google Chrome**.
- Run from terminal:
```bash
google-chrome-stable
```
- Chrome will obey the DNS-over-HTTPS policy to `https://dns.google/dns-query`.
---
Want me to also drop in a **check script** that confirms Chrome is indeed using Google’s DNS (queries `chrome://policy` and does a test DNS lookup)?
user: ok, now its running great. I had a question. I noticed a thing pop up saying
Make Chrome faster
Memory Saver frees up memory from inactive tabs so it can be used by active tabs and other apps
No thanks or Turn on
Showing first 50 of 57 messages. View the full conversation at https://mcwai.org/ai-conversation/containing-chrome-on-debian-13-workstation