Clash Client Crashes on Launch: Config, TUN Permission & Dependency Fixes
The icon does nothing, the process flashes and vanishes, or the window opens to a blank screen — three symptoms, three completely different root causes. This guide sorts crashes by when they happen: instant exit, kernel startup failure, and rendering issues, with log locations and fix commands for each so you're not reinstalling blindly.
First, Pin Down When the Crash Happens
"Crash" is a vague catch-all — you need to identify exactly when it happens, since each stage involves different components. Clash-family clients (whether Clash Verge, Clash Meta-style GUIs, or other implementations paired with the mihomo kernel) are generally made up of three parts: the GUI process (window rendering and config management), the kernel process (the mihomo or legacy clash binary handling actual traffic forwarding), and local config files. A problem in any layer shows up as "won't open" or "opens and disappears," but the fix is entirely different depending on which one.
- Instant exit: the process shows up for a split second in the taskbar then vanishes — usually the GUI process throwing an uncaught exception while reading the config.
- Kernel startup failure: the window opens fine, but flipping the proxy switch throws an error or freezes, most often right when TUN mode kicks in.
- Blank window / rendering issue: the window itself appears with a normal title bar, but the content area is blank or only partially loaded — usually tied to missing system-level graphics dependencies.
Each type is covered below with its own log location and fix commands. Figure out which category applies to you first — no need to read the whole thing front to back.
Type 1: Instant Exit — Leftover or Corrupted Config
This is the most common crash type, especially right after upgrading the client. Newer versions sometimes introduce config fields that older configs don't have, and when the GUI process hits a field it can't parse, it just crashes silently instead of showing an error — which is exactly why it "looks like nothing happened."
Check the Logs Before Deleting Anything
Most GUI clients write runtime and crash logs to a logs subdirectory inside the config folder, typically ~/.config/<client-dir>/logs/. Launch the client from a terminal instead of the desktop icon so crash output prints directly to the console — no need to dig through log files:
# Replace with the actual installed binary name, commonly clash-verge or the AppImage filename
clash-verge 2>&1 | tee ~/clash-crash.log
If the terminal output shows yaml: unmarshal errors, panic: runtime error, or something like failed to initialize config, you can be fairly sure the crash is happening during config parsing — not a permission or dependency issue.
Find and Clean Up the Problem Config
The config directory usually holds two kinds of files: the client's own settings and the rule config generated from your subscription. The former rarely gets corrupted — the latter is where most issues live. Work through it in this order:
- Back up the entire config directory first, so you don't lose custom rules if you clean up too aggressively:
cp -r ~/.config/<client-dir> ~/clash-config-backup - Move the currently active subscription config out of the folder so the client can't find it on next launch and falls back to defaults:
mv ~/.config/<client-dir>/profiles/*.yaml /tmp/ - Relaunch the client and check if it opens normally. If it does, the crash is tied to one of your subscription configs — move files back from
/tmp/one at a time to pinpoint which one triggers it. - Run
yamllintor the client's built-in "validate config" feature on that file. Common culprits: misaligned indentation, full-width Chinese colons mixed into the file, or rule entries missing required fields.
Heads up
Don't just delete the entire client directory under ~/.config to "reset" things — that wipes out window position, language settings, and your subscription list along with it. Move suspicious individual files out first and narrow down the blast radius.
Type 2: Kernel Startup Failure — Usually a TUN Permission Issue
If the GUI opens fine but enabling the system proxy or TUN mode freezes, throws an error, or takes the whole client down with it, the problem is almost always in how the kernel process (mihomo) interacts with OS-level permissions — not the GUI itself.
Why TUN Mode Needs Extra Permissions
TUN mode works by creating a virtual network interface on the system, intercepting all traffic through it before handing it off to the kernel process — and creating a network device requires a capability that regular user permissions don't grant by default. Most clients handle this one of two ways: setting the CAP_NET_ADMIN capability on the mihomo binary, or routing the operation through a root-privileged helper process. If neither mechanism is working, the kernel process errors out and exits the moment it tries to create the TUN device — and the GUI process, seeing the kernel die, crashes right along with it.
Steps to Check
# 1. Check whether the kernel binary already has the capability set
getcap /usr/lib/clash-verge/mihomo
# Expected output looks like:
# /usr/lib/clash-verge/mihomo = cap_net_admin,cap_net_bind_service+ep
# 2. If the output is empty, add the capability manually (adjust the path to your actual install location)
sudo setcap cap_net_admin,cap_net_bind_service=+ep /usr/lib/clash-verge/mihomo
# 3. Check the system log for device-creation denials from the kernel process
journalctl --user -u clash-verge -n 100 --no-pager
dmesg | grep -i tun
Another common cause is a missing tun kernel module — this shows up more often on stripped-down server distros or custom kernels:
# Check whether the module is loaded
lsmod | grep tun
# If not loaded, load it manually and set it to load on boot
sudo modprobe tun
echo "tun" | sudo tee -a /etc/modules-load.d/modules.conf
Once the capability is set and the tun module is confirmed present, re-enable TUN mode — the kernel process should start normally. If it still fails, check the kernel process's own log (usually a separate file in the config directory named core.log or similar) for secondary issues like port conflicts or misconfigured DNS hijacking.
Type 3: Blank Window — Missing System Graphics Dependencies
This type shows up as a window that opens with a normal title bar and borders, but the content area is completely blank, or only partially loads before freezing. Most GUI clients render their interface using WebView or a similar embedded browser component, which depends on system-provided graphics libraries — if one is missing or version-mismatched, the rendering layer just fails silently instead of throwing a visible error.
Commonly Missing Dependencies
webkit2gtkorlibwebkit2gtk: required for rendering in most GTK-based GUI clients; distro updates sometimes accidentally remove it or roll back the version.libayatana-appindicatoror the olderlibappindicator: handles the system tray icon — missing it causes some clients to freeze during tray initialization.- OpenGL/Mesa graphics driver libraries: often stripped out in VMs or minimal desktop environments, which breaks GPU-accelerated rendering.
Confirm What's Missing via the Command Line
Launch the client from a terminal first and watch for shared library errors — this shows you exactly what's missing:
ldd $(which clash-verge) | grep "not found"
If you see a line like libwebkit2gtk-4.1.so.0 => not found, that library is genuinely missing — install the matching package for your distro:
# Debian / Ubuntu
sudo apt install libwebkit2gtk-4.1-0 libayatana-appindicator3-1
# Fedora
sudo dnf install webkit2gtk4.1 libappindicator-gtk3
# Arch / Manjaro
sudo pacman -S webkit2gtk-4.1 libappindicator-gtk3
Restart the client after installing — in most cases the blank screen issue resolves right there. If all dependencies are present but it's still blank, try disabling GPU acceleration temporarily to rule out a graphics driver compatibility issue:
WEBKIT_DISABLE_COMPOSITING_MODE=1 clash-verge
Quick Reference: Log Locations by Crash Type
The most time-wasting part of troubleshooting is not knowing which log to check. This table maps each crash type to where you should look first, so you can jump straight there instead of re-reading the sections above.
| Crash Type | Typical Symptom | Check Here First |
|---|---|---|
| Instant exit | Flashes after clicking the icon; window never appears | Launch from terminal and watch output; ~/.config/<client>/logs/ |
| Kernel startup failure | Window opens fine; freezes or errors when enabling proxy/TUN | journalctl --user; dmesg; the kernel process's own log file |
| Blank window | Window frame looks normal; content area is blank | ldd to check shared libraries; terminal launch for step-by-step errors |
Preventing This From Happening Again
Once you've fixed the crash, it's worth doing two things to lower the odds of hitting the same issue after your next upgrade or a fresh install. First, archive a copy of your currently working config file somewhere outside the config directory — back it up before every client upgrade, so you can roll back quickly if a new version introduces incompatible fields. Second, jot down whatever capabilities you set manually and dependencies you installed by hand, and turn it into a simple shell script. After a reinstall or a new machine, just run the script instead of troubleshooting from scratch.
#!/bin/bash
# Restore everything the Clash client needs to run after setting up a new machine
sudo apt install -y libwebkit2gtk-4.1-0 libayatana-appindicator3-1
sudo modprobe tun
echo "tun" | sudo tee -a /etc/modules-load.d/modules.conf
sudo setcap cap_net_admin,cap_net_bind_service=+ep /usr/lib/clash-verge/mihomo
One last note: if you've gone through all three troubleshooting paths above and it's still broken, you're likely looking at a deeper compatibility issue between the client version and your system's kernel or graphics stack. In that case, switching to a different GUI built on the same kernel usually gets you further than reinstalling the same version over and over.
Get the Clash Client
Pick the installer that matches your system to avoid startup issues caused by version or packaging mismatches.