LoginSignup
1
2

More than 5 years have passed since last update.

Windows10 に Vagrantをインストールした際、vagrant -vの時点でエラー

Last updated at Posted at 2016-09-12

はじめに

Vagrantについての詳しい内容や導入方法は他の方々がわかりやすく説明してくださっているので割愛いたします。申し訳ございません。
自分は仮想マシンの構築が面倒で、最近家では、Windows上のXamppでphpの開発を行っていたのですが、vagrantを使えば簡単に仮想サーバーを構築できると伺い、喜んでインストールしてみました。

エラー内容

インストール後、動作の確認を行おうとコマンドプロンプ上で以下のようなコマンドを実行しました。

C:\Users\[user_name]>vagrant -v

その結果以下のようなエラーが返ってきました。

C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/tmpdir.rb:85:in `mkdir': Permission denied @ dir_s_mkdir - c:/Users/[user_name]/vagrant-bundle-app-configxxxxxx (Errno::EACCES)
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/tmpdir.rb:85:in `block in mktmpdir'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/tmpdir.rb:129:in `create'
        from C:/HashiCorp/Vagrant/embedded/lib/ruby/2.2.0/tmpdir.rb:85:in `mktmpdir'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/bundler.rb:59:in `init!'
        from C:/HashiCorp/Vagrant/embedded/gems/gems/vagrant-1.8.4/lib/vagrant/pre-rubygems.rb:23:in `<main>'

テンポラリディレクトリがうまく取得できていないようで、確認してみると、
%USERPROFILE%\AppData\Local\Temp
でのwritable?関数がfalseを返しているようでした。
一応Cドライブ直下にtmpというディレクトリを作成することで動作するようにはなったようだけれど、勉強不足のため、なぜ上記の一時ディレクトリが書込不可となっているのかまではわかりません。。。
権限はどのユーザーでも書き込みできるようになっていたし、他のソフトは問題なく書き込みできているっぽいんだけどなあ。。。

追記(9/15)

原因がわかりました。
VagrantをインストールしたC:\HashiCorp\以下の整合性レベルがLowとなっていたことが原因だったようです。管理者権限でコマンドプロンプトを実行し、以下のコマンドを実行し、整合性レベルをMediumにしたところ、問題なく動作するようになりました。やっぱりwindowsの権限管理は難しいですね。。。
C:\WINDOWS\system32>icacls C:\HashiCorp\* /setintegritylevel M /T

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