LoginSignup
0
0

More than 3 years have passed since last update.

Hyper-VプロバイダのVagrant実行時の権限問題対処(荒療治)

Last updated at Posted at 2020-12-12

DドライブなどのOSがインストールされていないドライブでvagrnt upする場合に発生する問題の対処です。

普通にvagrant up --provider=hypervしてみる

vagrant up
Bringing machine 'default' up with 'hyperv' provider...
==> default: Verifying Hyper-V is enabled...
==> default: Verifying Hyper-V is accessible...
Hyper-V access check has failed for the configured destination. This
is usually caused by running on a non-system drive which is missing
required permissions. Running the following command may resolve the
problem:

  icacls.exe d:\XXXX /T /Q /grant "NT AUTHORITY\SYSTEM:(IO)(CI)(F)"

ちなみに提示されたコマンドを実行しても解決しない。(というかハングした。)
WSL環境から実施するとコマンド自体は動いた気がする。

対処

似たような問題に対処しているバグチケットがあった
https://github.com/hashicorp/vagrant/issues/9986

ざっと見た感じ、言語設定による差分でvagrant内の判定に問題が起きているらしい。
ただ細かくみるつもりはないしpowershellスクリプトの読み方もイマイチ分からない。
とにかくこの判定式を抜けようということで絶対にTrueを返すようにしたところ対応できた。

VagrantVM.psm1
function Check-VagrantHyperVAccess {
    return $true
    param (
0
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
0
0