The Fastest Way to an Ubuntu VM for prototyping

Hey dear people I hope you are safe!

A few years back someone yelled about how difficult it is to deploy your own personal Ubuntu VM. Especially set it up working with networking, data connection passwords/ssh etc. The pain was real if it was your first time back then! Well… You have been heard, here is the Fastest Way to an Ubuntu VM for prototyping!

Vagrant came to the rescue and stuffed a hole by enabling people to prototype their VM-networks before they deploy them to the cloud. Let us get to the point!

Install Chocolatey

If you haven’t heard it is like apt-get for Windows! Download that son of a package manager, it will make your life easier. If you have it continue to the next section!


Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

https://chocolatey.org/docs/installation

That is it done next!

Install VirtualBox and Vagrant

I tried to use VirtualBox in the beginning but had some issues with virtualization. Make sure in the System Information that virtualization is enabled for your PC and CPU.

virtualization enabled

virtualization enabled

If it is not enabled check your Bios settings:

bios virtualization settings

bios virtualization settings

After dealing with the virtualization support I installed VirtualBox by simply opening a Powershell in admin mode and typing:

cinst virtualbox -y

That was it you just installed VirtualBox! Finally I went further and installed Vagrant. Can you guess the command?

cinst vagrant -y

Now that you installed Vagrant let us get us an Ubuntu VM for testing!

Run the Ubuntu VM

I navigated to a folder where I wanted my Virtual Machine deployed and  let vagrant get me the machine I needed (Ubuntu 18.04).

vagrant box add ubuntu/bionic64

Next I initialized the machine with the following command:

vagrant init ubuntu/bionic64

And started it with the classic command:

vagrant up

When the machine started you can simply type the following command to ssh into Ubuntu!

vagrant ssh

That is it! You should see a shell-prompt inside the VM! If you wish to dive into the topic take a look back at the Hashicorp tutorials:

https://www.vagrantup.com/intro/getting-started/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.