Skip to content

Repository files navigation

MajUSB logo

MajUSB Bootable Creator

Build and Package License: MIT Rust GTK4 Release AppImage AUR

A modern, cross-platform USB bootable drive creator written in Rust with a GTK4 GUI. Easily write Linux or Windows ISO images to USB drives with real-time progress, robust error handling, and a polished, user-friendly interface.

Read CONTRIBUTING.md before submitting changes.

Downloads

  • AppImage (recommended): latest release —-imagexandsgdisk`.
  • AUR: majusb (requires gptfdisk).
  • DEB: available in the release, but untested—use with caution or build from source.

Features

  • Modern GTK4 GUI: Clean, responsive, user-friendly interface with modular dialogs and logging to the UI.
  • Cross-platform: Works on Linux (tested on major distros).
  • Windows & Linux USB creation: Dual-partition Windows flow (FAT32 BOOT + NTFS ESD-USB) with bypass flags (TPM/SB/RAM) via unattend; optional dd mode (off by default); Linux write support.
  • Privilege Escalation: Uses a secure helper binary with pkexec only when needed.
  • Dependency Check: Required/optional package checks (sgdisk for persistence) with install commands per distro.
  • Cluster Size & NTFS options: Cluster selection and optimized rsync/mount flags for throughput.
  • Read-back verification (on by default): after writing, every file is read back from the stick (page cache evicted with posix_fadvise, so it is flash being checked, not RAM) and compared with the ISO — byte for byte with a mounted ISO, CRC32 against 7z l -slt on the 7-Zip fallback, raw prefix compare for dd writes. Sizes are compared first, so a silently truncated install.wim (the classic "Setup copies to 100% then fails with no error") is reported immediately. A mismatch fails the write with a per-file report. --skip-verify in the CLI turns it off.
  • Auto-refresh Device List: Detects USB device changes automatically (lost during GUI modularization; likely needs re-wiring).

Repository


Prerequisites

1. Install Rust (if not already installed)

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Follow the prompts, then restart your terminal or run:
source $HOME/.cargo/env

2. Install GTK4 and Required System Packages (include sgdisk/gptfdisk)

Arch Linux / Manjaro / EndeavourOS / Artix / Garuda / SteamOS
sudo pacman -S --needed base-devel rustup gtk4 glib2 gio util-linux coreutils dosfstools ntfs-3g parted gptfdisk rsync polkit
Debian / MX Linux / antiX
sudo apt update
sudo apt install -y build-essential rustup libgtk-4-dev libglib2.0-dev util-linux coreutils dosfstools ntfs-3g parted gdisk rsync policykit-1
Ubuntu / Linux Mint / Pop!_OS / Zorin / Kubuntu / Lubuntu / Xubuntu / Elementary
sudo apt update
sudo apt install -y build-essential rustup libgtk-4-dev libglib2.0-dev util-linux coreutils dosfstools ntfs-3g parted gdisk rsync policykit-1
Fedora / Nobara / Bazzite
sudo dnf install -y @development-tools rust gtk4-devel glib2-devel gio-devel util-linux coreutils dosfstools ntfs-3g parted gdisk rsync polkit
openSUSE (Leap, Tumbleweed, GeckoLinux)
sudo zypper install -y rust gtk4-devel glib2-devel gio-devel util-linux coreutils dosfstools ntfs-3g parted gptfdisk rsync polkit
Alpine Linux
sudo apk add build-base rustup gtk4-dev glib-dev gio-dev lsblk coreutils dosfstools ntfs-3g-progs parted gptfdisk rsync polkit
Void Linux
sudo xbps-install -S base-devel rustup gtk4-devel glib-devel gio-devel util-linux coreutils dosfstools ntfs-3g parted gptfdisk rsync polkit
Gentoo
sudo emerge --ask sys-devel/gcc sys-devel/make sys-apps/util-linux sys-apps/coreutils sys-fs/dosfstools sys-fs/ntfs3g sys-block/parted sys-apps/gptfdisk net-misc/rsync sys-auth/polkit x11-libs/gtk+:4 dev-libs/glib dev-libs/gio dev-lang/rust
NixOS
nix-env -iA nixos.gcc nixos.make nixos.util-linux nixos.coreutils nixos.dosfstools nixos.ntfs3g nixos.parted nixos.gptfdisk nixos.rsync nixos.polkit nixos.gtk4 nixos.glib nixos.gio nixos.rustc
Other Distributions

Install the following packages (names may vary):

  • build tools (gcc, make, etc.)
  • rustup
  • gtk4, glib, gio development libraries
  • util-linux, coreutils, dosfstools, ntfs-3g, parted, rsync, polkit

Building (Arch Linux Example)

git clone https://github.com/vicrodh/usb-bootable-creator.git
cd usb-bootable-creator
cargo build --release
  • The main GUI binary will be in target/release/rust-usb-bootable-creator.
  • The privilege helper will be in target/release/cli_helper.

Running

cargo run --release
# Or run the built binary directly:
./target/release/rust-usb-bootable-creator

Using the App

  • Select an ISO file.
  • Select a USB device from the list.
  • (Optional) Select cluster size for Windows ISOs.
  • Click "Write" and confirm the operation.
  • Watch the real-time log and progress bar.
  • Wait for the system notification on completion.

Releasing

CI (.github/workflows/ci.yml) runs rustfmt, clippy (-D warnings), tests and a release build on every push and PR. A release is cut by tagging:

# 1. bump `version` in Cargo.toml (the release job refuses a tag that does not match it)
# 2. update CHANGELOG.md
git commit -am "Release v0.3.0"
git tag -a v0.3.0 -m "v0.3.0"
git push origin main v0.3.0

.github/workflows/release.yml then builds the .deb, .rpm, AppImage, source tarball and a PKGBUILD for that tag, writes SHA256SUMS, and publishes a GitHub Release with auto-generated notes. Tags containing a - (e.g. v0.3.0-beta.1) are published as pre-releases; their package versions use ~ (0.3.0~beta.1).

Notes

  • Privilege escalation: The app uses pkexec to run a helper binary (cli_helper) for writing to USB devices. You may be prompted for your password.
  • Dependency check: On startup, the app checks for required system packages and will show a dialog with install instructions if anything is missing.
  • Windows support: Native Windows support is planned but not yet implemented. For now, use on Linux.

Direct dd Mode (Advanced / Optional)

  • Warning - not recommended for Windows 10/11 UEFI: This mode writes the ISO directly without creating the required GPT dual-partition layout (FAT32 BOOT + NTFS ESD-USB). It may fail to boot on modern UEFI systems or with files >4GB.
  • The GUI exposes this option under Windows advanced options with a warning dialog; it is off by default.
  • CLI helper: cli_helper <iso> <device> [--cluster BYTES] [--use-dd-mode] [--bypass-tpm] [--bypass-secure-boot] [--bypass-ram] [--skip-verify] (run as root; same flows as the GUI). Verification is on by default and roughly doubles the wall time on slow sticks (it reads the whole stick back); --skip-verify disables it.
  • Recommended: use the default dual-partition flow, which mirrors Microsoft’s Media Creation Tool behavior.
  • Reference: https://learn.microsoft.com/windows-hardware/manufacture/desktop/create-uefi-based-hard-drive-partitions

Troubleshooting

  • If the app fails to start, ensure all dependencies are installed (see above).

  • If USB devices do not appear, try re-plugging the device or running the app with appropriate permissions.

  • For any other issues, check the real-time log output for details.

  • Windows Setup fails after "copying files 100%" with a generic "Windows installation encountered an error": the media is almost never the culprit (the app verifies the copy). Plug the stick into a rear USB port wired directly to the motherboard (USB 2.0 if available); WinPE's xHCI driver is unforgiving on front-panel hubs. The real code is in X:\Windows\Panther\setuperr.log (Shift+F10 opens a console).

TODO

  • Fix releases by target (DEB, RPM, Flatpak, etc.) to ensure all packaging flows are healthy.
  • Persistence: detection and partition creation work, but boot-time persistence is still non-functional.
  • GUI improvements: modernize multi-step UX (e.g., clearer flows similar to Fedora Media Writer or Balena).
  • Download ISOs from the app (explore Rufus-like approach; consider APIs such as https://os.click/en, ask owner for API access).
  • Block data collection like Rufus does (evaluate feasibility with the Autounattend.xml approach).

Project Structure

  • src/main.rs — GUI entrypoint and privilege handling
  • src/gui/ — GTK4 UI (app.rs, dialogs.rs, widgets.rs) with logging and advanced options
  • src/flows/ — Linux and Windows write flows (dual-partition Windows, optional dd, bypass injection)
  • src/windows/ — Autounattend.xml generation (TPM/Secure Boot/RAM bypass)
  • src/flows/verify.rs — Post-write read-back verification (tree byte-compare, 7z CRC32 table, raw image prefix)
  • src/utils.rs — Device detection, dependency checks, environment helpers
  • src/bin/cli_helper.rs — Helper binary for privileged operations
  • scripts/ — Benchmark and helper scripts
  • Cargo.toml — Project manifest and dependencies

License

MIT License. See LICENSE for details.


Credits

  • Developed by Vic RH
  • Inspired by open-source USB creation tools like Rufus. :)

Contributing

Pull requests and issues are welcome! Please open an issue for bugs or feature requests.

About

No description, website, or topics provided.

Resources

Contributing

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages