ubuntu2004
is a Vagrant VM box built using Packer, Vagrant and VirtualBox. It uses Official Ubuntu 20.04 LTS server iso as the underlying image.
ubuntu2004 Releases
: Vagrant Cloud URL
Supported Provider: VirtualBox
IT professionals, organizations, enthusiasts or learners who wish to utilize an Ubuntu 20.04 LTS vagrant box built using Official Server Image.
It is expected that you have Vagrant and Virtualbox installed on your host machine (whether the host is Windows, Linux or OSX). If not, then please download/install Vagrant and Virtualbox.
This section covers easy to use steps to get started with downloading and virtualizing ubuntu2004
virtual environment.
Single Machine mode is a mode where you will only be initializing a fresh vagrant virtual envrionment to useubuntu2004
. Open CMD (for Windows host) or Terminal (for Linux/OSX host), then change to a directory of your liking on the Command Prompt or Terminal and run the following command:
vagrant init darkwizard242/ubuntu2004
Now that Vagrantfile
has been created for ubuntu2004
, you can initialize/boot up the box (it will download the box if not already downloaded) using the following command:
vagrant up
Once the box is up, do vagrant ssh
and you will be within the virtualized box.
As per Vagrant's website, "Vagrant is able to define and control multiple guest machines per Vagrantfile. This is known as a 'multi-machine' environment." So if you are running in a multi-machine mode, you can simple add the following chunk within the existing Vagrantfile:
config.vm.define "myubuntubox" do |myubuntubox|
myubuntubox.vm.box = "darkwizard242/ubuntu2004"
myubuntubox.vm.hostname = 'focalfossa.ubuntu.com'
end
Now run the following command so that the box can be downloaded (if not already) and be booted up:
vagrant up mydevopsbox
Once the box is up, do vagrant ssh mydevopsbox
and you will be within the virtualized box.
Like any other vagrant box, you can easily ssh into ubuntu2004 using the default vagrant ssh
(if using as a single machine mode) command or vagrant ssh myubuntubox
if using in a multi machine mode.
Below is table listing the type of users as well as their usernames and passwords:
User Type | Username | Password |
---|---|---|
System User | vagrant | password |
NOTE: Though, the password for vagrant user has been set by default by me so that anyone can use it easily. Feel free to change the password using the following command:
passwd vagrant
Following users have already been added as sudoers with privileges to perform desired operations without supplying passwords:
root@ubuntu2004:~$ grep -i vagrant /etc/sudoers
vagrant ALL=(ALL) NOPASSWD: ALL
Following table consists the system users and their $HOME
directories.
User | Home Directory |
---|---|
root | /root |
vagrant | /home/vagrant |
Vagrant box ubuntu2004
can be built using Packer. Pre-requisites include Virtualbox as that is the builder being used for the packer build.
Assuming that Virtualbox and Packer are installed on the host system with internet accessibility, you can build ubuntu2004
yourself using the following steps:
- Downloading ubuntu2004 source code archive:
wget -O vagrant-ubuntu-20.04.zip https://github.com/darkwizard242/vagrant-ubuntu-20.04/archive/master.zip
- Extracting vagrant-ubuntu-20.04 source code archive:
unzip vagrant-ubuntu-20.04.zip -d .
- Changing to packer build directory:
cd vagrant-ubuntu-20.04-master
- Once customized, run a packer build using:
packer build template-branch-others.json
Once you have built out a ubuntu2004
box. You can easily test it out by adding it as vagrant box using the following commands:
-
vagrant box add myubuntubox
/path/to/ubuntu2004.box - This command will add the newly built customized ubuntu2004 box to vagrant so that it can be used. It would be wise to use the exact path to the ubuntu2004 box you have built. -
vagrant init myubuntubox
- This command will initialize the box you have associated your vagrant image with. -
vagrant up myubuntubox
- Boots up the box.