How to Install & Run Ubuntu Linux in VirtualBox
If you want to experiment with Linux without dual booting and potentially impacting your main operating system, the best way to do so is with virtualization. Virtualization allows you to run Linux directly atop your primary OS, whether it’s Mac OS X or Windows, in a separate virtual machine, with practically no potential for error. It’s completely free and fairly easy to set up, we’ll walk you through the entire process.
Requirements for Running Ubuntu in VirtualBox
- Download VirtualBox (free) and install it
- Download a 64-bit Ubuntu Linux ISO (free) and save it to the desktop
- Have at least 512MB RAM free and at least 5GB of hard disk space available
Be sure to meet the above requirements before beginning. Once VirtualBox is installed and the Ubuntu ISO is downloaded, you can proceed with set up and installation.
Installing Ubuntu Linux in VirtualBox
- Launch VirtualBox and create a new virtual machine, name it something like “Ubuntu Linux” and set the Operating System to “Linux” and version to “Ubuntu” and set the base memory to at least 512MB or 1GB
- Create a new virtual hard disk and check “Start-up Disk”, click Continue and choose VDI as the disk type
- Optional: Set the storage details to be “Dynamically allocated” to preserve some initial disk space
- Name the virtual disk something obvious like “Linux VM” and make it at least 5GB (8GB recommended) and click “Create” to produce the virtual hard drive
- At the VirtualBox Manager screen, select the newly created “Ubuntu Linux” virtual machine and click on the “Settings” button
- Click on the “Storage” tab and next to “IDE Controller” click the + icon that looks like a CD to add a new IDE Controller
- Click “Choose Disk” and locate the Ubuntu ISO (named something like ” ubuntu-11.10-desktop-amd64.iso”) that you downloaded earlier, then click “OK” and close out of Settings
- Back at the VirtualBox Manager screen, select the Linux virtual machine and click on “Start” to begin booting the VM
- Let the VM boot and choose “Install Ubuntu” at the welcome screen, create a login and user name, set time zones, and click through the simple installation process until it begins
How long it takes to install Ubuntu Linux in the virtual machine varies on the speed of the computer and the speed of the internet connection, but somewhere between 20 and 45 minutes is not unusual. When finished, Ubuntu Linux will boot into the desktop and you can start exploring and having fun.
Because Ubuntu is contained within a virtual machine, it’s practically impossible to screw up your host computer, so feel free to explore, try out new commands, install random software, and learn without fear of breaking anything. The only thing you can potentially mess up is the virtual machine itself, which is unlikely but could be simply deleted and reinstalled again if it happened.
If you enjoyed this post, don’t miss our other VirtualBox how-to guides, including:
- Run free Internet Explorer test VM’s
- Install Windows 8 in VirtualBox
- Run Windows 8 consumer preview
- Install OS X Lion in a VM
- Run Mac OS X Snow Leopard atop OS X Lion
- Run Android 4 ICS in a virtual machine
VirtualBox works with just about any other operating system you can think of. Being a free solution, it’s performance is not as impressive as VMWare or Parallels though, and if you intend on using virtual machines for production it would be worth considering a paid solution for maximum performance.
Thank you for this article.
I am getting this message after I hit “start”
This kernel requires an x86-64 CPU, but only detected an i686 CPU. Unable to boot – please use a kernel appropriate for your CPU.
What do I do? I have never used VirtualBox or Ubuntu before.
Thanks for this! Just got my first taste of Linux (PureOS) on a mid 2013 Retina MacBook Pro. It runs as fast as OS X. Time to switch to Linux!
Worked like a charm on the freshly upgraded Yosemite. Not a single problem getting ubuntu up and running on my mac. Thanks for the great article.
Chris, Were you able to encrypt your Ubuntu installation?
I’d like to create a VM with Ubuntu on my iMac, but want to encrypt the Ubuntu system.
I have read that some folks have had problems doing this.
But I have problem it’s show me that I don’t have available drive space while there is 22.485 GB free ??
Should I connect usb or what ??
Need your help
I click on restart and it freezes. What do I do?
What if it never reboots?
Had Ubuntu on my 2007 iMac since this first posted and it ran fine. Recently I upgraded to a Mac Mini and moved my .vdi file to a second drive along with my home folder. Reason is, I needed space on my newly installed SSD drive. In the process of moving the file, I lost the original settings. Now Ubuntu is painfully slow. So slow, in fact that I have time to go make a pot of coffee and come back to find it still booting. In hopes that someone can check their settings, I’ll post what I have things set for. I look forward to some input.
My Mac is a 2011 Mini-2.5GHz, i5, with 16g of Ram, a 240g SSD and a 500g HDD. The OS (10.8.2) is on the SSD and my documents are on the HDD, along with the Virtual Drive(s).
Here’s what I have for settings…
Name: Ubuntu VM
OS: Ubuntu 64bit
Base Memory: 2048MB
Boot Order: Hard Disk
Acceleration: VT-x/AMD-V, Nested Paging, PAE/NX
Vid Mem: 64MB
Remote Server: Disabled
IDE Primary Master: Ubuntu Linux.vdi (Normal, 8.00 GB)
IDE Secondary Master: [CD/DVD] Empty
Host Driver: CoreAudio
Controller: ICH AC97
Network: Intel PRO/1000 MT Desktop (Bridged Adapter, en0: Ethernet)
Device Filters: 0 (0 active)
Any suggestions would be most appreciated…
Ubuntu 12.4 LTS – installing now. I have been using it for the almost a year on a handful of computers. I could not be more happy! Used OS X for a solid 10 years – and now it just seems Apple has really decided to tick me off – tons of broken machines, phones, ipods, the list is endless. Ubuntu is EASY to use – and difficult to break.
Thanks for the post. I found it very useful.
After I clicked “Install Ubuntu” I was faced with two options – (a) overwrite existing OS or (b) add partitions. Which do I choose?
I believe that the answer to this is that it doesn’t matter, because you are dealing with a virtual OS, which means virtual storage as well.
Although maybe the better answer is to choose (a) overwrite, because it reduces complexity of handling virtual partitions.
after the installation of linux in virtualbox,when i click on “start” again the installation comes,but i am not able to find the installed os.can anyone help me in how to start the os which is installed through virtualbox,as i am new to this software.
Would it be a smart approach to create a guest account on Lion and then install only VirtualBox and then an Ubuntu image? Sort of like a simulated dual-boot without actually partitioning and all that?
You wouldn’t get much benefit from that, you might as well just run VirtualBox from your main account. You can attempt to maximize the performance by just running VirtualBox on it’s own without other apps open and by dedicating it as many resources as you can afford. Parallels runs Ubuntu well too.
I have tried to install Ubuntu Linux LTS 32bit (and after 64bit) with VirtualBox on osx 10.6.8 macbookpro 2008.
I did not succeed to get a working network connection on Ubuntu (I use only wifi network) is it normal? Do you know which is the configuration of the adapter I should have to get the network?
I have OS X Mountain Lion and, just warning you all, VirtualBox does not work on the beta OS.
After installation on my intel iMac on OS 10.6.8 the Linux window just sat there dark without any thing inside it. Nothing happened.
Thanks for the article. It gave me something to do on my lunch break other than work for a change.
thank you very much
Ubuntu – A bad copy of Mac OS X.
The old versions of Ubuntu (like 8.04) couldn’t be considered as a clone of another operating system (unless you want to count Ubuntu as a clone of Debian), but later version started to look more and more like Mac OS X.
First they switched the three buttons to minimize, maximize and close a window from the right side to the left side and changed the order of these butons to the exact same order as the buttons in Mac OS X. They introduced a clone of the Dock of Mac OS X, they removed the menubars from the windows and put a menubar on the top of the screen, just like in Mac OS X. The thing from the last screenshot (the place where you start your apps) is just a bad copy of Lions Launchpad.
Linux has never managed (and will never manage) to get any market share, but they see the succes of Mac OS X, so Ubuntu just copies everything from Mac OS X. They just hope to get any market share by just copying everything from the Mac.
Ubuntu is just a really bad copy of Mac OS X with way too many bugs to be usable for every day usage.
This is the stupidest comment I’ve ever heard. If you don’t like Unity (the thing that borrows a very small amount of OSX’s nice features) then you can just install gnome or some other window manager. It has nothing to do with Linux or Ubuntu.
Also, Linux may not have market share on desktops but do you know the likelihood that this website is hosted on a linux machine?
– Mac is more successful than linux. Really ? Is money-making the only factor of your success. Why dont you sell drugs, rather than wasting time on blogs, reading and learning.
– Well “copying Mac” or I think doing the thing right is more important, no matter who did it first. Go and spend time on ubuntu blogs, read articles when they defend the design paradigm shift towards. It makes so sense in what they are doing.
– For “unity”, no other operating system is even close to the roadmap for unity. Windows 8 did a shitty job, trying to make a ubiquitous interface for all devices. Apple is not in the games by far. UNITY is the only system which is good at it.
“Linux has never managed (and will never manage) to get any market share,”….
Ubuntu runs 70% of the Cloud Market you dumb@ss….
Oh my bad I meant it does not work if you have it dual booted. Its nice to know that VM works though!
Thanks for the write up! Unfortunately Macbook pros new wireless does not have support drivers. Hopefully soon they will be release so wireless will work.
You sure? I’m online with VM’s on my MacBook Pro. Check out Settings and make sure you have it configured properly, though maybe it is different for linux?