Why AWS Might Not Be the Holy Grail You Think
Why Starting with Vagrant for Shell and Bash Scripting Might Be Wiser Than Directly Jumping to AWS
Introduction
Hey code enthusiasts! π Ready to learn the spells of the virtual realm? But slow down before you hop onto the AWS rollercoaster. Picture this: it's your first day in the coding gym β you wouldn't try bench pressing a truck, right? Instead of tackling the AWS heavyweight, let's warm up with lighter tools that won't break a sweat. πͺ Think of it as doing coding push-ups before attempting the big lifts. We're all about flexing those coding muscles, not pulling a coding muscle. Let's kick off the script party without accidentally triggering the AWS fireworks too soon! π₯
Exploring Tools for Windows and Mac to Chat with Linux π§°π¬
Alright, time to discover the magical scrolls (tools) that let you have a cozy chat with Linux, virtually hanging out in your computer! πͺβ¨ First up, for our Windows wizards:
Chocolaty π«:
What's the deal: It's like your software genie. Tells your computer what to wear and what tricks to do.
Summoning spell (installation): Open your PowerShell and say 'choco install chocolatey'. Abracadabra!
VirtualBox π¦:
What's the gossip: A virtual party organizer. It creates a VIP section for Linux in your Windows club.
Ritual (installation): Head to the VirtualBox website, grab the installer and click 'Next' like a champ.
Vagrant π§ββοΈ:
What's in the spellbook: Makes setting up your virtual Linux playground a breeze. No wands required.
Incantation (installation): Chug some coffee, open PowerShell, and type 'vagrant up'. Watch the magic unfold.
Git Bash π€:
What's the scoop: It's like giving your Windows a cool leather jacket with Linux patches.
Dress-up time (installation): Install Git for Windows, choose 'Git Bash' during installation. Now, you're the cool kid on the block.
And for our Mac mages, it's almost the same magical journey:
Brew πΊ:
What's in the cauldron: It's like having a personal potion shop for your Mac. Brews up whatever you need.
Potion-making (installation): Open your terminal and say 'brew install'. Wait for the magic potion to brew.
VirtualBox & Vagrant & Git Bash π¦π§ββοΈπ€:
- Same magical trio as Windows: Just sprinkle some extra Apple magic on the installations.
Now, with these tools in your spellbook, you're ready to charm Linux into chatting with you. β¨π¬ Just remember, even wizards started with abracadabras and 'Next' buttons. Don't worry we will be exploring these in detail. Happy conjuring.
Unleashing the Magic of Virtual Linux on Windowsπ»
Time to roll up those sleeves and dive into the enchanting world of installation and setup for our virtual Linux companions. Get your magic wands (or keyboards) ready! π§β¨
Chocolaty π«
Time for our first magical tool: Chocolaty! π«β¨ It's like a wizard's spell for Windows, letting you install software with a command line wave. Sure, you could manually Google each spell (software), but why not take the enchanted shortcut? This is your express lane to magical convenience! ππ»
Note: If you wish to skip this step, you can, but you will have to install all the tools manually by searching for each one. You can visit the link below for any updated information or follow my steps.
Now then, unleash the powers of your PowerShell with the grace of an administrator.
First, do a little jog with (Run) 'Get-ExecutionPolicy'. If it mumbles 'Restricted,' our next move is either 'Set-ExecutionPolicy AllSigned' or the more rebellious 'Set-ExecutionPolicy Bypass -Scope Process.' It's like teaching your computer a new dance β elegant PowerShell ballet, anyone? ππ€
Note: Quick heads-up: Keep an eye on your antivirusβit might throw a little tantrum and cause some restrictions. Just gently disable it for 15 min, and don't forget to restart the PowerShell.
Now if its AllSigned , for the grand spellcasting moment, paste the command:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
VirtualBox π¦
We've set up a comfy base for a hassle-free software installation. Ready for the magic? πͺβ¨
Now to install VirtualBox paste the below command on Windows PowerShell(Run as Administrator):
choco install virtualbox --version=7.0.8 -y
Make sure the installation is successful.
Vagrant π§ββοΈ
Ready for the next enchantment? Let's conjure up Vagrant for your mystical journey. π§ββοΈβ¨ Simply follow the incantations below to bring Vagrant to life:
choco install vagrant --version=2.3.7 -y
Git π€
Time to weave Git into your magical toolkit. πͺπ Cast the following spell to summon Git into your command realm:
choco install git -y
βJDK(Java development kit)
Bring the power of Java into your enchanted domain! πβ Unleash the spell for JDK installation below:
choco install corretto11jdk -y
Mavenπ
Let's harness the mystical powers of Maven for your magical projects. π§ββοΈβ¨ Cast the spell below to install Maven:
choco install maven -y
Why Vagrant for VMs
Alright, wizards in training, listen up! π§ββοΈβ¨ When it comes to learning shell scripting, AWS might be a bit too much at the start. But fear not, for there are two paths to unleash your coding spells One is to manual VM installations(which there will be a separate article) and vagrant:
No OS Installation Drama: π¦
- We've got these magical Vagrant Boxes, pre-packaged with the OS goodness. Think of them as ready-to-use potions you fetch from the Vagrant Cloud (a treasure trove of free boxes). No need to fuss with OS installations β it's like having your spell ingredients delivered to your doorstep!
Enter the Vagrantfile: π
- Imagine a magic book (Vagrantfile) where you scribble down all your wishes about your virtual world. You can manage all your VM settings in this spellbinding file. Change the number of wizards (VMs), their powers (configurations), and even instruct them with spells (provisioning).
Simple Commands, Big Magic: π©β¨
Vagrant comes with a set of enchanting commands:
vagrant up
: Summons your VMs into existence.vagrant halt
: Puts them to sleep.vagrant destroy
: Disbands the magical crew.vagrant ssh
: Opens a door to their mystical world.
That's the Vagrant magic in a nutshell! πͺ Now, let's get those virtual spells brewing without the fuss of manual VM installations. ππ»
Alright, magic apprentices, time to set up our Vagrant castle! π°β¨ Here's your spellbook:
Step 1: Unlock the Magic Door (Open Git Bash):
- Imagine Git Bash as the enchanted gateway to our mystical adventures. Open it up like you're unlocking the door to a wizard's lair.
Step 2: Forge a Magical Realm (Create a Folder):
Create a sanctuary for your spells. Either right-click to open Git Bash in an existing folder, or use the below magic command to create a new one.
mkdir /DevOps/VMs cd /DevOps/VMs/ mkdir centos mkdir ubuntu ls
Don't worry about the commands
mkdir, cd, ls
we will cover those in the future
Step 3: Summon the OS Image (Get it from Vagrant Cloud):
- Now, let's conjure the OS image from the Vagrant Cloud. It's like ordering a magical potion online. Lets install centos check wether we are in centos folder we created by
pwd
if not thencd /[Your drive]/DevOps/VMs/centos/
Now lets get the os Box/image name from VagrantCloud
Note: you can explore the vagrant cloud for now use this spell, right now iam using eurolinux-vagrant/centos-stream-9
vagrant init eurolinux-vagrant/centos-stream-9
Step 4: Establish the Magical Connection with Your Virtual Minions β¨π
Now that we've summoned our virtual minions, it's time to establish communication with them. Think of it like having a magical chat with your enchanted beings. Here's the spell:
In Git Bash, type:
vagrant up
vagrant ssh
π vagrant up
: Activates your virtual minions, bringing them to life.
Note: If you see any errors like schannel or Vbox hardening then check with your anti-virus , that is the culprit.
check for list of VM's by vagrant box list
.
check for status by vagrant status
you can see the VM is running in virtualbox.
π¬ vagrant ssh
: Opens a direct line of communication to step into their mystical realm.
There you go, fledgling sorcerers! Your Centos wizard's tower is emerging. πͺπ» Embrace the Vagrant magic as we embark on this enchanting journey!
Conclusion
Great job, magic learner! πβ¨ Now you know how to start Vagrant and talk to your virtual buddies. It's like having your own magical creatures ready to follow your commands. π§ββοΈπ» Ready for more magical adventures? Keep practicing and coding β you're on the right spellbinding path! ππ