How to install VBox Guest Additions to a Debian Vm

Screenshot-VirtualBox - AboutHere is how i installed Virtual Box guest additions to my Debian Virtual Machine. This is in a bigger project so i can produce my own Vagrant boxes with any operating system i want. Also this is a good practice when a new Virtual Machine is installed.

First of all start you Vm from the Virtualbox GUI.

Once the Vm has sarted, click on the menu “devices” present on the running Vm window, and select “Install Guest Additions…”.

how_to_install_virtualbox_guest_additionWhen you select this option, a new media is available to be mounted in /media/cdrom

You have to be root in order to mount a device. To mount the new cdrom image type:

# mount /media/cdrom

And if you navigate to the directory :

vbox_guest_addition_cd_contents

As you can see, several files are present, but one is the right one to be installed. In my case the file is VBoxLinuxAdditions.run.

But if you try to run it using its filename, it will fail because of the permission (root cannot execute). So to workaround this, you just lauch the shell first and then feed it with this file, like the following example:

sh /media/cdrom/VBoxLinuxAdditions.run

This commad should work.

Wait!

During the install process, some modules must be built and for this reason there are some prerequisites you should satisfy before proceed.
For this reason we need to install the packages present in the following command:

sudo apt-get install linux-headers-$(uname -r) build-essential

And after installing these packages, is possible to run the VBoxLinuxAddition installer with the following commands:

# mount /dev/cdrom /media/cdrom
# sh /media/cdrom/VBoxLinuxAdditions.run

One of the errors you can face with is the complains about missing Xorg. If you are running a headless server, of course there is no xorg.

That’s all.

Giuseppe

(Visited 6,412 times, 1 visits today)

Author: Giuseppe Urso

Giuseppe lives in Haarlem now with his shiny dog, Filippa In 1982 received his first home computer, a Commodore 64, followed by Datasette and a 1541 Floppy Disk Drive. In 1999 he installed his first Linux distro (LRH6). In 2006 he switched to Debian as favourite OS. Giuseppe Urso actively sustains the Free Software Fundation and his founder Richard Mattew Stallman, he speaks to people trying to convince them to join the fight now, and about how important is to use Free Software only. He has a job as Infra Specialist at Hippo Enterprise Java Cms an Open Source Enterprise class Content Management System, one of the coolest company ever, in Amsterdam. He's always ready to install Debian on other people computers for free.

Leave a Reply

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

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.