Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Sometimes Ubuntu behave weird, which might be because because it runs within Virtualbox as a client OS.

I want to detect if Virtualbox guestaddition is installed, from within the VM client, and which version it is.

On the server it can be detected using the Virtualbox API, but I want to be able to detect it on the VM client itself.

Virtualbox guest addition can be installed using statement how-do-i-install-guest-additions-in-a-virtualbox-vm:

sudo apt-get install virtualbox-ose-guest-x11

So apt-get must "know" about the installation. apt-get does not have a search function so I tried :

dpkg --list | grep virtualbox

with result :

bernard@bernard-vbox2:~$ dpkg --list | grep virtualbox
ii  unity-scope-virtualbox                    0.1+13.10.20130723-0ubuntu1                       all          VirtualBox scope for Unity
bernard@bernard-vbox2:~

Someting about Virtualbox, but not about Vbox guest addition

On my system I presume ( info source ) VBox guest addition is installed in

/opt/[VboxAddonsFolder]

The folder does exist on my system but I can not find a (general) method to retrieve the VBox guestaddition version.

On Takkat advise I installed VBox guest addition. My preference to do this in the terminal.

bash
sudo apt-get update
sudo apt-get install build-essential linux-headers-$(uname -r)
sudo apt-get install virtualbox-guest-x11

Installed with succes my guestadditions.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Virtual Box guest additions are installed as kernel modules. To see whether guest additions are installed, and to get information on the version we can issue:

modinfo vboxguest

This will give an output similar to this:

filename:       /lib/modules/3.13.0-24-generic/updates/dkms/vboxguest.ko
version:        4.3.10
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation

Virtual Box guest additions installed on this machine hence is version 4.3.10.

share|improve this answer
    
When I execute I get : ERROR: Module vboxguest not found. –  Bernard Jul 16 at 17:45
    
When I execute your statement I get : ERROR: Module vboxguest not found. So I tried to find the file with : sudo find -name vboxguest with as result : ./var/lib/dkms/vboxguest ./var/lib/dkms/vboxguest/4.2.16/build/vboxguest ./opt/VBoxGuestAdditions-4.2.16/src/vboxguest-4.2.16/vboxguest This returns only directories but no file. My Vbox guest additions will probably be version 4.2.16 But I want to put the retrieved output as check input in my program. Your example output would be perfect for my purpose. What is my mistake? –  Bernard Jul 16 at 18:03
    
please read my previous comment. When editing this was posted by mistake, which I could not undo. So my comments are now a bit messy. Sorry for that. –  Bernard Jul 16 at 18:33
    
The error indicates that the guest additions are not installed. Did you try to load the .iso in the host, then mount it to the guest to start the installer there? –  Takkat Jul 16 at 18:49
    
Greate. I installed my GuestAddition (which I thought I had installed allready) and could execute your statement with succes. Thanks. I will vote your answer as accepted. But one question; How come I have a directory path of guest addition of guest addition, without having guest addition? –  Bernard Jul 16 at 19:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.