A modular desktop GUI tool for managing WSL distributions with copy/migration and management features.
wsl_operations.py: WSL command operations (shutdown, export, unregister, import, set-default, start, terminate)gui.py: GUI interface and logic with notebook tabs for copy and managementutils.py: Common utilities and validation functionsmain.py: Application entry point
Copy an existing WSL distribution through a complete workflow:
- Shutdown the source distribution
- Export it to a tar file
- Unregister the source distribution
- Import the tar file as a new distribution
- Set the new distribution as default
Manage all installed WSL distributions:
- View all available distributions
- Start a distribution
- Stop (shutdown) a distribution
- Terminate a distribution forcefully
- Delete (unregister) a distribution with confirmation
- Set a distribution as default
- Windows with WSL installed
- Python 3.x
- tkinter (usually included with Python)
- Ensure WSL is installed on your Windows system
- Install Python 3.x
- Install dependencies:
pip install tkinter(usually pre-installed)
python src/main.py- Select a source WSL distribution from the dropdown
- Enter a name for the new distribution
- Choose an export/import directory using the Browse button
- Click "Copy WSL Distribution" to start the process
- Monitor progress in the progress bar
- The new distribution will be created and set as default
- View the list of available WSL distributions
- Click "Refresh" to update the list
- Select a distribution from the list
- Use the buttons to perform actions:
- Start: Launch the selected distribution
- Stop: Shutdown the selected distribution gracefully
- Terminate: Forcefully terminate the selected distribution
- Delete: Unregister the selected distribution (requires confirmation)
- Set Default: Make the selected distribution the default
- Distribution names must contain only letters, numbers, hyphens, and underscores
- Prevents creating distributions with existing names
- Validates directory existence and write permissions
- Provides user-friendly error messages for all operations
- Confirmation dialogs for destructive operations
Run tests with pytest:
pytest tests/The application follows a modular design:
- wsl_operations.py: Pure functions for WSL command execution
- gui.py: GUI logic separated from business logic
- utils.py: Shared validation and utility functions
- main.py: Simple entry point
This separation ensures maintainability and testability.