How to install Ubuntu Server 18.04.3 LTS (Bionic Beaver) in VirtualBox. I’ll also demonstrate how to connect to the Ubuntu instance via SSH. This will form the basis for a second tutorial that will walk through installing and configuring Ruby on Rails on an Ubuntu server.
Let’s get started!
Download Ubuntu Server
The next thing to do is to grab a copy of Ubuntu Server. You can do this from their download page. This will download an 889MB iso file to your PC.
At the time of writing the current LTS version is Ubuntu Server 18.04.3 and this is what I’ll be using. It’s supported until April 2023 and is available as 64-bit only.
Create a New Virtual Machine
Startup VirtualBox. This should open the VirtualBox Manager, the interface from which you will administer all of your virtual machines.
Next Click on New (in the top right of the VirtualBox Manager), give your virtual machine a name and the two drop down menus should automatically update.
Click Next. The wizard will now ask you to select the amount of memory (RAM) in megabytes to be allocated to the virtual machine. I chose 2GB (2048 megabytes).
Click Next and you will be prompted to add a virtual hard disk to the new machine. Make sure that Create a virtual hard disk now is selected, then press Create.
Now we need to choose the file type for the new virtual hard disk. Make sure that VDI (VirtualBox Disk Image) is checked and press Next.
On the next screen, you will be asked whether the new virtual hard disk should grow as it is used (dynamically allocated) or if it should be created at its maximum size. Make sure that dynamically allocated is selected, then click Next.
Finally, select the size of the virtual hard disk in megabytes. The default size of 10GB should be plenty, but feel free to increase this as you see fit. Then click Create.
The hard disk should now be created and after a short while you should find yourself back in the VirtualBox Manager. You should be able to see your newly created virtual machine listed on the left.
Install Ubuntu Server in the Virtual Machine
Make sure your virtual machine is selected and press Start. VirtualBox Manager will ask you to select a virtual optical disk file or a physical optical drive to start the virtual machine from. Select the iso file you downloaded previously and press Start.
The Ubuntu installation process will now begin. It consists of thirteen steps and is quite painless.
The Welcome Screen
Here you should select your preferred language. I’m using English.
The Keyboard Configuration Screen
Here you should select a keyboard layout. As I’m using a German keyboard, I asked Ubuntu to detect my layout, which it did with a couple of simple questions.
The Network Connections Screen
Here Ubuntu will attempt to configure the standard network interface. Normally you can just accept the default and select Done.
The Configure Proxy Screen
If your system requires a proxy to connect to the internet (mine doesn’t), enter its details in the next dialogue. Then select Done.
The Ubuntu Archive Mirror Screen
If you wish to use an alternative mirror for Ubuntu, you can enter the details here. Otherwise accept the default mirror by selecting Done.
The Filesystem Setup Screen
The installer can guide you through partitioning an entire disk or, if you prefer, you can do it manually. If you choose to partition an entire disk you will still have a chance to review and modify the results before Ubuntu is install. I selected Use An Entire Disk.
I was then prompt to select my virtual machine’s hard disk as the disk to install to, before being shown a summary of what the installer would do. As this is a “destructive action”. I asked to confirm my choice with Continue.
The Profile Setup Screen
Here you are require to enter:
- (real) name
- server’s name
Fill these details out as you see fit.
The SSH Setup Screen
Here we have a chance to install the OpenSSH server package. We’ll need this to connect to the virtual machine via SSH later on, so ensure that you select it.
You also have the opportunity to import your SSH keys from GitHub or Launchpad. I selected No for this option.
The Featured Server Snaps screen
Here you can select from a list of popular snaps to install on your system. Snaps are self-contain software packages that work across a range of Linux distributions. I didn’t select any.
And that’s it, the installation is complete. Ubuntu will ask you to remove the installation medium (which you can do via Devices > Optical Drives > Remove disk from virtual drive > Force unmount) and then reboot.
If this option is gray out, you’re good to go. Just reboot. This is the way to Install Ubuntu Server 18.04 LTS in VirtualBox