Skip to content

Repository files navigation

Ventoy Theme Previewer (Tauri)

Cross-platform Ventoy theme previewer built with Tauri (Rust backend + React frontend). It detects QEMU, lets you pick a Ventoy USB drive, and boots it in QEMU snapshot/readonly mode with configurable memory, resolution, GPU, and fullscreen.

Requirements

  • Rust toolchain (for Tauri backend)
  • Node 18+ (for frontend) and npm
  • QEMU on the host (the app can try to install via winget on Windows or apt on Debian/Ubuntu)

Quick Start

npm install
npm run tauri:dev

For a release build:

npm run tauri:build

Usage

  1. Launch the app; it checks for QEMU (qemu-system-x86_64[w].exe on Windows or qemu-system-x86_64 on Linux) and common install paths.
  2. If QEMU is missing, click “Install QEMU” (winget on Windows, pkexec/sudo apt on Linux) or “Select QEMU…” to browse to the executable.
  3. Pick a removable drive from the table. The app runs Ventoy heuristics on mounted partitions (looks for ventoy/, ventoy.json, ventoy.cfg, EFI/BOOT).
  4. Configure:
    • Memory (default 1024 MB)
    • Resolution presets or custom (e.g., 1920x1080)
    • GPU: virtio-vga (fast, EDID) or VGA (compat, EDID)
    • Firmware: BIOS (default) or UEFI (if OVMF present in common locations)
    • Fullscreen toggle
  5. Click “Preview Theme” to launch QEMU in snapshot mode with readonly raw disk access. Use “Stop Preview” to terminate the session.

Safety Notes

  • QEMU runs with -snapshot and readonly=on for the raw drive to avoid writes.
  • Raw disk access may still require Administrator/root. On Windows, winget install uses elevation; QEMU launch itself does not auto-elevate—run the app elevated if needed.

Backend Commands (Rust)

  • check_qemu: detect QEMU path and version; load config.
  • list_drives: Windows PowerShell (Get-CimInstance/Get-Volume) or lsblk -J -O on Linux.
  • launch_preview: build QEMU command with EDID resolution, snapshot, virtio/vga GPU choice, optional fullscreen and OVMF.
  • stop_preview: terminate the running QEMU child.
  • install_qemu: winget (Windows) or apt via pkexec/sudo (Debian/Ubuntu).
  • Config stored at ~/.config/ventoy-theme-previewer/config.json (Windows uses the standard roaming config dir) with keys: qemu_path, last_selected_drive, memory_mb, resolution, firmware_mode, gpu_mode, fullscreen.

Frontend (React)

  • src/App.tsx handles UI flow, calls Tauri commands via @tauri-apps/api invocations.
  • Simple card layout with drive table, QEMU actions, advanced options, and status footer.

Troubleshooting

  • QEMU not found: set a custom path via “Select QEMU…” or install via the provided button.
  • Permission denied opening PhysicalDriveN//dev/sdX: run the app/QEMU elevated (Administrator/root).
  • UEFI toggle disabled: install OVMF (ovmf/edk2-ovmf packages on Linux, ensure OVMF_CODE/OVMF_VARS under C:\Program Files\qemu\share on Windows).

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages