A collection of configuration files and a script designed to enhance Vagrant usage on Windows 11.
Ensure the following tools and Python modules are installed:
- VirtualBox: Hypervisor used for creating virtual machines.
- Vagrant: Required for managing virtual environments.
- Python: Ensure Python is installed and added to your system's PATH.
- Python Modules:
- pick: For menu selection.
- os: To change the working directory.
- subprocess: To execute PowerShell commands via Vagrant.
- tkinter: For file dialog to select the directory containing the Vagrantfile.
-
Clone this repository:
git clone https://github.com/akhos09/vagrant-utilities.git cd vagrant-utilities
-
Install required Python modules:
You can install the necessary modules using
pip
:pip install pick
Note:
os
,subprocess
, andtkinter
are standard libraries included with Python.
-
Run the script:
Open a terminal or command prompt, navigate to the directory containing the script, and execute:
python vagrantmanager.py
-
Import the Vagrantfile:
Use the second option in the script to select and import the desired Vagrantfile.
-
List all Vagrant machines:
Choose the first option in the script to display all existing Vagrant machines.
-
Delete a Vagrant machine:
Select the second option in the script and enter the ID of the machine you wish to delete (as shown in the list from the first option).
-
Package a machine into a box:
Use the "Package Machine" option to package an existing Vagrant machine into a reusable box file.
-
Manage Plugins:
Use the "Plugin Manager" option to install, update, or remove Vagrant plugins easily from within the script.
- Ensure that
Python
,VirtualBox
, andVagrant
are installed and up to date. - If a VM with the same name already exists, modify the name in the Vagrantfile or delete the existing VM to prevent conflicts.
- Remove unused network interfaces to avoid potential errors.
- If the installation stalls during the network interface renaming process (e.g., "eth1 renamed as enp0s8"), retry the operation. Persistent issues may indicate syntax errors in the Vagrantfile.
- If a VM's folder isn't deleted due to residual logs (often occurring when a VM is destroyed while running), manually delete the folder and attempt the operation again.
Planned features include:
- Linux support
- Making a .exe for the app.
This project is licensed under the Apache 2.0 License. See the LICENSE file for details.