LoginSignup
10
11

More than 5 years have passed since last update.

今入ってる VirtualBox Guest Additions のバージョンを確認する

Last updated at Posted at 2016-04-25

VirtualBox がたびたび更新される。

それは良いことなのだけど、本体を更新するたび、追加機能をサポートする Guest Additions を仮想環境ごとにインストールし直さないといけないのが少し面倒くさい。

仮想環境を複数扱っていると、この環境には新しいバージョンを入れたのか曖昧になることがある。まあいいか、と気にせずに使っていると Guest Additions の機能が必要な場面にぶち当たって作業中断。インストール作業自体は数分で終わるものだが、再起動を伴うので不意打ちを食らうと結構面倒くさい。

事前に解決できることは事前に解決しておきたい。

しかし、たまにしか更新しないこともあって、インストールされている Guest Additions のバージョンの確認方法をよく忘れる。

今回はそのメモ。

…。

ちなみに、仮想環境が一般的なデスクトップ環境の場合は、適切なバージョンの Guest Additions が入っていないと通知が来る模様。便利。

環境

  • VirtualBox 5.0.16
  • VirtualBox Guest Additions 5.0.16
  • Ubuntu 15.04

参考

確認 (modinfo)

Guest Additions は Linux のカーネル・モジュールとして登録されている。その詳細情報を modinfo で得る。

$ modinfo vboxguest
filename:       /lib/modules/3.19.0-58-generic/misc/vboxguest.ko
version:        5.0.16
license:        GPL
description:    Oracle VM VirtualBox Guest Additions for Linux Module
author:         Oracle Corporation
srcversion:     6B7D24280DBF204B19C8E80
alias:          pci:v000080EEd0000CAFEsv00000000sd00000000bc*sc*i*
depends:        
vermagic:       3.19.0-58-generic SMP mod_unload modversions 

この version の値が、現在使用している Guest Additions のバージョン。

確認 (ls)

/usr/*/VBoxG*

現在使用中のバージョンに /usr 下からシンボリック・リンクが張られている。

% ls -l /usr/*/VBoxG*
lrwxrwxrwx 1 root root 53 Apr 15 17:22 /usr/lib/VBoxGuestAdditions -> /opt/VBoxGuestAdditions-5.0.16/lib/VBoxGuestAdditions/
lrwxrwxrwx 1 root root 55 Apr 15 17:22 /usr/share/VBoxGuestAdditions -> /opt/VBoxGuestAdditions-5.0.16/share/VBoxGuestAdditions/

ディレクトリ名の数字がバージョンの値。

/opt/VBox*

上記のシンボリック・リンクが示す通り、 Guest Additions は /opt 下にインストールされる。

$ ls /opt/VBox*
/opt/VBoxGuestAdditions-4.3.0:

/opt/VBoxGuestAdditions-5.0.10:

/opt/VBoxGuestAdditions-5.0.16:
bin/   installer/  LICENSE       sbin/   src/
init/  lib/        routines.sh*  share/  uninstall.sh*

VBoxGuestAdditions から始まるディレクトリは複数あるが、最後にインストールしたバージョン以外の中身は空っぽ。

少し行儀が悪い感じもするけど、バージョンの履歴としてあえて残しているのかもしれない。

10
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11