RepositoryPowerShellUSUnited States
hyperphantasia

hyperphantasia/WSL-VHDX-Compact

Free up space (effortlessly) on WSL2 with VHDX Compaction.

137stars
8forks
1issues
4views

Thành tựu nổi bật

Những danh hiệu mới nhất của dự án

1
TINIX TRENDING·Chủ đề: ext4

#1 Repository Của Tuần

1
TINIX TRENDING·Chủ đề: disk-management

#1 Repository Của Tuần

1
TINIX TRENDING·Chủ đề: storage-management

#1 Repository Của Tuần

🧹 Tự động thu gọn ext4.vhdx WSL2 để giải phóng không gian đĩa

Script PowerShell giúp thu hẹp tệp ext4.vhdx của WSL2 mà bạn không cần thao thủ công.

Dự án WSL-VHDX-Compact của người dùng GitHub hyperphantasia là một script PowerShell giúp bạn tự động hóa quá trình thu gọn (compact) tệp ext4.vhdx dùng bởi các bản phân phối WSL 2. Khi bạn xóa tệp hoặc gỡ ứng dụng trong Linux, tệp VHDX không tự động thu nhỏ — dẫn đến lãng phí hàng trăm MB hoặc thậm chí vài GB dung lượng. Script này giải quyết vấn đề này một cách nhanh chóng và không cần can thiệp thủ công.

✨ Điểm nổi bật

  • Tự động thu gọn ext4.vhdx: tìm và thu gọn tệp VHDX của từng bản phân phối WSL2 mà bạn chỉ định.
  • Chế độ tương tác và không tương tác: hỗ trợ truyền tên bản phân phối qua tham số -DistroName.
  • Ưu tiên Optimize-VHD: dùng lệnh Optimize-VHD nhanh hơn trên hệ thống có Hyper-V, với phương án dự phòng là diskpart.
  • Giao diện người dùng đơn giản: hiển thị thông tin cơ bản về quá trình thu gọn và kết quả.
  • Hỗ trợ cài đặt qua PowerShell Gallery: dễ dàng tích hợp và cập nhật.
  • Có phiên bản .exe: cho phép chạy mà không cần mở PowerShell.

💡 Vì sao đáng chú ý

Không giống như việc phải thực hiện thủ công bằng Disk Management hay Diskpart, script này tự động xử lý toàn bộ quy trình: tắt dịch vụ WSL, thu gọn VHDX, và khởi động lại. Đặc biệt hữu ích cho người dùng làm việc với môi trường dữ liệu lớn hoặc data science, nơi dung lượng ảnh hưởng trực tiếp đến hiệu suất hệ thống. Và nếu bạn ngại dùng phiên bản .exe do lo ngại phần mềm diệt mã độc, bạn vẫn có thể chạy trực tiếp script .ps1.


#WSL2 #PowerShell #DiskSpace #StorageManagement #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryNix
nix-community/NixOS-WSL

NixOS on WSL [maintainer=@nzbr]

3.2k
Nov 17, 2026
RepositoryRust
nullpo-head/wsl-distrod

Distrod is a meta-distro for WSL 2 which installs Ubuntu, Arch, Debian, Gentoo, etc. with systemd in a minute for you. Distrod also has built-in auto-start feature on Windows startup and port forwarding ability.

1.9k
Oct 5, 2025
RepositoryPowerShell
pxlrbt/move-wsl

Easily move your WSL distros VHDX file to a new location.

1.6k
Sep 11, 2026
RepositoryC#
dorssel/usbipd-win

Windows software for sharing locally connected USB devices to other machines, including Hyper-V guests and WSL 2.

6.3k
Nov 17, 2026
RepositoryC#
gerardog/gsudo

Sudo for Windows

6.1k
Aug 12, 2026
RepositoryRust
owu/wsl-dashboard

A GUI manager for WSL featuring a modern UI — a lightweight, low‑memory, high‑performance dashboard to manage WSL instances. Install, list, start, stop, unregister, and configure your WSL distros​ from one place.

4.1k
Nov 1, 2026
RepositoryDart
bostrot/wslmanager

GUI for the Windows Subsystem for Linux — and native Linux/macOS VMs on Mac. Install, back up, move and configure distros without CLI flags; AI assistant with tools, MCP server for agents, remote WSL over SSH.

4.1k
Nov 23, 2026
RepositoryRust
DeterminateSystems/nix-installer

Install Nix and flakes with the fast and reliable Determinate Nix Installer, with over 7 million installs.

3.7k
Nov 19, 2026
RepositoryShell
webinstall/webi-installers

Primary and community-submitted packages for webinstall.dev

3.0k
Oct 7, 2026