0% found this document useful (0 votes)
15 views4 pages

Vagrant Updated Notes-SessionHandouts

This document serves as a comprehensive guide to Virtual Machines (VMs) and Vagrant, detailing what a VM is, popular VM platforms, and the functionalities of Vagrant as an open-source tool for managing VMs. It includes installation steps, essential commands, and useful tips for users. Additionally, it provides references for further information on Vagrant and VirtualBox.

Uploaded by

Shruthi Gowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

Vagrant Updated Notes-SessionHandouts

This document serves as a comprehensive guide to Virtual Machines (VMs) and Vagrant, detailing what a VM is, popular VM platforms, and the functionalities of Vagrant as an open-source tool for managing VMs. It includes installation steps, essential commands, and useful tips for users. Additionally, it provides references for further information on Vagrant and VirtualBox.

Uploaded by

Shruthi Gowda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Vagrant Updated Notes

Virtual Machines (VM) & Vagrant - Notes 🌟


What is a VM (Virtual Machine)? 💻
A virtual machine (VM) is a software-based computer that runs inside another physical computer, called the
host machine.
The VM is created and managed by special software called a hypervisor, which is installed on the host machine.
Hypervisor provides mechanisms for sharing the physical resources of the host machine among multiple VMs,
ensuring:
Each VM has its own isolated and secure environment.

Popular VM Platforms: 🌍
✅ VirtualBox
✅ Amazon EC2
✅ Microsoft Azure
✅ Google Cloud Compute Engine
✅ DigitalOcean

What is Vagrant? 🚀
🔹 Open-source tool written in Ruby.
🔹 Automates the creation and management of Virtual Machines.
🔹 Uses a simple configuration file to specify the VM setup.
🔹 Creates a VM using the command:
1 vagrant up
2

🔹 Can control VMs via command-line using Vagrant commands.


Vagrant History: 📜

📌 Created as a personal side-project by Mitchell Hashimoto in January 2010.


📌 First version released in March 2010.
📌 HashiCorp was formed to support the full-time development of Vagrant.
Important Vagrant Terms: 📝
🔸 Provision – Setting up & configuring a VM (e.g., installing software, setting networks).
🔸 Vagrantfile – A Ruby-based configuration file that defines VM settings & provisions.
🔹 You don’t need to be an expert in Ruby to use it.
🔹 Can modify existing Vagrantfiles or copy and paste examples.

Vagrant Setup & Installation 🛠


Installing Vagrant on Windows & macOS

📌 Step 1: Download & Install Vagrant


🔗 Vagrant Download
✅ Check installation using:
1 vagrant --version
2

📌 Step 2: Choose a VM Provider (e.g., VirtualBox, Hyper-V, Docker).


🔗 Install VirtualBox
📌 Step 3: Create a new folder for your Vagrant project.
📌 Step 4: Open terminal/command line and initialize the Vagrant project:
1 vagrant init
2

💡 This creates a Vagrantfile in the folder.


📌 Step 5: Choose a pre-configured box:
🔗 Vagrant Boxes
🔹 Example:
1 config.vm.box = "ubuntu/bionic64"
2

🔹 Alternative method:
1 vagrant init centos/7
2 vagrant box add centos/7
3

📌 Step 6: Start the VM 🚀


1 vagrant up
2

💡 The first time, Vagrant will download the box from the internet.
📌 Step 7: Connect to the VM via SSH:
1 vagrant ssh
2
Vagrant Box Commands 📦
Command Description

vagrant box add <box> Adds a box to the local repository

vagrant box list Lists all available boxes

vagrant box outdated Checks if any box is outdated

vagrant box update <box> Updates a box to a new version

vagrant box repackage <box> Repackages a box with a new name

vagrant box prune Removes outdated boxes

vagrant box remove <box> Deletes a box from the local repository

📍 Location of VM Boxes:
📌 Mac/Linux: ~/.vagrant.d/boxes
📌 Windows: C:/Users/USERNAME/.vagrant.d/boxes

Essential Vagrant Commands ⚡


Command Description

vagrant init Initializes a new Vagrant environment

vagrant up Creates & configures the guest machine

vagrant ssh Logs into the guest machine via SSH

vagrant halt Stops the guest machine

vagrant suspend Suspends the guest machine

vagrant resume Resumes a suspended machine

vagrant reload Restarts the guest machine

vagrant destroy Stops & deletes the VM

vagrant status Shows VM status

vagrant provision Runs provisioning scripts

vagrant package Packages a running VM into a reusable box

vagrant plugin install <plugin> Installs a plugin

vagrant plugin list Lists installed plugins

vagrant plugin uninstall <plugin> Uninstalls a plugin


Useful Vagrant Tips & Tricks 💡
📌 Get help for any command:
1 vagrant --help
2

📌 For VirtualBox Users:


✔ List all VMs:

1 vboxmanage list vms


2

✔ List running VMs:

1 vboxmanage list runningvms


2

References 📚
🔗 Vagrant Documentation – developer.hashicorp.com/vagrant
🔗 VirtualBox Downloads – virtualbox.org
🔗 Vagrant Box Search – app.vagrantup.com/boxes/search

This document provides a structured, colorful, and well-organized guide to VMs and Vagrant.😊

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy