Day 4 – Using Vagrant and VirtualBox to Automate virtual machine setup

Today is Day 4 of my DevOps journey. I explored how to automate VM creation using Vagrant with VirtualBox on my Windows machine. Instead of going through manual steps like yesterday, I let Vagrant handle VM setup for Ubuntu Server — automatically and cleanly.

⚙️ Tools I Used

  • Vagrant

  • VirtualBox

  • Terminal: Git Bash

    📦 Steps I Followed

    1. Installed Vagrant

      choco install vagrant
    

    2. Create Project Folder

    3. Started the VM

    4. SSH into the VM

    🧠 What I Learned

    • Vagrant makes VM setup repeatable and simple

    • VM boxes can be provisioned in seconds

    • You can destroy and rebuild VMs easily using:

        vagrant destroy 
        # to check global status use
        vagrant global-status
      

      🐛 Issues I Faced

      • vagrant ssh didn’t work it was timing out so I have to manually open the virtual box to connect now in the lastest version the error is gone.

🔮 What's Next

Tomorrow We are gonna dive into basics of Linux

0
Subscribe to my newsletter

Read articles from Shaharyar Shakir directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Shaharyar Shakir
Shaharyar Shakir