LoginSignup
2
5

More than 5 years have passed since last update.

VirtualBoxのLinuxゲストにguest-addtionsをインストールして、共有フォルダをマウントする

Last updated at Posted at 2017-10-16

共有フォルダのマウント

  • VirtualBoxのGuest Additionsをインストールが必要
    • ホスト側でCDドライブにGuest Additionsのインストールディスクを挿入せず、コマンドによるインストールを行う

VirtualBoxのGuest Additionsをインストール

ゲスト : Ubuntu 16.04

  • aptでパッケージをインストールする
$ apt install virtualbox-guest-dkms

ゲスト : CentOS 7.3

  • 必要なパッケージをyumでインストール
$ yum groupinstall "Development Tools"
$ yum install dkms kernel-devel
  • 利用しているVirtualBoxのバージョンに合わせてVBOX_VERSIONを設定する
$ VBOX_VERSION='5.1.8'
$ cd /tmp
$ wget http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso
$ mount -o loop,ro VBoxGuestAdditions_$VBOX_VERSION.iso /mnt
$ sh /mnt/VBoxLinuxAdditions.run --nox11
$ umount /mnt
$ rm VBoxGuestAdditions_$VBOX_VERSION.iso
$ unset VBOX_VERSION

ホストの共有フォルダをマウントする

  • ホスト側で共有フォルダを追加する。
    • 共有フォルダは/media/sf_<共有フォルダ名>で表示される
/mnt/testにマウントする例
$ mkdir /mnt/test
$ mount -t vboxsf <共有フォルダ名> /mnt/test

参考

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