[Linux Fedora] Vagrant up Fedora on VirtualBox

Vagrant up Fedora

This article is about to run Fedora on VirtualBox with Vagrant.

Prerequisites

Vagrant

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 by HashiCorp - https://www.vagrantup.com/

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# macOS
$ brew install vagrant

# CentOS
$ sudo yum install -y yum-utils

$ sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo

$ sudo yum -y install vagrant

# Ubuntu
$ curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -

$ sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"

$ sudo apt-get update && sudo apt-get install vagrant

See Downloads | Vagrant by HashiCorp - https://www.vagrantup.com/downloads to learn more.

VirtualBox

VirtualBox is a powerful x86 and AMD64/Intel64 virtualization product for enterprise as well as home use. Not only is VirtualBox an extremely feature rich, high performance product for enterprise customers, it is also the only professional solution that is freely available as Open Source Software under the terms of the GNU General Public License (GPL) version 2. See “About VirtualBox” for an introduction.

Oracle VM VirtualBox - https://www.virtualbox.org/

While Vagrant ships out of the box with support for VirtualBox, Hyper-V, and Docker, Vagrant has the ability to manage other types of machines as well.

In these tutorials, your project was backed with VirtualBox. But Vagrant can work with a wide variety of backend providers, such as VMware, Hyper-V, and more.

1
2
# macOS
$ brew install vagrant

See Downloads – Oracle VM VirtualBox - https://www.virtualbox.org/wiki/Downloads to learn more.

Fedora

Fedora Cloud Base images are for creating general purpose virtual machines (VMs). You can use the Qcow 2 image for use with Openstack or the compressed raw image. If you are not sure what to use, try the raw image.

Fedora is always free for anyone to use, modify, and distribute. It is built and used by people across the globe who work together as a community.

Usages

Vagrant Init

1
2
3
4
5
6
7
8
9
$ mkdir -p col-fedora

$ cd col-fedora

$ vagrant init fedora/35-cloud-base
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

Vagrant Up

1
2
3
4
5
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'fedora/35-cloud-base'...
...
==> default: Rsyncing folder: /Users/cloudolife/col-fedora/ => /vagrant

Vagrant SSH

1
2
3
4
5
6
7
8
[vagrant@col-fedora-35 fedora-35-s72]$ vagrant ssh
Last login: Tue Mar 29 07:33:47 2022 from 10.0.2.2

[vagrant@fedora-35 ~]$ uname -a
Linux fedora-35 5.16.16-200.fc35.x86_64 #1 SMP PREEMPT Sat Mar 19 13:52:41 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

[vagrant@fedora-35 ~]$ cat /etc/redhat-release
Fedora release 35 (Thirty Five)

References

[1] Vagrant by HashiCorp - https://www.vagrantup.com/

[2] almalinux - Vagrant Cloud - https://app.vagrantup.com/almalinux

[3] AlmaLinux OS Blog - https://almalinux.org/blog/

[4] Oracle VM VirtualBox - https://www.virtualbox.org/