From Empty Computer to Guest OS in 5 min – Install Vagrant and VirtualBox on Ubuntu 16.04.3 Live USB

With VirtualBox, you can run guest operating systems – Linux, Windows, OSX – under Linux.
Vagrant makes it easy to create a new headless guest system and connect to it with SSH.
It’s very fast: less than five minutes to desktop, with SSH connection to installed guest OS. And that’s starting from an empty computer with no operating system.

Prerequisites: Ubuntu 16.04.3 LTS and VT-X enabled

Use Xubuntu 16.04.3 LTS as the host OS – the real operating system running on top of hardware. You can use an installed Ubuntu or the latest Live USB.
For this test, I used Xubuntu 16.04.3 amd64 Live USB. I used an ISO image from Xubuntu.org, and created the Live USB with gnome-disk-utility (“Disks”) “Restore Disk Image…”. For the USB, I used Kingston Datatraveller 16 GB USB 3. I booted an HP deskop computer from the USB by clicking F9 multiple times on boot.
VT-X was already enabled in computer BIOS. This is required by VirtualBox.
As I’m using a Finnish keyboard, I opened a terminal and ‘setxkbmap fi’. Just for safety, I enabled firewall and blocked all incoming connections ‘sudo ufw enable’.

Install VirtualBox and Vagrant

$ sudo apt-get update
$ sudo apt-get -y install virtualbox vagrant

Create a New Virtual Machine & Connect

$ vagrant init bento/ubuntu-16.04
$ vagrant up
$ vagrant ssh

That’s it

In less than five minutes, I was logged into a guest OS. And that includes the time to live boot an empty computer without an operating system.
Virtualization is especially easy on Linux, thanks to Vagrant. It’s also interesting to note that VirtualBox works on a Live USB, as it can add the required kernel modules automatically and without rebooting.
By default, Live USB creates quite small RAM disk. You should be careful not to run out of disk space. You can check free space with ‘df -h /’.

Posted in Uncategorized | Tagged , , , , , | Comments Off on From Empty Computer to Guest OS in 5 min – Install Vagrant and VirtualBox on Ubuntu 16.04.3 Live USB

Comments are closed.