For Mac OS X hosts, Oracle VirtualBox ships in a disk image ( dmg ) file. Perform the following steps: Double-click on that file to have its contents mounted. This guide shows you how to install and use VirtualBox in Ubuntu 20.04. VirtualBox in Ubuntu. There are a few ways to install VirtualBox in Ubuntu 20.04. The simplest way to install VirtualBox is to get it directly from the Ubuntu software repos. The only problem with this method is that you may not get the latest version of VirtualBox.
This in depth guide will take you every step of the way through installing Ubuntu Linux on your Mac, by way of VirtualBox – a free and outstanding program. Using this method you’ll be able to run Ubuntu and macOS at the same time!
Please note: although this guide was initially authored in 2015, it has been updated (2020) to be current. The following guide uses Ubuntu 18.04.3 LTS “Bionic Beaver”, but the steps and screenshots are nearly identical for most versions of Ubuntu, up to including 20.04.1 LTS.
Using this method to install Ubuntu not only allows you to run it and macOS at the same time, you can really try out Ubuntu – and if you don’t like it – very easily get rid of it. Plus, it will not affect the files in macOS itself at all. None of the data on your Mac is at risk of being deleted or altered. The entire process is actually quite straightforward – and all of the software involved is free – so why not give it a shot :)
- Before you get started, there are a few things that should be noted up front.
- Depending on the speed of your Internet connection, it might take a while to download Ubuntu. During the actual installation process, based on the version of Ubuntu you opt to install – you may have to spend some time downloading updates as well.
- The installation time is about 20 minutes, depending on the speed of your Mac, amount of memory etc. You may want to make yourself a cup of coffee or tea before you start.
- Running both Ubuntu and macOS at the same time will “slow down” your Mac. The more memory you have and the faster your CPU and/or hard drive is, the less you’ll notice it.
Let’s get started!
- First up, head over to the Ubuntu download page and download Ubuntu.
- Now you’ll need to download and install VirtualBox. Visit their download page and click the link OS X hosts (which is the current stable version). Once the download has completed, open the .dmg file and run the installer – the installation is as easy as clicking ‘next’ a bunch of times. When installation is done, launch VirtualBox from your Applications folder.
- When VirtualBox opens, click the New button.
- Give your “virtual machine” a name (something descriptive is good, but it doesn’t matter). Make sure the Type: is set to Linux and the Version: is Ubuntu (64 bit). Then click the Continue button.
- Now you’re going to decide how much memory (RAM) you’re going to allocate to Ubuntu when it’s running, and how much to leave for macOS. As illustrated in the screenshot below, my total RAM is 4GB, so I allocated half of it to Ubuntu, and the other half to macOS. The more memory you give to Ubuntu, the faster it will run. The drawback is that macOS will have less to use while Ubuntu is running. At a minimum, give Ubuntu at 1GB (1024MB) of RAM. When you’ve decided how much memory (RAM) to give Ubuntu, click the Continue button.
- On the Hard drive screen, select Create a virtual hard drive now and then click Create.
- Now select VDI (VirtualBox Disk Image) and click Continue
- Select Dynamically allocated and yep – you guessed it – click Continue
- Use the “slider” to determine the size you want to make the “hard drive” for Ubuntu. At a minimum, you’ll want to select 6GB – and that will not allow for you to install many programs, let alone store files etc. Keep in mind that because you selected “Dynamically allocated” in the previous step, that does not mean that VirtualBox is going to take up that space right away. It means that as Ubuntu needs more space, it will allow the “hard drive” to increase up to whatever size you set at this step.
As illustrated in the screenshot below, I opted to give Ubuntu 10GB. That’s enough for the installation and to install quite a few programs. Since I won’t be “storing” many files in Ubuntu (movies, pictures, music etc) – 10GB will suit my needs. Plus, I have a small hard drive on my MacBook Air. If you have a big hard drive, you might as well allocate more rather than less, again – the space won’t be used until it’s needed. After you’ve made your selection, click Create.
- Almost time to install Ubuntu! Click the Start button.
- If you’re using macOS 10.15 (Catalina) or later, you’re going to need to ‘allow’ Virtualbox to receive keystrokes from any application (which is completely safe). Click the Open System Preferences button.
- Click the ‘lock’ icon in the bottom left corner of the screen. After entering your password, place a check in the box next to the Virtualbox item in the list.
- Click Later when prompted.
- Back in Virtualbox you’ll be prompted to locate a file. Click the “folder” icon next to menu that says Empty (see screenshot below).
- Again, if you’re using macOS 10.15 or later, you’ll be prompted to grant permission for Virtualbox to access a folder. Click OK. You may be prompted to do this several more times – just click OK each time.
- Navigate to the Ubuntu .iso file that you downloaded all the way back in step #1. Select it, and click Open
- Now click Start
- Finally! Click Install Ubuntu
- Select your keyboard layout and preferred language then click Continue
- Make sure to place a check in both of the boxes – Download updates while installing Ubuntu and Install third-party software for graphics and Wi-Fi hardware and additional media formats – then click the Continue button.
- Select Erase disk and install Ubuntu. NOTE: this is not going to ‘wipe out’ or erase any data in macOS. None. It is safe to click Install Now, so do just that.
- Click Continue
- When prompted, select your Time Zone and then click Continue
- Fill in each field with the required information. When you’re done, Continue
- Now it’s time to sit back and relax with that cup of coffee or tea. This may take a bit.
- Yay! It’s done! Click Restart Now
- Hit Enter (the ‘return’ key on your keyboard) when prompted.
- And you’ll boot into Ubuntu! Enter your password when prompted.
- Welcome to the Ubuntu Desktop! At this point you should be connected to the Internet and completely ready to go – have fun!
What is VirtualBox?
Oracle VM VirtualBox is a cross-platform virtualization application developed by the Oracle Corporation. It allows users to install operating systems on virtual hard disks such as Windows, macOS, Solaris and Linux.
As an example, you can run Windows and Linux on your Mac, run Windows server on your Linux server, or run Linux on your Windows PC while running your other existing applications.
Disk space and memory are the only problems that you'll face when installing multiple virtual machines.
Why You’ll Need It
- Oracle’s VirtualBox is easy to install and use
- It's free
- You can run and experience any operating system safely
- If you’re a developer, VirtualBox can be used as a tool for safely testing your own development projects in multiple OS environments
- It can run everywhere from small embedded systems to laptops
- It's good for testing and disaster recovery as it can be easily copied, backed-up, and transported between hosts
VirtualBox Installation
VirtualBox can be downloaded here: VirtualBox Downloads
Why Ubuntu?
- It's free
- Easy customization: The GNOME desktop environment helps you customize easily
- It's secure
- Ubuntu is open-source
- Friendly and supportive community
- Low system requirements
- According to FOSSBYTES, Ubuntu is the second best Linux distro for programming and developers [2019 Edition]
- It's beginner friendly
Setup for Ubuntu
First, open VirtualBox, then click 'New' to create a virtual machine.
Enter 'Ubuntu' as the name, select 'Linux' as the type, and select Ubuntu (64-bit) as the version.
NOTE: Select any amount of memory you wish, but don't add more than 50 percent of your total RAM.
Check the 'Create a virtual hard disk now' option so we can later define our Ubuntu OS virtual hard disk size.
Now, we want to select 'VHD (Virtual Hard Disk)'.
Next, we'll dynamically allocate storage on our physical hard disk.
We want to specify our Ubuntu OS's size. The recommended size is 10 GB, but you can increase the size if you wish.
After creating a virtual hard disk, you'll see Ubuntu in your dashboard.
Now, we have to set up the Ubuntu disk image file (.iso).
The Ubuntu disk image file can be downloaded here: Ubuntu OS download
Download Ubuntu Virtualbox Image
To set up the Ubuntu disk image file, go to settings and follow these steps:
- Click 'Storage'
- In storage devices, click 'Empty'
- In attributes, click the disk image and 'Choose Virtual Optical Disk File'
- Select the Ubuntu disk image file and open it
Click OK.
Your Ubuntu OS is ready to install in VirtualBox. Let's start!
NOTE: Ubuntu VirtualBox installation and actual OS installation steps may vary. This guide helps you to install Ubuntu in VirtualBox only.
Let's install Ubuntu!
Click Install Ubuntu.
Select your keyboard layout.
In the 'Updates and other software' section, check 'Normal installation' and continue.
In 'Installation type', check 'Erase disk and install Ubuntu'.
Click 'Continue'.
Choose your current location.
Now, set up your profile.
You'll see Ubuntu installing.
After the installation, restart it.
After logging in, you'll see the Ubuntu desktop.
We have successfully installed Ubuntu in VirtualBox. It's ready to use for your future development projects.
Let's verify the installation.
Open your terminal (Press Ctrl+Alt+T) and type in the commands below and check if they work.
- pwd: This will print the current working directory
- ls: This will list all items in your current directory
After checking those, power off your machine by using the following command.
Conclusion
VirtualBox is free and is a great tool for running multiple operating systems on a single OS. Ubuntu has many benefits. If you're a beginner to Linux, I would recommend you use Ubuntu as it's beginner friendly.
Please feel free to let me know if you have any questions.
You can contact and connect with me on Twitter and Medium.
Thank you for reading.
Install Ubuntu On Mac
Happy Coding!