Install Ubuntu in a VirtualBox Virtual Machine

Posted by Leave a Comment

1. Download and install the latest version of VirtualBox. (4.2.6 at the time of this article)

2. Download an ISO of the latest version of Ubuntu. (12.10 at the time of this article)
Note: If your current operating system is 32bit you must select the 32bit ISO. If your OS is 64bit, you can choose either the 32bit or 64bit ISO. If you are not sure, choose the 32bit.

Set up the Virtual Machine

3. Start VirtualBox and click New to create a new Virtual Machine.

vbox settings - new vm

4. Name your VM. For Type, select Linux; for Version, select Ubuntu. Be sure to select the same version of Ubuntu that matches the ISO you downloaded (32bit or 64bit)
name vm

5. Select the amount of your RAM to use for the VM. 512MB is the minimum, I recommend at least 1GB, but not more than half of your system RAM. In the below screenshot, I have 12GB available and am dedicating 4GB to the VM.
set vm ram

6. Create a new Virtual Hard Drive (VHD) for the VM.
create vhd

7. You can use the default VDI (VirtualBox Disk Image).
vhd file type

8. Select the type of storage for the VHD. I prefer dynamically allocated storage. This means the VHD will only use up space on your hard drive as it fills up (up to the amount set in the next step).
vhd storage type

9. Select the maximum size of your VHD. You can also choose to store the VHD in a different location on this screen. If your primary hard drive is a smaller SSD, you may want to store the VHD on a larger HD.
set vhd size

10. Now to setup the VM, click settings, go to the System section, and click the Processor tab. If your computer supports it, you can increase the number of CPUs used by the VM. I recommend not more than half of your CPUs.
setup vm processors

11. Now go to the Display section. Here you can increase the amount of Video Memory used by the VM. 2D acceleration is only available to Windows VMs, but you can enable 3D acceleration if you want. You may want to start without this enabled to make sure everything works correctly. You can always enable it later.
add ram to vm

12. Move to the Storage section. Here you want to add the Ubuntu ISO you downloaded. Click the Add CD/DVD Device button in the Controller: IDE tree and browse to the ISO.
add iso to vm

13. Click OK to save the settings then click Start to run the VM. From here it is a normal Ubuntu install.

Install Ubuntu

14. Begin by selecting your language and click Install Ubuntu.
install ubuntu

15. Here you can choose to download updates while installing. Click Continue.
download updates while

16. Choose Erase disk and install Ubuntu then click Continue (don’t worry, this only erases the VHD, it will not affect your primary OS installation).
format disk

17, 18. Setup your timezone and keyboard on the next two screens.

19. Finally Set up your user account and click continue.
setup ubuntu account

20. Once finished installing you will be required to restart.

21. When you get to the screen that says “Please remove installation media and close the tray (if any) then press ENTER:”, close the VM window.
Shutdown message

22. You will now see the Close Virtual Machine dialog window, choose Power off the machine and click OK.
Power off VM

23. Now we want to remove the ISO so the VM does not boot into installation mode again. Return to the settings -> storage menu. Select the Ubuntu ISO disk and click the Remove Attachment button.
Remove Ubuntu ISO from VM

24. Now just start the VM again and you have a working Ubuntu installation.

Category: Operating Systems, Ubuntu, VirtualBox, Virtualization

Leave a Reply