LoginSignup
2
0

More than 5 years have passed since last update.

VagrantでVirtualBox上に立てたCentos7内にVBoxGuestAdditionsをインストールする方法備忘録

Last updated at Posted at 2018-02-15

最新版のCentos7の公式ボックスにはguest additionsが入っていませんので、それインストールするためのメモみたいなものです。

Centosをインストールするところまでは省略します。

ホストマシン側

ゲストマシンに仮想的な光学ドライブを追加してGAイメージをマウントする

画像の感じでポチポチして光学ドライブを追加。
無事追加出来たらGAイメージを指定する。
多分下記にある

C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso

window.png

ゲストマシン側

各種パッケージをインストールして再起動

  • gcc
  • make
  • gcc-c++
  • kernel-devel
  • kernel-headers
# yum -y install gcc make gcc-c++ kernel-devel kernel-headers

install後に再起動

光学ドライブのイメージからVBoxGuestAdditionsをインストールする

光学ドライブをマウントする?

正直この作業は理屈がよくわかっていません。

# mkdir /media/cdrom/
# mount -r /dev/cdrom /media/cdrom
# /media/cdrom/
# cd /media/cdrom/
# ls -la
total 49573
dr-xr-xr-x. 2 root root      480 Jan 15 13:59 32Bit
dr-xr-xr-x. 2 root root      480 Jan 15 13:59 64Bit
-r--r--r--. 1 root root      763 Nov 28 09:50 AUTORUN.INF
-r-xr-xr-x. 1 root root     6384 Jan 15 13:52 autorun.sh
dr-xr-xr-x. 2 root root      950 Jan 15 13:59 cert
dr-xr-xr-x. 2 root root     2508 Jan 15 13:59 OS2
-r-xr-xr-x. 1 root root     4821 Jan 15 13:52 runasroot.sh
-r--r--r--. 1 root root      449 Jan 15 13:59 TRANS.TBL
-r-xr-xr-x. 1 root root  7300555 Jan 15 13:52 VBoxLinuxAdditions.run
-r--r--r--. 1 root root 16426496 Jan 15 14:53 VBoxSolarisAdditions.pkg
-r-xr-xr-x. 1 root root 16471688 Jan 15 13:59 VBoxWindowsAdditions-amd64.exe
-r-xr-xr-x. 1 root root   268504 Jan 15 13:52 VBoxWindowsAdditions.exe
-r-xr-xr-x. 1 root root 10275944 Jan 15 13:53 VBoxWindowsAdditions-x86.exe

VBoxLinuxAdditions.runを実行する

# ./VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 5.2.6 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.2.6 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted
VirtualBox Guest Additions: Starting.

再起動する

以上で入るはず。

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