LoginSignup
3
1

More than 5 years have passed since last update.

vagrant up で共有ファイルがマウントできなくなった("No such file or directory", vagrant 1.9.2, VirtualBox5.1)

Last updated at Posted at 2017-03-11

vagrant から届いたお知らせ

VirtualBox 5.1系に更新したところ、vagrant up でエラーが出て
共有ファイルがマウントできなくなりました。

  • Windows7
  • VirtualBox 5.1系
  • vagrant 1.9.2

エラーメッセージ

==> default: Mounting shared folders...
    default: /vagrant => C:/path/to/working/directory/ootake
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 vagrant /vagrant

The error output from the command was:

: No such file or directory

(余談)検索を間違えた

「'the filesystem "vboxsf" is not available' あたりかなー」と思って
グーグル先生やQiita先生にお尋ねしてみましたが、見つけられたのは

  • カーネルを更新
  • box をリビルド

といった感じの記事でした。

なんとなしに「これじゃない」感を受けつつ、とりあえずカーネル更新だけ
やってみましたが当然解決せず。

よくよく記事と自分のエラーとを見比べると最後のメッセージが違っていました。

自分のエラー:No such file or directory
記事のエラー:No such device

そりゃ、解決方法違いますね。

解決へ

ということであらためて検索し、stackoverflow に質問を見つけました。
Vagrant Error: Unable to Mount VirtualBox Shared Folders (Guest Additions, vboxsf)

platform.rb の 206行目を直す

C:\HashiCorp\Vagrant\embedded\gems\gems\vagrant-1.9.2\lib\vagrant\util
にあるplatform.rb の206行目を直してね。

っていう、ちょっとびっくりな内容でした。

ただ、修正内容が
* 修正前:"\?\" + path.gsub("/", "\")
* 修正後:path.gsub("/", "\")
とエラーと合致していましたので素直にしたがい、
無事にマウントされるようになりました。

No such file or directory

Ruby ファイルを書き換えるだけなので、No such file or directory と言われた場合は、
こちらを試してみる価値があると思います。

単に stackoverflow の記事の紹介となってしまいましたが、
さっくり検索して該当する記事が見つけられなかったので、参考になれば幸いです。

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