90

How can I tell if the guest additions are installed on a VirtualBox VM with no X Windows installed?
I'm having a problem mounting a shared directory and I'd like to rule out the possibility that the guest additions weren't installed.

Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83
Nathan Feger
  • 1,011

4 Answers4

92

Use lsmod from the command line, as it will tell you not only if it's installed, but properly loaded:

$ lsmod | grep vboxguest
vboxguest             219348  6 vboxsf
David Foerster
  • 36,264
  • 56
  • 94
  • 147
Bryce
  • 1,937
  • 13
    @hedgehog answer has been edited to specify that vboxguest is the required module. You can get the version from /usr/sbin/VBoxService --version (as per @Mike_D; requires elevated privileges) or dpkg -l | grep virtualbox-guest (as per @voretaq7) – woodvi Feb 02 '17 at 23:18
  • 10
    What does it mean if the command just shows ```vboxguest 349038 5" ? – user3731622 Jun 02 '20 at 16:38
  • 5
    @user3731622: Any result line which starts with the word vboxguest means that the guest additions are installed and properly loaded. So you're fine. – unforgettableidSupportsMonica Feb 02 '22 at 22:13
36
  1. Open the Session Information window. There are two ways to do it:
    • Select the Machine menu at the top of the VirtualBox window and then Session Information, or
    • Use the key combination Host-N which works for any guest OS i.e. type Right CTRL-N (if you use the default Host key configured by VirtualBox).
  2. Select the Runtime Information tab.
  3. Look at the Guest Additions version number.
  4. (Optional) Compare the the version number with the main VirtualBox version number shown in Help | About VirtualBox... from VirtualBox Manager).

If the guest additions are not installed and working, then it will report: Guest Additons: Not Detected.

robocat
  • 499
  • 4
  • 6
  • Quick and direct, likely the intended way. Just what I needed. – Mr Redstoner Feb 05 '20 at 10:50
  • 1
    it turned out, that this answer is the only really correct resp. useful one! - even VBoxService --version showed me once the latest installed version, although the loaded/used version was a different one... :-/ || not to mention the other answers which only check if any resp. what version is installed, which need not be an indicator what or if any version at all is actually used/loaded. – DJCrashdummy Aug 04 '20 at 09:04
  • If the Session Information window appears and instantly disappears, look on the host screen. – Devon Dec 30 '22 at 02:43
  • hmm this didn't work for me - it reports 6.1.40 even though my installed version is 7.0.6! – Andy Feb 01 '23 at 14:51
15

You can check if the modules are present.

Try:

sudo modprobe vboxadd

or

sudo modprobe vboxvfs

This will load the guest additions if they're installed (but usually they would be loaded automatically at boot time anyway).

You'll get an error if the module isn't present. That indicates that the VirtualBox guest additions are not installed properly.

Or you can search for the script that loads the modules:

grep vboxadd /etc/init*/*

and see if you get any output.

9

If the extensions were installed using the Ubuntu package repositories (via apt or Synaptic) you can check to see if the packages are currently installed:

dpkg -l | grep virtualbox-guest will list the guest packages that are currently installed.
virtualbox-guest-dkms is the kernel module, and virualbox-guest-utils are the command-line utilities. There may be other packages available (apt-cache search virtualbox-guest will list them).

Feiticeir0's answer will also detect the kernel module (if it was installed manually).
If the guest extensions are not installed you can install them the same way you would any other Ubuntu package.

voretaq7
  • 488
  • 3
    Be careful installing with virtualbox-guest-dkms - that version may not be compatible with your Virtualbox version. You can find the proper VBoxGuestAdditions.iso file at download.virtualbox.org/virtualbox – Ben Creasy Feb 11 '18 at 00:45