How To Set up Vagrant Environment
As development workflows become more complex, tools like Vagrant become essential. Container technologies like Docker are also gaining popularity, but Vagrant’s VM-based approach offers superior isolation and compatibility with legacy systems.
By automating the setup process, we remove barriers to adoption and make powerful development tools accessible to everyone, from seasoned professionals to newcomers just starting their coding journey.
@echo off
echo Setting up Vagrant environment...
REM Set execution policy and install Scoop if not present
powershell -Command "Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser"
powershell -Command "if (!(Get-Command scoop -ErrorAction SilentlyContinue)) { Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression }"
REM Add extras bucket and install VirtualBox and Vagrant
powershell -Command "scoop bucket add extras; scoop install virtualbox vagrant"
REM Create vagrant directory and navigate to it
if not exist vagrant mkdir vagrant
cd vagrant
REM Initialize Vagrant with hashicorp/bionic64 box
vagrant init hashicorp/bionic64
REM Start the Vagrant machine
vagrant up
REM SSH into the machine
vagrant ssh
echo Vagrant environment setup complete!
Login
0 Comments
Oldest