Install Ubuntu Server 14.04.4 on VirtualBox


Posted by Daniel Lanza on April 15, 2016

This tutorial will explain how to install Ubuntu Server on a virtual machine.

First, you need to have Ubuntu Server ISO file and VirtualBox installed.

Create a new virtual machine on VirtualBox by clicking on New.

Create new virtual machine

Select type and version of the virtual machine. In this case, Linux and Ubuntu (64-bits).

Select type and version of the virtual machine

Select the amount of memory (RAM). VirtualBox recommends 768 MB. I selected 1,536 MB to have enough memory.

Select the amount of memory (RAM)

Select the hard disk size. 16 GB is enough.

Select the hard disk size

Click and start the new virtual machine.

Click and start the virtual machine

At this point, you need to load the Ubuntu Server ISO file.

Load Ubuntu Server ISO

Ubuntu Server installation has started. Select the language. In this example, English.

English language

Select Install Ubuntu Server.

Install Ubuntu Server

Choose your language, location and country of origin keyboard.

Language Ubuntu Server

Location Ubuntu Server

Country of origin keyboard

Type the Ubuntu Server hostname. This hostname will be used to access the server. I typed ubuntuvmsrv. vm means virtual machine on the network and srv server.

Ubuntu Server hostname

Type your real name, your username and your password.

Full name

Username

User password

Ubuntu can guide you regarding partitions. This is a virtual machine to test, so I selected Guided - use entire disk.

Partition disk

Configure updates as you want. I select manually updates.

Ubuntu updates

You can choose software installation. I chose (with space bar):

Software installation

Set MySQL server root password.

MySQL server root password

Select install GRBU boot loader on hard disk.

Create new virtual machine

Congratullations! You have first installed Ubuntu Server on a virtual machine.

Installation complete

The virtual machine is restarted, and you will get a prompt to login. Use your username and password to login.

Login Ubuntu Server

Ubuntu Server

Update your Ubuntu Server with the following command:

sudo apt-get upgrade

Upgrade Ubuntu Server

The Ubuntu Server is ready to use. Although, a virtual machine network setting is needed.

We will need two network adapters:

NAT network adapter

Host only adapter

Check out your virtual machine recognizes the two adapters.

$ ls /sys/class/net
eth0 eth1 lo

Add the second interface with a static IP address for the host-only adapter (eth1).

sudo vim /etc/network/interface

Type the following text and save.

# This file describes the network interface available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface (NAT adapter)
auto eth0
iface eth0 inet dhcp

# The second network interface (Host-only adapter)
auto eth1
iface eth1 inet static
address 192.168.56.101
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255

Restart the virtual machine.

sudo shutdown -h now

When Ubuntu Server is started, check out the static IP address for host-only adapter is available to show (eth1).

ip addr show

Static IP address for host-only adapter

Type the IP in your local machine, and you will see the Apache2 Ubuntu Default Page.

Apache2 Ubuntu Default Page

Enjoy your new virtual machine! 😃