This script automates the setup of a development environment using Vagrant and Ubuntu. It ensures that you have the necessary tools and configurations to get started quickly. Here's how to use it:
- Ubuntu 22.04.5 LTS: Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy
- VirtualBox: VirtualBox Version: 7.0
- Vagrant 2.4.2: Vagrant is utilized to manage the Ubuntu virtual machine
-
Clone this repository to your local machine or download the script.
-
Open a terminal and navigate to the directory where the script is located.
-
Run the script using the following command:
vagrant up
-
Run to check the assigned IP using the following command:
vagrant ssh exit
-
To log in to the virtual machine from any directory, use the following command:
ssh user@[your-assigned-ip]
-
The script will create a Vagrant virtual machine based on the "ubuntu/focal64" box image.
-
Once the VM is up and running, you can connect to it using SSH.
-
The VM is connected to your network via DHCP, and the default gateway is automatically detected.
-
The script also installs several useful packages, including Vim, Wget, Curl, Net-tools, Htop, Nmap, OpenSSH server, and OpenFortiVPN.
-
The default SSH configuration allows password authentication for ease of use.
You can customize the script by modifying the following variables:
BOX_IMAGE
: The base box image to use.USERNAME
: The desired username for the VM.PASSWORD
: The password for the user.MEMORY
: The amount of memory to allocate to the VM.CPUs
: The number of virtual CPUs for the VM.NETWORK_INTERFACE
: Defines the type of network interface.
The script automatically detects the network interface based on your setup. If you are using a cable connection, it defaults to "en0." If you are using Wi-Fi, it defaults to "wlp."
This script simplifies the setup of a development environment using Vagrant and Ubuntu, ensuring a smooth and consistent development experience.