Installing VirtualBox on Linux

3 min read

Time for action – downloading and Installing VirtualBox on Linux

Ok, for this exercise you’ll need a copy of Ubuntu Linux already installed on your PC. I chose Ubuntu because it’s one of the friendliest Linux distributi ons available, as you will see in a moment.

  1. Before installing VirtualBox, you’ll need to install two additional packages on your Ubuntu system. Open a terminal window (Applications | Accessories | Terminal), and type sudo apt-get update, followed by Enter. If Ubuntu asks for your administrative password, type it, and hit Enter to continue.
  2. Once the package list is updated, type sudo apt-get install dkms, and hit Enter; then type Y and hit Enter to install the DKMS package.
  3. The other package needed before you can install VirtualBox is build-essential. This package contains all the compiling tools VirtualBox needs to build the kernel module. Type sudo apt-get install build-essential, and hit Enter. Then type Y, and hit Enter again to conti nue. Wait for the $ prompt to show up again, type exit, and hit Enter to close the terminal window. Now you can proceed to install VirtualBox.
  4. Open the Synaptic Package Manager (System | Administration | Synaptic Package Manager), and select the Settings | Repositories option in the menu bar (if Ubuntu asks for your administrative password, type it, and press Enter to continue) :
  5. The Software Sources dialog will appear. Click on the Other (on earlier Ubuntu versions the name of this tab is Third-Party Software)and then on the Add+ button:
  6. Another dialog box will show up. Now type deb http://download.virtualbox.org/virtualbox/debian karmic non-free on the APT line field, and click on the Add Source button:
  7. If you’re not using Ubuntu 9.10 Karmic Koala, then you’ll need to change the APT line in the previous step. For example, if you’re using Ubuntu 9.04 Jaunty Jackalope, replace the karmic part with jaunty. On the http://www.virtualbox.org/wiki/Linux_Downloads webpage, you’ll find more information about installing VirtualBox on several Linux distributions and the APT line required for each Ubuntu distribution available.

  8. The third-party software source for VirtualBox will now show up on the list:
  9. Now open a terminal window (Applications | Accessories | Terminal), and type wget -q http://download.virtualbox.org/virtualbox/debian/sun_vbox.asc to download the Sun public key:
  10. Go back to the Synaptic Manager, select the Authentication tab, and click on the Import Key File button:
  11. The Import Key dialog will appear next. Select the sun_vbox.asc file you just downloaded, and click on the OK button to continue:
  12. The Sun public key for VirtualBox should now appear on the list:
  13. You can now delete the Sun public key file you downloaded earlier. Click on the Close button to return to the Synaptic Package Manager. If the Repositories Changed dialog shows up, select the Never show this message again checkbox, and click on Close to continue.
  14. Now click on the Synaptic Package Manager’s Reload button to update your package sources with the most recent VirtualBox version:
  15. Once the Synaptic Package Manager finishes updating the package sources list, click on the Origin button located at the lower-left part of the window and select the download.virtualbox.org/non-free repository from the window above this button:
  16. Click on the most recent virtualbox-3.X package checkbox in the right window, and select the Mark for Installation option:
  17. When upgrading to a newer VirtualBox version, you must first completely remove the older version. Then you’ll be able to install the newest version without any hassles.

  18. The Mark additional required changes? dialog box will appear next. Click on the Mark button to mark all the additional packages required to install VirtualBox:
  19. Now click on the Apply button in the Synaptic Package Manager:
  20. The Apply the following changes? dialog box will appear next. Make sure the Download package files only option is deselected, and click on the Apply button to start installing the required packages, along with VirtualBox:
  21. The Synaptic Package Manager will start downloading the required packages and, when finished, it will install them along with VirtualBox.
Packt

Share
Published by
Packt

Recent Posts

Harnessing Tech for Good to Drive Environmental Impact

At Packt, we are always on the lookout for innovative startups that are not only…

2 months ago

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago