LoginSignup
0
1

More than 1 year has passed since last update.

VirtualBox Guest Addition がまた壊れたよ。

Posted at

TL;DR

  • VirtualBox もしくはホストのOSアップデートを行った
  • 起動時にエラーが出た
  • ホストのツールとゲストのツールでバージョンが合わなくなった
  • ゲストにログインして kernel 系をアップデート

エラー詳細

vagrant up を実行したら、以下のエラーが出た。

The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

/usr/sbin/rcvboxadd setup

Stdout from the command:

VirtualBox Guest Additions: Starting.
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel 
modules. This may take a while.
VirtualBox Guest Additions: To build modules for other installed kernels, run
VirtualBox Guest Additions:  /sbin/rcvboxadd quicksetup <version>
VirtualBox Guest Additions: or
VirtualBox Guest Additions:  /sbin/rcvboxadd quicksetup all
VirtualBox Guest Additions: Kernel headers not found for target kernel 
3.10.0-1160.45.1.el7.x86_64. Please install them and execute
 /sbin/rcvboxadd setup


Stderr from the command:

modprobe vboxguest failed
The log file /var/log/vboxadd-setup.log may contain further information.

注目すべきは以下。
Kernel headers not found for target kernel
3.10.0-1160.45.1.el7.x86_64. Please install them and execute
/sbin/rcvboxadd setup

kernel のバージョンが想定と違っているということらしい。

対応

ゲストにログインして(エラーは出ているが、仮想マシン自体は立ち上がっているのだ)、以下のコマンドを実行する。

sudo yum -y update kernel && sudo yum -y install kernel-devel kernel-headers make bzip2 gcc

コマンドの理由

おそらく仮想マシンを最初に作ったときにも同じコマンドを実行しているはず。
VirtualBox Guest Additions に必要なツール群。
もしかしたら全部はいらないかもしれないし、環境によっては他にも不足しているものがあるかもしれないので、適宜調整する。


VirtualBox っていう箱よく壊れるよね。
もう少し頑丈に作ってくれないだろうか。

0
1
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
0
1