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 (