This is a very basic walkthrough tutorial on how to install Ubuntu 18.04, or different Linux Distributions, on your Mac OS using Virtual Box.
It’s very important to note that at the time of writing this, it is July 2019 and these steps might differ as different versions of VirtualBox and Ubuntu are released.
Why Do This
There are few reasons why you’ll want to do this, but my main reason is to able to install and use Ubuntu without having to partition my hard drive and install Ubuntu locally on my computer.
There are ways to install Ubuntu natively on your computer, but this method allows you to use both at the same time.
This is also so that I can complete the Linux Foundation Certified SysAdmin (LFCS).
Requirements
To make sure you have the requirements for this, you just need:
- Mac OS Mojave
- 2 GB RAM that can be dedicated
- 10 GB of storage (although that can be tweaked)
Tools We’ll Need
- VirtualBox — A virtualizer that runs virtual machines
- Ubuntu OS — The Linux OS we’ll be running in VirtualBox
What Is VirtualBox?
Basically open-source software that allows us to run multiple different Operating Systems on top of our Mac OS, including Windows, Linux and even Mac OS with Virtual Machines, which are just emulations (which are close to native running) of operating systems.
VirtualBox is also a Hypervisor.
What Is A Hypervisor?
Also known as a Virtual Machine Monitor, which can either be software, firmware, or hardware that allows Operating Systems to run on top of it. In this case VirtualBox is a Type 2 Hypervisor, which sits on top of an OS and allows you to run other Operating Systems.
Install Virtual Box
Our first step to installing Ubuntu on our Mac OS is to install VirtualBox.
Download VirtualBox for OS X Hosts.
Make sure to Double click the VirtualBox.pkg file.
If you run VirtualBox now, you should see the following:
Download Ubuntu
The next step is to download Ubuntu locally to our computer to use with VirtualBox. Your first step is to go to https://ubuntu.com/download.
You’ll want to click on Ubuntu Desktop.
What Is LTS?
Here you’ll be presented with a couple of options, but you’ll want to download Ubuntu 18.04.2 LTS. LTS stands for Long-Term Support, which means this release will be supported by the developers of Ubuntu for a while.
Once downloaded, the file will probably sit in your downloads as ubuntu-18.04.2-desktop-amd64.iso
. This is our image archive file of the operating system, which we’ll need later.
New Machine
Next, we’ll want to create a new machine in Virtual Box by clicking on New, or going to Machine > New, or doing ⌘ + N.
Once the prompt opens, give it a Name (if you start typing ubuntu, it will automatically convert the version to Ubuntu 64-bit), and set the Memory to 2048 MB (2GB). Make sure you set the Hard Disk option to Create a virtual hard disk now. Leave the rest of the options as is and click Create button.
This will then prompt us to define the settings for our new virtual hard disk.
Set the File size will be set to 10.00GB to give the Ubuntu file enough space to work with, the Hard disk file type to VDI to make an image formatted for VirtualBox, and allow the Storage on physical hard disk to be Dynamically allocated. Once done, click the Create button.
Once your new machine settings are setup, you should see the following:
Install Ubuntu Image
Notice we haven’t touched our ubuntu-18.04.2-desktop-amd64.iso
file yet. This is the next step. Right click on our new machine and go to Start > Normal Start or select the machine and just click the Green Start Arrow Icon. We’ll soon be prompted with the following, where we’ll now select our file, and click Start.
Ubuntu will start but we might get this tiny screen at start.
To temporary fix this before we configure our display setting in Ubuntu directly, click the fifth icon from bottom right and go to Virtual Screen 1 > Scale to 200% (autoscaled output).
We should see something slightly bigger, where you can now click Install Ubuntu.
NOTE: If at any time you need to get out of the Virtual Machine / Ubuntu, just press the left ⌘ twice.
The next prompt will ask you what your keyboard setting might be. I’ve set them to English (US). Once you’ve selected your option, click the Continue button.
Just to get those alert prompts at the top out of the way, click the x
button.
For the sake of this walkthrough, we’ll go with the Normal Installation and Download updates while installing Ubuntu. Click the Continue button.
This next step might look scary but there is nothing for Ubuntu to delete except for what the size and storage we allocated it. Select Erase disk and install Ubuntu, and click the Install now button.
You’ll also be prompted to confirm your selection with the following prompt, just click the Continue button.
Next we’ll select our location for the timezone, type and set your location, click the Continue button.
Lastly, we’ll give our name, our computer name, username, and give it a password.
The installation will wrap up and you’ll just need to restart.
Small note when you get to this screen, you’ll need to press Enter for things to restart.
It’ll finish loading and then the login will present itself. Enter your credentials and let Ubuntu load up.
When you get to the Desktop, you’ll be presented with What’s new in Ubuntu, and the screen resolution is still very small.
The last thing we’re going to do is fix the screen resolution in the settings by going to the 9 dots in the bottom left and searching for Settings.
Once settings shows up, scroll to the bottom with the left sidebar until you see Devices and click on it.
It will be hard to see but select the new resolution from the dropdown.
It will prompt you the top right to apply these changes, but unfortunately you can’t click Apply because it’s not within the view of the resolution of the window. To get access it to, double-click the top navigation bar where it says Displays, and then drag the window from right to left until you see the Apply button.
The resolution will change, and you’ll be prompted to confirm if you want to keep these changes. If it doesn’t fit your screen, leave it for a few seconds and it will reset back, otherwise click Keep Changes.
There we go, we’ve fully set up Ubuntu 18.04 with VirtualBox on Mac OS.
From Here
Now you can use Ubuntu on Mac OS, install whatever apps you want, and still have access to you native OS controls and more.
If you got value from this, and/or if you think this can be improved, please let me know in the comments.
Please share it on twitter 🐦 or other social media platforms. Thanks again for reading. 🙏
Please also follow me on twitter: @codingwithmanny and instagram at @codingwithmanny.
Consider Contributing
One last thing I will say, is you feel like contributing to other Open-Source projects, consider contributing the Ubuntu to keep it free and allow other developers to work on it to make it better.