Install Ubuntu 16.04 on Oracle VirtualBox that runs on Windows or Mac

This post provides some notes and useful resources about installing Ubuntu 16.04 on Oracle VirtualBox that runs on your Mac or Windows.

Note: check the RAM and hard disk size of your machine before creating a virtual machine on it.

Notes about which version of Ubuntu to download and install:

For Ubuntu, it is not always a wise choice to pick the newest version. My suggestion is that (unless you are aware that you need to install a particular version), download and install the latest LTS (Long Term Support) version (see the picture below from Ubuntu wiki page). Every two years, a Ubuntu LTS version is released, which will be supported for updates for five years. For example, as of now, Ubuntu 16.04 LTS is the latest LTS version.

The two main things you need to pay attention to when you create a virtual machine:

  • Memory allocation for your virtual machine.

You can set it as half of your RAM (e.g., if your RAM is 8 G, set it as 4 G or 5G for your virtual machine should be fine.)

  • Storage type:  Select “Dynamically allocated” if you are not sure how large storage you actually will need.

There are already several very good tutorials about this along with snapshots, so I won’t create a tutorial for this. See below for some useful resources I collected. (See some notes I wrote below for some posts.)

My notes: This one is very good (with snapshots), including  Guest additions and Shared folders settings. (Note that Guest additions are required if you want to set Shared folder, so be sure to install Guest additions first).

You can use the following command to check whether Guest additions were installed on your Ubuntu virtual machine if you are not sure because you installed your Ubuntu VM a while ago.

Use lsmod from the command line, as it will tell you not only if it’s installed, but properly loaded:

$ lsmod | grep vboxguest
vboxguest             282624  6 vboxsf

I have tested Shared folders instructions (with pictures) in this tutorial on my Ubuntu 16.04 VM, and it works. The only difference is that on Ubuntu 16.04 VM, after you issued the following command on your terminal and  restart the Ubuntu guest machine, you do not need to do anything as the tutorial said, the shared folder is automatically mounted each time you start you Ubuntu VM. (After you restart, click the Files icon on the task bar, and you will see the shared folder you just set just now is automatically mounted there:))

  • sudo adduser brb vboxsf   # Replace 'brb' with your account name on Ubuntu. 

One more note: Although Shared Folder setting in VM is very convenient, using VirtualBox shared folder directly for fastq data, annotation or output directory can significantly reduce the performance compared to a native (Ubuntu) system or VirtualBox native system, so my recommendation is only use the folder to transfer files between windows/mac and your Ubuntu VM.

P.S. If you see some tutorials tell you that you need to enter some command like “sudo mount -t vboxsf sharing /mnt/share” to automatically mount the shared folder each time you start your Ubuntu VM, that is outdated instructions.

Fortunately, new VirtualBox version (4.x +) has a (GUI) Auto-mount option (see pics below) when you set your shared folder. (Note that you can choose your customized folder to share, instead of using a system predefined folder such as Documents or Downloads.)

If you want to share the clipboard between your host and your virtual machine, check out the picture below.

 

Answers to some frequently asked questions:

Q: Do I need to backup my files when I upgrade my VirtualBox to newer version.

A: just install the latest version and you will have all your files in the new one. You need not have to uninstall the old virtual machine.

Q: After I install the updates of Windows 10, my VirtualBox won’t start…

A: just install the latest version and you will have all your files in the new one. You need not have to uninstall the old virtual machine.

 

My notes:  this one is very good (with snapshots) on Mac. My notes above about VM settings running on Windows work the same for VM settings running on Mac.

 

1 thought on “Install Ubuntu 16.04 on Oracle VirtualBox that runs on Windows or Mac”

Leave a Reply

Your email address will not be published. Required fields are marked *