By using the hyperv provider for vagrant, I am unable to read files in the /packages share. I can see and list (dir) the files, but I can not read the files.
Setup
- Windows 10 pro ver 1903 (Version 10.0.18362.175)
- hyperv installed and working across multiple other things (hyperv itself, docker, etc.)
- Vagrant 2.2.4
Repo
- Setup as per instructions at https://github.com/chocolatey-community/chocolatey-test-environment/blob/master/ReadMe.md except for the following:
- No Virtualbox -- we will be using the hyperv box and provider
- No plugin sahara -- this is unneeded for this issue
vagrant winrm -e -s powershell -c "copy c:/packages/*.* c:/"
Result
copy : Could not find file 'C:\packages\ReadMe.md'.
At C:\windows\temp\winrm-elevated-shell-fff58481-a970-493f-9281-4d343fbfd9b2.ps
1:1 char:1
+ copy c:/packages/*.* c:/
+ ~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Copy-Item], FileNotFoundExcep
tion
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerS
hell.Commands.CopyItemCommand
Expected
No errors and the Readme.md file to be copied.
Notes
Listing files succeeds like this:
vagrant winrm -e -s powershell -c "dir C:/packages/"
Directory: C:\packages
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a--- 6/19/2019 12:05 AM 113 ReadMe.md
All attempts to read the files (like readme.md) usign different methods results in similar errors. For example, editing the Vagrantfile to have a provision command type c:/packages/ReadMe.md results in the error:
==> default: Running provisioner: shell...
default: Running: inline PowerShell script
default: SUCCESS: Specified value was saved.
default: Testing package if a line is uncommented.
default: type : Cannot find path 'C:\packages\ReadMe.md' because it does not exist.
default: At C:\tmp\vagrant-shell.ps1:16 char:1
default: + type c:/packages/ReadMe.md
default: + ~~~~~~~~~~~~~~~~~~~~~~~~~~
default: + CategoryInfo : ObjectNotFound: (C:\packages\ReadMe.md:String) [
default: Get-Content], ItemNotFoundException
default: + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetCo
default: ntentCommand
Manipulating the permissions on the packages folder and files on the host did not resolve the problems. I added full access to Everyone and yet the files can be seen, but can not be read.
In ba95e7d the hyperv provider and box was added. Was the read of local packages in the /packages share tested? If so, are there setup/permission/file requirements to get it to work?
By using the hyperv provider for vagrant, I am unable to read files in the /packages share. I can see and list (dir) the files, but I can not read the files.
Setup
Repo
vagrant winrm -e -s powershell -c "copy c:/packages/*.* c:/"Result
Expected
No errors and the Readme.md file to be copied.
Notes
Listing files succeeds like this:
All attempts to read the files (like readme.md) usign different methods results in similar errors. For example, editing the
Vagrantfileto have a provision commandtype c:/packages/ReadMe.mdresults in the error:Manipulating the permissions on the packages folder and files on the host did not resolve the problems. I added
fullaccess toEveryoneand yet the files can be seen, but can not be read.In ba95e7d the hyperv provider and box was added. Was the read of local packages in the /packages share tested? If so, are there setup/permission/file requirements to get it to work?