What makes Arch and Manjaro different here

On Arch Linux, you are already comfortable reading PKGBUILDs, accepting that AUR packages are user-produced scripts with volunteer maintainers, and running pacman -Syu often enough that “works on my machine” is not a moral excuse when routing breaks. Manjaro and other Arch-based desktops inherit most of the same networking stack—typically NetworkManager, often systemd-resolved as a stub resolver, and a modern kernel with tun built the way you expect. What changes is how you acquire the Clash Meta (upstream branding: Mihomo) binary: instead of a vendor tarball placed under /usr/local alone, many users install mihomo or a similarly named package that tracks GitHub release tags, sometimes plus a systemd unit file shipping beside it.

This article assumes you have legal permission to use the subscription or static profile you load, that you can maintain YAML, and that you know why TUN mode exists compared with a mixed listener. The sequence is the same as on other Linux distros with good habits—listeners that answer on loopback, a controller you do not leave wide open, DNS semantics that match fake-ip or redir-host choices—but the Arch-specific work is in file paths, package upgrades, and conflict avoidance with a rolling glibc and a resolver stack you did not hand-compile. If the capture model is still fuzzy, read the Clash TUN mode guide first. For a Debian-style baseline, you can still compare directory layouts with the Ubuntu Clash Meta install article, then return here for AUR ergonomics. For a Red Hat–family desktop, the Fedora Clash Meta guide is the better parallel for SELinux and firewalld, neither of which is the main character on stock Arch, though nftables and firewalls still exist if you turned them on.

AUR workflow: helpers, base-devel, and the habit of reading the PKGBUILD

Arch does not ship the AUR inside pacman by default. You use a helper such as yay or paru to download the build recipe, run makepkg in a chroot or on the host, and install the produced package. Before anything else, ensure base-devel is present so the toolchain matches what maintainers expect: sudo pacman -S --needed base-devel is the usual first line. Network troubleshooting utilities are cheap insurance when you later ask whether a tunnel exists, whether routes duplicated, or whether DNS and packets disagree—install bind (for dig), iproute2, and ethtool if you live on Wi-Fi with quirky drivers.

Most guides stop at “run yay -S mihomo-bin” (example name—always verify the live package on the AUR website, because names and maintainers change). The important habit is: open the package page, read the pinned comments, and skim the PKGBUILD for install paths, user and group names, and whether a .install script rewrites permissions. Some packages drop configuration under /etc/mihomo, state under /var/lib/mihomo, and the binary in /usr/bin; others use /etc/clash for backward compatibility. Do not assume a path you memorized from another blog until you have matched it to your installed package version. After each upgrade, when upstream renames a flag or the maintainer changes the service user, re-check pacman -Ql packagename to see what files you actually own on disk now.

On Manjaro, you still use the AUR with the same helpers in most community setups, but you may be holding kernels and key libraries on a slightly different cadence than vanilla Arch. If a binary built on Arch proper misbehaves on Manjaro, the first place to look is not “Mihomo is broken,” but the library versions reported by ldd $(which mihomo) and any delayed OpenSSL migration notes in the AUR thread.

Installing and updating from the AUR with minimal drama

With your helper of choice, install the core you want—often a *-bin package that fetches prebuilt release archives rather than compiling from source on a laptop. Example shape (do not copy blindly; replace with the exact package you audited): yay -S mihomo-bin or paru -S mihomo-bin. When the build finishes, confirm the version matches what you need for your ruleset: mihomo -v should print a semantic version that lines up with the Clash Meta (Mihomo) upgrade guide, because silent behavior changes between core releases do more damage to routing than a mis-typed port once you enable policy routing.

Updates on Arch are frequent; treat yay upgrades as a reason to re-read the last ten lines of the AUR page. If a maintainer adds a systemd unit or changes the User= line, you must merge that consciously with any local override you keep under /etc/systemd/system. Pacman and makepkg are non-interactive in spirit but they will happily replace unit files in /usr/lib/systemd/system if the package ships them, which is what you want when the upstream fix is security-related, and occasionally annoying when you had a local hotfix with the same filename.

Although many users are comfortable pulling binaries from GitHub directly, a first-party habit that scales better for teams is still to use the official Clash download page as the editorial entry point to understand release channels, then map that to whichever AUR package tracks them. The AUR remains community-driven; the download page is the readable map of what “Clash” refers to in documentation across this site.

Config layout, permissions, and secrets after the AUR install

After installation, do not start editing random paths. Locate the service-supplied or recommended layout: sudo find /etc -maxdepth 3 \( -name '*mihomo*' -o -name 'config.yaml' \) 2>/dev/null | head is a blunt but effective first pass, then narrow with pacman -Ql your-package. Set ownership and modes so the dedicated user the unit runs as—commonly mihomo or your own user for a per-user systemd --user service—can read configuration but random desktop apps cannot: chmod 600 on secrets, no world-readable private keys, and a clear separation between read-only config.yaml and volatile runtime files under /var if the package created them.

Smoke-test the binary interactively as that user before you trust systemd to own restarts. A typical pattern is running Mihomo in the foreground with an explicit -d directory and -f file once stderr is still attached to your terminal. You want to see listener lines without instant YAML panics. If the AUR package ships an example config.yaml, copy it to a working path, wire your mixed-port or split listeners, and only stub DNS enough to pass local checks. Premature TUN in the first file makes an already noisy first boot harder to read. Ground yourself in the same discipline described for other distributions: the mixed port is how you verify policy before the kernel starts redirecting default routes for every misbehaving UDP flow.

Listeners, controller, and DNS: prove the boring path first

Before any tun: stanza, shape your inbound story. Bind the HTTP, SOCKS, or mixed listener to 127.0.0.1 unless you have a reason to expose the LAN, and that reason should be paired with firewall rules you can explain. The external controller, if you enable it, should sit behind a token or be restricted to loopback, because a stray browser tab on a shared network should not be able to flip your policy groups. DNS deserves special attention: systemd-resolved on Arch often presents 127.0.0.53 as a stub, while your YAML might describe listen: ':53' or a DoH upstream. The failure mode is familiar—names resolve in one order while packets take another once TUN starts steering flows—so you decide up front who answers for clients you care about, then you test both a public name and a LAN name that must stay on the physical interface for split tunneling to mean anything.

Walk deprecated keys carefully using the upgrade guide so you are not blending old Clash fields with new Mihomo defaults. This matters twice on a rolling system where you will bump the AUR package often enough that “it worked last month” is a weak signal.

systemd: boot ordering, a solid unit, and Arch’s network target story

When you are ready to let the system own the process, use a systemd unit that respects boot reality on Arch. Network interfaces can be “up” in the sense of ip link while DHCP has not finished; NetworkManager-wait-online.service is often a reasonable ordering anchor if you are on a typical desktop. A conservative [Unit] block might depend on network-online.target and pull in Wants=network-online.target so the service does not flail during the first few seconds of a fast SSD boot. The heart of the service is ExecStart pointed at the exact binary path the package created—/usr/bin/mihomo is common, but not universal—and User and Group that match the account your configuration and state directories use.

Capabilities matter for TUN. Granting CAP_NET_ADMIN (and usually CAP_NET_BIND_SERVICE for privileged low ports) through AmbientCapabilities= and a matching CapabilityBoundingSet= allows a non-root service user to create the tunnel without a setuid bit. A minimal sketch—adapt to your paths and the unit name you install:

[Unit]
Description=Mihomo (Clash Meta) on Arch
After=network-online.target NetworkManager-wait-online.service
Wants=network-online.target

[Service]
Type=simple
User=mihomo
Group=mihomo
ExecStart=/usr/bin/mihomo -d /var/lib/mihomo -f /etc/mihomo/config.yaml
Restart=on-failure
RestartSec=3
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
CapabilityBoundingSet=CAP_NET_BIND_SERVICE CAP_NET_ADMIN
NoNewPrivileges=true
LimitNOFILE=1048576

[Install]
WantedBy=multi-user.target

Install and enable: sudo systemctl daemon-reload && sudo systemctl enable --now mihomo.service (or whatever the AUR already named; some packages use clash-meta or clash-meta@ instance units). If the daemon exits, journalctl -u mihomo -e --no-pager is the first screen you read. The Arch forums are full of “it worked until reboot” stories that trace back to units that did not daemon-reload after editing, or to permissions on the state directory that flipped during a hasty chown -R copy from another machine. Fix those class of errors before TUN, or you will blame routing for a process that never stayed alive long enough to program a single route.

Some power users run Mihomo as a systemd --user service to avoid a separate system user entirely. That is valid on a single-user workstation if you understand that anything running as you can talk to a loopback controller left open, and you still need the same capability story—often via AmbientCapabilities on a user instance where policy allows, or a root-backed helper. Pick one model, document it, and stop mixing root-owned units with a user-owned config tree without reconciling umask and paths.

Enabling TUN: stack, auto-route, and why Linux permissions were never optional

When you need the kernel to see Mihomo the way it sees a VPN, enable the tun section only after the plain listener path is stable. A conservative first pass on mainline kernels uses the system stack, enables the tunnel, and sets auto-route only when you are ready for global policy routing, because it is the moment your mistakes stop being “that browser tab” and become “this entire table entry.” A measured stanza could look like:

tun:
  enable: true
  stack: system
  auto-route: true
  auto-detect-interface: true
  strict-route: false

Change one key at a time, restart the unit, and validate with ip link and ip route show table all. Without CAP_NET_ADMIN, the failure will often surface as a terse permission error that you might misread as a YAML bug. If you chose setcap on the binary instead of ambient capabilities in the unit, reapply setcap every time a package update replaces the file—AUR users feel this every few upstream drops. Pick one approach and stay consistent. For deeper policy routing philosophy, the TUN mode guide on this site is still the conceptual spine; the Arch delta is that your kernel and libc update frequently enough that you should re-verify after a major linux package bump, not because Mihomo is fragile, but because netlink edge cases and driver regressions on bleeding hardware do happen.

Staying out of the distribution network stack’s way

Arch does not need SELinux babysitting, but you still have a coherent OS network story: NetworkManager or systemd-networkd owns the uplink, systemd-resolved may own stub resolution, and if you also run Docker, another bridge, a corporate VPN, or wg-quick for WireGuard, you may have more than one actor inserting default routes. The recipe for “everything breaks mysteriously at login” is two stacks that both think they should own 0.0.0.0/0. TUN auto-route in Mihomo is powerful precisely because it moves that line in the main table. Before you call that success, try disabling the other tool temporarily, or configure split responsibility explicitly—Mihomo for user-space policy, the other stack only for a narrow office subnet, and never both fighting for a default unless you have rare expertise.

Wi-Fi on Arch can use iwd or wpa_supplicant under the hood. Neither is incompatible with TUN, but a flaky driver will look like a Mihomo problem when the tunnel exists while packets never reach the access point. Keep firmware up to date and remember that a rolling fix might land as a linux-firmware or kernel update while you are debugging YAML. dmesg and journalctl -k are part of a serious network triage, not a distraction from “proxy stuff.”

Firewall-wise, nftables or a simple ufw on Arch still matter if you have enabled them. TUN does not make you immune to host rules that drop forwarded traffic or mangle mark bits your rules assume exist. If you use Docker, re-read the bridge IP ranges so LAN split rules in Mihomo do not send Docker-internal traffic the wrong way after an engine upgrade widened the default bridge.

Verification checklist for Arch and Manjaro

  1. systemctl is-active mihomo.service (or your unit name) returns active after a full reboot, not only after a manual systemctl start.
  2. ss -lntp shows loopback listeners owned by the expected UID.
  3. ip link lists the tunnel device that Mihomo created when TUN is enabled.
  4. resolvectl query example.com (or dig with explicit @server) matches the resolver design you sketched, both before and after TUN.
  5. curl --ipv4 https://example.com succeeds; repeat with a domestic hostname and an offshore hostname to match your rule intent.
  6. Optional: a second cold boot the next morning, because the best routing bugs only appear when systemd starts units in a slightly different order under battery power.

Only after the checklist passes should you start tuning exotic rule providers or per-app groups. Simultaneous YAML edits, link-layer flaps, and policy experiments waste weekends.

Troubleshooting quick hits for AUR and TUN on rolling kernels

  • “Operation not permitted” on tunnel create: check capabilities on the service, whether the binary was replaced without reapplying setcap, and whether a MAC framework you installed yourself (not stock Arch) is in the way.
  • DNS in apps disagrees with routes: fake-ip versus stub resolvers; compare resolvectl output to Mihomo DNS logs, not just what curl prints once.
  • Works until reboot: race on network-online targets, a stale systemd drop-in, or a keyfile your unit forgot to ReadWritePaths= when hardening with sandbox options.
  • AUR build fails on glibc edge: read the AUR comment thread; someone already posted a patch or a temporary CFLAGS line—rolling means you sometimes wait 24 hours for a maintainer push.

Where to go after the unit is green

Installation and autostart are prerequisites; the product is a maintainable policy graph. The Clash documentation hub is the right follow-on for rules, rule providers, and health checks that pay off more than any single AUR flag. If you are comparing cores or clients, keep the AUR as a delivery channel but treat documentation as the contract you actually follow week to week.

Closing: rolling distros reward boring operations work

Arch Linux and friends hand you a fast-moving kernel, a user-contributed AUR, and a systemd story that is mostly predictable once you name your units honestly. Clash Meta fits that world when you treat the install as packaging hygiene—read the AUR page, know where the Mihomo binary and config live after each upgrade, wire systemd with the capabilities Linux TUN actually needs, and only then let auto-route take responsibility for the default path. Next to a pile of ad hoc environment variables, an orderly service that survives reboots is the difference between a network tool and a background hobby.

When the checklist is green on two different days and after at least one kernel update, you can trust the stack more than any single speed test. Curated entry points to installers and long-form documentation beat chasing link rot in social threads, especially on a rolling distribution. If you want a clear download narrative while you line up the AUR package with the core you expect, start from the official download page, keep your pacman mirror in good health, and treat every change to config.yaml like a production commit—because on your machine, it is.

→ Download Clash for free and experience the difference

Download Clash from this site