This website is preserved for historical and scholarly reference and is no longer actively maintained.

VirtualBox Introduction and Setup

Last update: 8/30/2021


This page highlights installing a VM using VirtualBox.  This page is likely to expand and change as it is used to support multiple classes.  Some classes will install a single VM (VM1,   Ubuntu 18.04 or 20.04) and other classes will install two VMs,   VM1 (Ubuntu)  and a Kali VM.  The former will be called either VM1 or Ubuntu-VM.  The latter will be called either VM2 or Kali-VM. 

See Section 2 for importing a VM appliance.   See Section 3 for installing a VM 'the long way' -   you will need a ISO file holding the OS you wish to run in your VM.

Before getting started with VirtualBox, please note the following:



1 VirtualBox Downloads and Documentation

 



2   Importing a VM Appliance 

 

Step 1. Download the OVA file to your computer

Step 2.  From Vbox Manager, select File and then select Import

Step 3.  After the OVA file is imported your should see the new VM in the VBOx Manager's list.   Select the VM and then Start

Step 4.  You should see the guest OS boot.   The default network is called 'NAT'.   Open a terminal,   issue an 'ip link' or 'ifconfig'  - you should see two interfaces.  The lo is the 'loopback' interface.  Depending on your system, the name of the virtual ethernet is something similar to enp0s3.  Try  'ping localhost'  and then 'ping 8.8.8.8' -  the former pings the localhost and the latter pings a google DNS server.



3   Installing a Guest OS on a VirtualBox VM by installing a guest OS ISO file

Step 1. Install VirtualBox on your Host OS.


Step 2. Create a VM

 

Step 3. Install a Guest OS

 

Step 4. Install the "Guest Additions" - which adds optimized drivers to your Linux installation.

Step 5 Tweak your VM settings to enable these useful features::

 

 

Step 6 Setup Networking on the VM

When installing just one VM, the default networking that is setup by VirtualBox is sufficient. It allows the VM to reach the Internet - but it does not allow any Hosts from an outside network to reach the VM (unless the VM initiates the connection).

Refer to this page for further information on network options.

 

Step 7 Additional setup through the command line interface

 

After virtualBox is installed, a set of helpful command line programs are available on your Host OS. On a Windows Host OS, these programs are located in C:\Program Files\Oracle\VirtualBox.

The main command line interface program is vboxmanage. I usually add the path to my User Path environment (on Windows, Control Panel, System, Advanced Settings and then Environment Variables).

Try 'VboxManage' for a list of all command options.

VboxManage list vms ; lists the names of your VMs.

VboxManage showvminfo VM1 ;shows all info for the VM named VM1

You can configure more properties and aspects of each VM through the command line interface. Refer to the Users Manual for details.

 


4  Misc Info



Snapshots, clones, and export/import 

Three very  useful capabilities provided by most VMM systems are snapshots, clones, and export/imports.



5   Final Touches

After a fresh install of Ubuntu, you should do a 'sudo apt update'. Then issue 'sudo apt-get install xxx' the following (note that some of these might already be on your system).. To see all installed, 'apt-cache pkgnames', To see if a specific pkg is installed, like iperf, 'apt-cache showpkg iperf', And if you know the program you want to get but it is different from the package name, you can try 'apt-cache showpkg iperf'.

The following are optionally







Virtual Box  FAQ

As we continue to experience and debug VM related problems we will post the questions/answers below


Problem:  A Ubuntu 18.04 VM does not size correctly on your host OS (i.e., your laptop).
Answer:   There are other similar problems and many possible fixes.   Here are some things to try:


Problem:  On a Ubuntu VM, what are the best terminal profile settings ?
Answer:   Try a color combination of black text on a white background.