Ubuntu Virtual Machine Installation Demo
In this demo, we will
- install VirtualBox
- create a Ubuntu Server VM using VirtualBox
- use SSH to connect to the Ubuntu VM to install free5GC stage 3
- Update and upgrade Ubuntu
1. Install VirtualBox
virtualbox download”, or visit virtualbox.org to download and install VirtualBox (currently 6.1.18) for your operation system
once installed VirtualBox, launch and see if you have something like this:
2. Download Ubuntu Server
ubuntu server download” on the web and download the latest Ubuntu Server LTS, or visit ubuntu.com, choose Manual Installation Option to download the .iso file (currently 20.04.2 LTS)
you should have downloaded a .iso image file with name like
ubuntu-20.04.1-live-server-amd64.iso, probably in your download directory.
3. Create a Ubuntu Server VM
Launch VirtualBox and create your first Ubuntu VM using the downloaded .iso image file. We use Ubuntu Server instead of Ubuntu Desktop because we only need a basic server machine without too many unnecessary functionalities. The resulting overhead to your host machine is smaller, and the VM starts up faster too.
Some notes when creating a new VM:
- Name the first VM using a generic name as
- You can pick 1 or 2 (or more) CPUs, and about 2048M memory, although you can change them later
- in addition to the default NAT network interface, also add another “Host-only” network interface.
Start Installing Ubuntu
Some notes about installing Ubuntu:
- it is recommended that you choose short username and password for ease of typing later
- not choosing LVM will make it a little bit easier later if you want to extend your disk space
- choose to include SSH Server
- let security update complete
Log in into Ubuntu
Reboot after Ubuntu installation complete; wait a little bit for some initialization steps complete. Then log in with your username and password.
First try the
ubuntu@ubuntu:~$ ifconfig Command 'ifconfig' not found, but can be installed with: sudo apt install net-tools ubuntu@ubuntu:~$
If some messages like above show, it means
ifconfig has not been installed
ifconfig is no longer installed by defaults in newer Ubuntu, and
is replaced by more versatile
ip command, but we will use it here for simplicity).
Follow its suggestion and install
ubuntu@ubuntu:~$ sudo apt install net-tools
Below shows the installation result:
ifconfig again to check the network interfaces:
Your display may look different, but take notes about the IP address of
the Host-only interface card. The example above shows
You can SSH from your host machine into this Ubuntu VM using the IP later.
(Another IP address,
10.0.2.15 is the IP address of the NAT interface card,
the apps in your host machine cannot access it).
Finally check if the VM has internet access:
ubuntu@ubuntu:~$ ping google.com
Refer to the first part of the video Ping, SSH, and Upgrade
4. Connect to the Ubuntu VM using SSH
Launch your favorite SSH client from the host machine.
Some operation systems (Mac, Ubuntu, some Windows) have pre-installed SSH clients. If you are using Windows, you can also download third-party SSH clients. For example, search “windows ssh download” on the web and you can find PuTTY site
The benefit of using SSH is that you can easily copy and paste commands from your machine to Ubuntu VM for execution, and vice versa. You can also create multiple SSH connections with the Ubuntu VM for control and monitoring at the same time.
Below shows some examples on a Mac host machine. Suppose the
Host-only network IP is
192.168.56.101, and tue username is
ssh 192.168.56.101 -l ubuntu
The first time you connect to the VM, your SSH client may show
some message asking you for confirmation. Enter
(If somehow SSH shows some warning messages telling you the
machine has potential security risk, you may have to remove
an entry in the file
<your home directory>/.ssh/known_hosts
related the the IP address).
If you log in successfully, you will enter a command line interface:
Repeat the basic commands such as
ifconfig to see if
the VM is working properly. If so, we can access the Ubuntu VM
“remotely” from now on.
Refer to the second part of the video Ping, SSH, and Upgrade
5. Update and Upgrade your Ubuntu
Let also update and upgrade the Ubuntu VM right now to make sure it is up-to-date with proper security updates.
sudo apt update sudo apt upgrade
Refer to the last part of the video Ping, SSH, and Upgrade