memo.xight.org

日々のメモ

VBoxGuestAdditions の update

Summary

VirtualBox と Guest Additions のバージョンに差異がある場合、
vagrant up 時に、以下の様なメッセージが表示される。

[default] The guest additions on this VM do not match the installed version of
VirtualBox! In most cases this is fine, but in rare cases it can
cause things such as shared folders to not work properly. If you see
shared folder errors, please update the guest additions within the
virtual machine and reload your VM.

Guest Additions Version: 4.1.8
VirtualBox Version: 4.2

/opt/VBoxGuestAdditions-4.1.8 と Guest Addtions のバージョンが古いようだ。
これを新しいバージョンに更新する。

ホスト側で VirtualBox.app 内の isoをマウント

/Applications/VirtualBox.app/Contents/MacOS/VBoxGuestAdditions.iso をコピー

ゲスト側で VBoxGuestAdditions.iso をマウント

$ sudo mount /dev/cdrom /media/cdrom
[sudo] password for vagrant:
mount: block device /dev/sr0 is write-protected, mounting read-only

これで ゲスト側の /media/cdrom 内から VBoxGuestAdditions.iso が参照できる。

VBoxGuestAdditions の更新

$ cd /media/cdrom0
$ ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.18 Guest Additions for Linux............
This program must be run with administrator privileges.  Aborting
vagrant@debian:/media/cdrom0$ sudo ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.18 Guest Additions for Linux............
VirtualBox Guest Additions installer
Removing installed version 4.1.8 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.

Building the main Guest Additions module ...done.
Building the shared folder support module ...done.
Building the OpenGL support module ...done.
Doing non-kernel setup of the Guest Additions ...done.
You should restart your guest to make sure the new modules are actually used

Installing the Window System drivers ...fail!
(Could not find the X.Org or XFree86 Window System.)

VBoxGuestAdditions の更新確認

$ ls /opt
VBoxGuestAdditions-4.2.18
$ /opt/VBoxGuestAdditions-4.2.18/bin/VBoxControl --version
4.2.18r88780

VirtualBoxの再起動

ホスト側で vagrant halt または ゲスト側で sudo shutdown -h now
ホスト側で vagrant up

これで、 VBoxGuestAdditions が更新できた。