Lsergrbl corrected to run correctly on Linux
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-11-04 15:39:31 +01:00
.gitignore Linux Wine support: portable Threshold fix, docs and tutorial 2026-10-19 16:07:20 +02:00
git.txt README corrected 2026-11-04 15:39:31 +01:00
LaserGRBL.exe adding the compiled LaserGRBL.exe 2026-11-04 15:37:50 +01:00
README.md README corrected 2026-11-04 15:39:31 +01:00
threshold-linux-fix.patch Linux Wine support: portable Threshold fix, docs and tutorial 2026-10-19 16:07:20 +02:00
TUTORIAL.md Linux Wine support: portable Threshold fix, docs and tutorial 2026-10-19 16:07:20 +02:00

LaserGRBL under Linux (Wine) — fixed build

(note : I added the already compiled LasrGRBL.exe" ojn my Debian/Trixie linux box)

LaserGRBL is a Windows GUI for GRBL laser cutters. This repo documents how to run it under Linux with Wine, including a fix for the raster-import hang where only 1bit BW Dithering worked and Line-to-Line / Vectorize / Centerline spun forever.

Root cause: ImageTransform.Threshold() used ImageAttributes.SetThreshold(), which Wine's built-in gdiplus does not implement (fixme:gdiplus:GdipSetImageAttributesThreshold not implemented → NotImplementedException). The preview thread swallows the exception, so the progress spinner never stops. Dithering was the only tool skipping Threshold().

Fix: portable per-pixel threshold with LockBits (no ImageAttributes). See threshold-linux-fix.patch and Resources/LaserGRBL-master/LaserGRBL/RasterConverter/ImageTransform.cs:61.

Prerequisites

  • Wine 11 (with 32-bit support, wine-stable-i386)
  • mono-complete 6.12 + libgdiplus 6.1 (for rebuilding with xbuild)
  • Original LaserGRBL source in Resources/LaserGRBL-master/ (git-ignored reference copy)

Verified with: wine-11.0, Mono JIT 6.12.0.199, libgdiplus 6.1.

Quick start

  1. Install LaserGRBL once under Wine (produces ~/.wine/drive_c/Program Files (x86)/LaserGRBL/LaserGRBL.exe): wine install.exe
  2. Rebuild with the fix (from repo root): xbuild Resources/LaserGRBL-master/LaserGRBL.sln /p:Configuration=Release
  3. Back up and install the fixed exe:
    WINE_EXE="$HOME/.wine/drive_c/Program Files (x86)/LaserGRBL/LaserGRBL.exe"
    cp "$WINE_EXE" "$WINE_EXE.bak-$(date +%Y%m%d-%H%M)"
    cp Resources/LaserGRBL-master/LaserGRBL/bin/Release/LaserGRBL.exe "$WINE_EXE"
    
  4. Launch: wine "$HOME/.wine/drive_c/Program Files (x86)/LaserGRBL/LaserGRBL.exe"

See TUTORIAL.md for the full step-by-step (serial port, image-import test, troubleshooting).

Repo layout

  • Resources/ — upstream source copy (ignored by git, see .gitignore)
  • threshold-linux-fix.patch — the runtime fix for Threshold()
  • README.md / TUTORIAL.md — this documentation

Linux build notes

xbuild needs three trivial local adjustments in the Resources/ copy (Windows-only / case issues, no behavior change on Windows):

  • LaserGRBL/UserControls/MyPictureBox.designer.cs → symlink to MyPictureBox.Designer.cs (case-sensitive filesystem)
  • LaserGRBL/Telegram.cs:20,22 → is null to == null (mcs ≤ 7.2)
  • LaserGRBL/PreviewForm.cs:12 → drop unused using System.Diagnostics.Eventing.Reader;
  • LaserGRBL/MainForm.cs:573 → explicit Tools.ModifyProgressBarColor.SetState(PbBuffer.ProgressBar, …) (mcs ambiguity)