質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Q&A

解決済

1回答

2452閲覧

Vagrantでディレクトリ共有、マウントができない(No Virtualbox Guest Additions installation found.)

m.tsuchy

総合スコア12

Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

0グッド

0クリップ

投稿2018/12/20 05:17

編集2018/12/21 02:34

前提・実現したいこと

Vagrantでディレクトリ共有を行いたい。

環境

ホストOS:Windows10
VagrantBox:CentOS/7
VirtualBox 5.2.22
Vagrant 2.2.2

発生している問題・エラーメッセージ

Vagrant was unable to mount VirtualBox shared folders. This is usually because the filesystem "vboxsf" is not available. This filesystem is made available via the VirtualBox Guest Additions and kernel module. Please verify that these guest additions are properly installed in the guest. This is not a bug in Vagrant and is usually caused by a faulty Vagrant box. For context, the command attempted was: mount -t vboxsf -o uid=1000,gid=1000 var_www_html_tutorial /var/www/html/tutorial The error output from the command was: /sbin/mount.vboxsf: mounting failed with the error: No such device

試したこと

プラグイン「vagrant-vbguest」をインストール

vagrant plugin install vagrant-vbguest

プラグイン実行

vagrant vbguest

ログ

D:\Vagrant\centos7>vagrant vbguest [default] No Virtualbox Guest Additions installation found. Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: ftp.nara.wide.ad.jp * extras: ftp.nara.wide.ad.jp * updates: ftp.iij.ad.jp Package gcc-4.8.5-36.el7.x86_64 already installed and latest version Package binutils-2.27-34.base.el7.x86_64 already installed and latest version Package 1:make-3.82-23.el7.x86_64 already installed and latest version Package 4:perl-5.16.3-293.el7.x86_64 already installed and latest version Package bzip2-1.0.6-13.el7.x86_64 already installed and latest version Nothing to do Copy iso file C:\Program Files\Oracle\VirtualBox\VBoxGuestAdditions.iso into the box /tmp/VBoxGuestAdditions.iso Mounting Virtualbox Guest Additions ISO to: /mnt mount: /dev/loop0 is write-protected, mounting read-only Installing Virtualbox Guest Additions 5.2.22 - guest version is unknown Verifying archive integrity... All good. Uncompressing VirtualBox 5.2.22 Guest Additions for Linux........ VirtualBox Guest Additions installer Removing installed version 5.2.22 of VirtualBox Guest Additions... Copying additional installer modules ... Installing additional modules ... VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules. This may take a while. This system is currently not set up to build kernel modules. Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. The distribution packages containing the headers are probably: kernel-devel kernel-devel-3.10.0-957.1.3.el7.x86_64 VirtualBox Guest Additions: Starting. VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules. This may take a while. This system is currently not set up to build kernel modules. Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. The distribution packages containing the headers are probably: kernel-devel kernel-devel-3.10.0-957.1.3.el7.x86_64 An error occurred during installation of VirtualBox Guest Additions 5.2.22. Some functionality may not work as intended. In most cases it is OK that the "Window System drivers" installation failed. Redirecting to /bin/systemctl start vboxadd.service Job for vboxadd.service failed because the control process exited with error code. See "systemctl status vboxadd.service" and "journalctl -xe" for details. Unmounting Virtualbox Guest Additions ISO from: /mnt

Vagrantfileのあるディレクトリでステータスの確認

D:\Vagrant\centos7>vagrant vbguest --status [default] No Virtualbox Guest Additions installation found.

ゲストOSにて、下記を実行

[vagrant@localhost ~]$ sudo /etc/init.d/vboxadd setup sudo: /etc/init.d/vboxadd: command not found

参考にしたページ

https://qiita.com/_CHUBURA/items/4166585cf3f44e33271d
https://qiita.com/takutoki/items/33cf1230e032931f9adc

2018/12/21追記

下記のページも参考になりそうだと思いました。
https://github.com/dotless-de/vagrant-vbguest/issues/311

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

vbguestの実行に失敗していると見受けられます。以下の記事を参考にしてみてはどうでしょうか。
https://qiita.com/iwsksky/items/1374b1f9ed311c1e8423

投稿2018/12/21 00:14

ozwind918

総合スコア1140

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

m.tsuchy

2018/12/21 02:30

回答ありがとうございます。vbguestの実行に失敗してそうです。ログの情報を追記しました。 今回の場合は、kernel-devel kernel-devel-3.10.0-957.1.3.el7.x86_64をインストールすれば良いと理解しています。 ただし、どのURLでyum installすればよいか自分で探すことができず、ストップしています。
ozwind918

2018/12/21 02:57

普通にbaseリポジトリで取得できるバージョンだと思います。yum list --showduplicate kernel-devel で確認してみてください。
m.tsuchy

2018/12/21 02:58

解決しました。下記を実行し、記事を参考に再実行したところマウント成功しました。 sudo yum -y install ftp://ftp.ntua.gr/pub/linux/centos/7.6.1810/updates/x86_64/Packages/kernel-devel-3.10.0-957.1.3.el7.x86_64.rpm ありがとうございました。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問