This script automates the installation of VirtualBox (on Linux) and the creation of a virtual machine using VBoxManage. It allows users to specify VM configurations such as name, OS type, memory size, disk size, and ISO path for installation.
- Installs VirtualBox (Linux only; Windows users must install manually).
- Creates a virtual machine with specified configurations.
- Attaches an ISO file for OS installation.
- Starts the virtual machine.
- Linux: The script installs VirtualBox automatically.
- Windows: Download and install VirtualBox manually from VirtualBox Downloads.
- Ensure
VBoxManageis accessible from the command line. - Python 3 installed.
- Clone this repository:
git clone https://github.com/anshajkrishnan/vboxpy.git cd vboxpy - Install dependencies:
pip install -r requirements.txt
Run the script and follow the prompts:
python vbox.py- VM Name: Name of the virtual machine.
- OS Type: Choose between
Ubuntu_64orWindows_64. - Memory Size: Amount of RAM (in MB) allocated to the VM.
- Disk Size: Size of the virtual hard disk (in MB).
- ISO Path: Path to the OS installation ISO file.
Enter VM Name: MyUbuntuVM
Select OS Type:
1. Ubuntu_64
2. Windows_64
Enter your choice (1-2): 1
Enter Memory Size (MB): 2048
Enter Disk Size (MB): 20000
Enter path to iso image: /path/to/ubuntu.isoThe script uses logging for status updates, warnings, and critical information. Logs are printed to the console.
This project is licensed under the MIT License.
Feel free to submit pull requests for enhancements or bug fixes.