0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrantで作成したCentOS7環境へVirtualBox Guest Additionsをインストールする

Last updated at Posted at 2019-01-11

はじめに

CentOSが公式に提供しているCentOS7のVagrantイメージ(Vagrant box)は、デフォルトでVirtualBox Guest Additionsが含まれていません。

VirtualBox Guest Additionsが無くてもCentOS7を利用することはできますが、VirtualBoxの共有フォルダが利用できない等、VirtualBox Guest Additionsより提供される機能をゲストOS側で利用することができません。

対応方法

VirtualBox Guest AdditionsをゲストOSへインストールします。
VirtualBox Guest Additionsのインストール方法は2種類あります。

  • 1.手動でインストールする方法
  • 2.vagrant-vbguestプラグインを利用してインストールする方法

1.の方法では、Vagrantを利用せずにVirtualBoxで仮想マシンを作成した場合と同様に、VirtualBoxのゲストOSのウインドウを開き、Devices - Install Guest Additions…を実行し、マウントされたVirtualBox Guest AdditionsのISOイメージを利用してインストールします。

VirtualBoxのバージョンアップや、ゲストOSのカーネルがバージョンアップされた際は、都度再インストールが必要となります。

2.の方法では、vagrant up時にゲストOSのバージョンに合ったVirtualBox Guest Additionsがインストールされます。

プラグインをインストールするには、ホストOS上で以下のコマンドを実行します。

vagrant plugin install vagrant-vbguest

VirtualBoxがバージョンアップされた場合は、追従してvagrant up時にゲストOSのVirtualBox Guest Additionsも更新されます。また、ゲストOSのカーネルがバージョンアップされた際も、それに合わせたVirtualBox Guest Additionsに更新されます。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?