How to create a VirtualBox machine using Vagrant on Ubuntu 22.04

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Search for a command to run...

Postgraduate in Communications Engineering with working experience in the Support Desk and self-study in software development.
Wireshark is a network packet analyzer. A network packet analyzer presents captured packet data in as much detail as possible. You could think of a network packet analyzer as a measuring device for examining what’s happening inside a network cable, j...
The git log command is used to view the commit history of a Git repository. You can customize the output format to show specific details in a more readable or structured way. Below are some useful variations and formatting options for git log: To sh...

Overview This article will teach us how to: Install Ubuntu Server 24.04 on a laptop from scratch Install Ubuntu server by using Vagrant tool with ISO image Prerequisites: A laptop without any OS installed; A virtualization software Virtualbox t...

The /etc/passwd and /etc/shadow files are the backbone of Linux user management. Together, they store user account information and handle authentication securely. This article provides a hands-on guide to understanding these files, their structure, a...

In Linux, links are powerful tools that allow you to create references to files and directories. There are two main types of links: hard links and soft links (also known as symbolic links or symlinks). Understanding the differences between these two ...

A hostname is a human-friendly name given to a computer. It is a unique identifier that allows us to identify the machine in various network communications, making it easier to locate and manage devices. Type: hostname To see where it is stored, typ...

Vagrant is a tool for building and managing virtual machine environments in a single workflow. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases production parity, and makes the "works on my machine" excuse a relic of the past.
Vagrant allows you to work on any project, install every dependency that the project needs, and set up any networking or synced folders, so you can continue working from the comfort of your machine.
This hands-on lab focuses on the creation of a development environment with Vagrant which uses CentOS/7 as a base image.
To initialize a new Vagrant environment by creating a new Vagrantfile, run the command:
vagrant init
Configure the project to use "CentOS 7" as a base image. Open the newly created Vagrantfile and edit the line:
config.vm.box = "centos/7"
To bring up the virtual machine running CentOS 7, enter the command:
vagrant up

With just one line of configuration and one command in the terminal, a fully functional, SSH-accessible virtual machine was brought up.
Vagrant runs the virtual machine without a UI, therefore it is not possible to see anything. To prove that it is running, SSH into the machine.
vagrant ssh
This command will drop into a full-fledged SSH session.

Terminate the SSH session with CTRL+D, or by logging out.

Once you're back on your host machine, stop the machine that Vagrant is managing and remove all the resources (disk space and system resources) created during the machine-creation process. When prompted, confirm with a yes.
vagrant destroy

This command does not remove the downloaded box file.
To list box files:
vagrant box list

To remove the box file, run the remove subcommand, providing the name of your box:
vagrant box remove centos/7