RTT #01 — A Default Ubuntu 18.04LTS Server Virtual Machine Setup on VirtualBox

Hajar Razip
7 min readApr 25, 2021

Hi! Welcome to my very first RTT (“Random Tech Tips”) — a series (updated sporadically, when some things come up and I feel like I would totally need that stuff for future reference) for various mini-guides in IT (and other computer things like coding, data science, etc.) that teaches you how to achieve certain things in a day-to-day of a constantly learning IT person. More than anyone the content of this series will be useful to me, who, given the nature of my day-job, will inevitably go through these sort of things repeatedly in the course of my career. But I hope it will help you achieve that certain thing too if that’s what you’re here for.

Without further ado, let’s do this thing.

Step 1: Install VirtualBox

Go to https://www.virtualbox.org/, click on the giant blue button in the middle of the page.

This will bring you to the list of operating systems. Choose the one you will use as host. In my case, it’s Windows 10, so I pick “Windows hosts”.

Run the installer and just stick with the defaults.

A successful installation will have you running VirtualBox in no time:

As you can see, I already have a couple of VMs. But please ignore that for now. As I’m writing this post, I needed to spin up a couple more VMs so that I can emulate a small network in order to learn networking concepts for my next huge mission at work. But I digress a little bit — let’s get on the next step.

STEP 2: Get the ISO

Go to https://ubuntu.com/ and get the server install image.

What I like to do is save all ISOs I’ve downloaded in a single folder dedicated to ISOs. When you create a VM in VirtualBox, it creates a folder for that VM by default under “C:\Users\<user>\VirtualBox VMs” (in case of Windows). So I created a folder called “ISO” and store all my ISOs there.

STEP 3: Set Up the VM

Back in VirtualBox, click on “New”.

Name your VM and set OS type to “Linux” and version to “Ubuntu (64-bit)”.

Set your memory size. I have 8GB of RAM. Since I’m not really doing anything heavy on this particular VM I’m reserving 1GB to it. Note that when you have your VM running, this much of your RAM will be locked to that VM. Make sure to set the size to something that won’t slow down your host — I assume this would be the preference.

Next, create a virtual hard disk drive, set the type to VDI (VirtualBox Disk Image) and dynamically allocated. Set the size next. I only set it to 10gb. This will create a VDI (.vdi) file in your VM folder of that size. Think of it like any ol’ physical hard drive accept it’s not really and it simply fills up space from your actual hard drive pretending to be an actual hard drive.

You will see your VM listed once you clicked “Create” in the last step.

STEP 3: Install Ubuntu

It’s time to install Ubuntu. Double click on your VM to launch it. You will be asked to choose a start-up disk. Follow the steps indicated in the following screenshots.

Click on the file icon with the green arrow.
Click “Add”.

Then, navigate to where you saved your ISO.

Then it will appear in the “Not Attached” list. Select that and click “Choose”.

Then, click “Start”.

The steps from here on should be straightforward. You will go through configuring some settings for your server but just stick with all the defaults (use the arrow keys and the ENTER key to navigate). Towards the end you will be asked whether you’d like an SSH server installed, and I’m like, heck yeah, that’s what I’m here for, and then some other common packages too but you can always do this later so it’s up to you to check some boxes or not.

Then, we wait for the installation process to complete. This will take a while. Feel free to do other things and then come back later. While I was installing this I completed an hour-long meeting with a bunch of interns, but again, i.d.a.l.b. Once it’s done, select “Reboot”.

If you see the next screen, just press ENTER.

If installation is successful, you will be prompted for login. Enter your credentials as set up during installation and voila! You’re in the server.

STEP 4: Install Guest Additions

The Guest Additions will optimize the guest operating system for better performance and enhance usability. It enables some extra functionalities on VirtualBox that I’m sure you’d want for your convenience:

  1. You can resize your window (while altering the aspect ratio) and your guest OS screen will adapt to it. If you try this now, you’ll notice that this is not a default behavior.
  2. You can copy something from the host OS and paste it in the guest OS and vice versa. Try it, and you’ll notice that it’s not the default behavior either.

Annoying, right? But that’s why you will need to install the guest additions.

This is a perfect tutorial that teaches you how to do that.

One you’ve done that, shut down the machine, and go to Settings.

Go to General > Advanced and set “Shared Clipboard” and “Drag’n’Drop” to “Bidirectional”.

Then in Display > Screen, max out “Video Memory” and check for “Enable 3D Acceleration” next to “Acceleration”.

Turn on the machine again and you should be able to do the things mentioned earlier.

Step 5: Installing a minimal GUI

At some point, you might feel like having a GUI environment for your server because it can get a little bit inconvenient without a mouse pointer around especially when you need to copy things. There are many ways you can achieve this and this tutorial got everything you need covered. My go-to would be Lubuntu Core Server Desktop using lightdm as my display manager and you can learn all about how to set this up from the linked tutorial.

But I’ll give you a summary here:

  1. Update your package list, then upgrade (the usual stuff)
    sudo apt update; sudo apt upgrade
  2. Install the lightweight display manager
    sudo apt install lightdm
  3. Install tasksel
    sudo apt install tasksel
  4. Install

Conclusion

In this post, I have shown how you can go about setting up a VM for a Ubuntu 18.04LTS Server on VirtualBox with a couple of recommendations on basic configurations, including a minimal GUI environment. Of course, you can freely adapt to your needs but these are my current go-to for my current purposes. I hope it helped!

What’s Next?

If you’re interested in learning about system administration for Ubuntu servers then I would recommend the book Mastering Ubuntu Server by Jay Lacroix. If books are not your thing, then tutoriaLinux’s Sysadmin series on Youtube is a pretty good alternative.

That is all for today. :) Until next time!

--

--

Hajar Razip

Lady in tech. Hobbyist. I post about the randomest things.