Run MiniMax Code — MiniMax's AI coding agent — on Linux x64. MiniMax only ships macOS and Windows builds, so this repository contains the tooling that turns the official macOS DMG into a working Linux application: a build pipeline, a launcher, a desktop-entry installer, and the recompiled native modules the app needs under Electron on Linux.
No application JavaScript is patched. The app's payload is platform-neutral JS — the port is a runtime swap (Linux Electron + Linux native modules) plus packaging.
Status: working — the app launches, renders correctly, reaches the login screen, opens the browser for OAuth, and receives the
minimax://callback.
⚠️ Unofficial and personal-use only. This project is not affiliated with or endorsed by MiniMax. MiniMax Code is proprietary software; it is not distributed here. You download the official DMG yourself and build locally.
You need: Linux x64, 7z (p7zip), Node.js + npm, ~3 GB of free disk,
and the official MiniMax Code macOS DMG (Intel/x64 build) downloaded from
MiniMax's site.
git clone https://github.com/DarkoKuzmanovic/minimax-code-linux.git
cd minimax-code-linux
./prepare.sh "/path/to/MiniMax Code 3.0.60.dmg" # extract DMG + fetch Electron runtime
./assemble.sh # build dist-linux/minimax-code
cd dist-linux/minimax-code
sudo ./install.sh # system-wide → /opt/minimax-code (Chromium sandbox ON)
./install.sh --user # or per-user → ~/.local/share/minimax-code (--no-sandbox)Then launch with minimax-code, or from your application menu.
The installer registers the icon set, a .desktop entry, and the
x-scheme-handler/minimax protocol handler. The handler is required, not
cosmetic — login happens in your external browser and returns via
minimax://auth-callback?accessToken=…, which reaches the app as an argv deep
link handled by Electron's second-instance event.
Uninstall with ./uninstall.sh from the same directory (add --purge to also
delete ~/.config/MiniMax Agent).
| Stage | What happens |
|---|---|
| Extract | 7z x unpacks the DMG (HFS+) — no dmg2img or mount needed |
| Unpack | @electron/asar extract on Resources/app.asar (412 MB → ~40,000 files) |
| Runtime | npm install electron@38.3.0 supplies the linux-x64 Electron dist |
| Natives | macOS .node binaries replaced with the linux-x64 builds vendored in natives/ |
| Assemble | ./assemble.sh produces dist-linux/minimax-code (~840 MB) |
Target ABI is Electron 38.3.0 / Chrome 140 / Node 22.20.0 /
NODE_MODULE_VERSION 139. Override with ELECTRON_VERSION=x.y.z ./prepare.sh …
when porting a newer DMG.
Why this works at all: the app is already written cross-platform — it
targets Windows too, ships NSIS installer scripts, and even bundles a prebuilt
@nut-tree/libnut-linux binary in the macOS DMG. Of the ~44 files that branch
on process.platform, nearly all are cosmetic guards (dock, vibrancy, menu
roles, tray) that already no-op off darwin.
| Module | Linux binary vendored in natives/linux-x64/ |
|---|---|
node-pty |
rebuilt with electron-rebuild against Electron 38.3.0 |
better-sqlite3 |
Electron-ABI build, replaces the darwin binary in place |
@mariozechner/clipboard |
npm …-linux-x64-gnu platform package |
node-screenshots |
npm …-linux-x64-gnu platform package |
@vscode/ripgrep |
npm @vscode/ripgrep-linux-x64 (ships the rg binary) |
@nut-tree/libnut-linux |
already bundled in the macOS DMG — used as-is |
All of these load under the shipped Electron binary — verify any time with:
ELECTRON_RUN_AS_NODE=1 ./dist-linux/minimax-code/minimax-code abi-test.jsPrefer to build them yourself instead of trusting the vendored binaries?
npm install node-pty better-sqlite3 plus
npx electron-rebuild -v 38.3.0 in a scratch directory reproduces the two
rebuilt ones; the rest are ordinary npm platform packages.
Everything else was solved with correct binaries, environment variables, or launcher flags — these two were actual bugs:
1. Blank white window — Chromium's Wayland/GBM path. Electron 38
auto-selects native Wayland, which cannot allocate buffers on this stack:
gbm_pixmap_wayland: Cannot create bo with format=RGBA_8888 in a loop, killing
the GPU process. The launcher therefore forces --ozone-platform=x11
(XWayland). Measured difference:
| GPU crashes | startup | first paint | |
|---|---|---|---|
| Wayland | 24 | 22.8 s | 17.1 ms |
| X11 | 0 | 2.4 s | 6.4 ms |
Set MINIMAX_WAYLAND=1 to opt back into native Wayland.
2. [LocalRuntime] electron-rebuild binary not found. The app tries to
stage its own Electron-ABI better-sqlite3 by shelling out to
electron-rebuild, which we don't ship. native-sqlite-env.js has a supported
escape hatch: it returns early when MAVIS_SQLITE3_MODULE_PATH is set. Since
the bundled binary is already ABI 139, the launcher just exports that path plus
NODE_PATH. Error gone, [UtilityRuntime] ready, no patching.
- Auto-update does not work, by design.
electron-updaterwill 404 (MiniMax publishes no Linux artifacts) and the JS hot-update channel is version-gated to a different base version. Both fail silently and harmlessly. To move to a new release, re-run the pipeline against a newer DMG. - Sandbox.
chrome-sandboxmust be root-owned and setuid to be used; a--userinstall can't do that, so the launcher adds--no-sandbox. Usesudo ./install.shif you want the sandbox enabled. WM_CLASSisMiniMax Agent(from the app name), notMiniMax Code— the.desktopStartupWMClassmatches it so taskbar icons group correctly.- Fontconfig
invalid attribute 'xsi:nil'warnings come from the host's/etc/fonts/conf.d/48-guessfamily.confand are unrelated to this port.
prepare.sh DMG → extract/ + app-unpacked/ + runtime/ (run first)
assemble.sh build inputs → dist-linux/minimax-code (run second)
abi-test.js verifies native-module ABI under the real Electron binary
natives/ vendored linux-x64 native modules (open-source rebuilds)
packaging/ launcher, .desktop template, installer, uninstaller, icons
icons/ source icon artwork
extract/, app-unpacked/, runtime/, and dist-linux/ are build
artifacts containing MiniMax's proprietary code — they are gitignored and are
never published.
7zcreates junk*:com.apple.*sidecar files from HFS+ alternate streams; both scripts delete them after every copy.- Don't use
pkill -f dist-linux/minimax-code— the pattern matches the very shell command issuing it. Usepkill -x minimax-code. - Chromium logs errors as
ERROR:file.cc:NN, not in the app's bracketed[error]format. Grepping only for[error]hides GPU crashes entirely. - Editable sources live in
packaging/and are copied into the output tree on each build —assemble.shstarts withrm -rfon its output, so never edit files indist-linux/directly.
The tooling in this repository is MIT-licensed (see LICENSE). MiniMax Code
itself is proprietary software owned by MiniMax; this project redistributes
none of it and is intended for personal use with your own legitimately
obtained copy. The vendored native modules are open source (node-pty,
better-sqlite3, @mariozechner/clipboard, node-screenshots, ripgrep) and remain
under their respective licenses.