简体   繁体   English

Windows 10 Pro 和 Hyper-V 上的 Vagrant SMB 共享文件夹上的“一般访问被拒绝错误”

[英]Vagrant on Windows 10 Pro and Hyper-V "General access denied error" on SMB shared folder

Environment环境

Windows 10 pro with Hyper-V带有 Hyper-V 的 Windows 10 专业版
Vagrant v.2.2.6流浪者 v.2.2.6

Status状态

Trying to starting homestead VM with SMB shared folders via Powershell and admin user, but with no luck.尝试通过 Powershell 和管理员用户使用 SMB 共享文件夹启动 homestead VM,但没有成功。

Shared 'Site' folder and created a dedicated user (usr:vagrant, pwd:vagrant) with full access to shared folder.共享“站点”文件夹并创建了一个专用用户(usr:vagrant,pwd:vagrant),可以完全访问共享文件夹。

Really struggling on this.真的为此苦苦挣扎。

Set shared folder as Sites\mysite (without complete path) since i'm sharing just this specific folder, is it right?将共享文件夹设置为Sites\mysite (没有完整路径),因为我只共享这个特定文件夹,对吗?

Error错误

PS C:\Users\sgrat\Desktop\Sites\Homestead> vagrant up --provision
Bringing machine 'homestead' up with 'hyperv' provider...
==> homestead: Verifying Hyper-V is enabled...
==> homestead: Verifying Hyper-V is accessible...
    homestead: Configuring the VM...
==> homestead: Starting the machine...
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: start_vm.ps1
Error:

Failed to start VM 'homestead' failed to start.

Synthetic SCSI Controller (Instance ID 480D9BCD-B214-461F-976E-2A9A546F9BB8): Failed to Power on with Error 'General access denied error'.

 Account does not have permission to open attachment 'C:\Users\sgrat\Desktop\Sites\Homestead\.vagrant\machines\homestead\hyperv\Virtual Hard Disks\ubuntu-18.04-amd64.vhdx'. Error: 'General access denied error'.

'homestead' failed to start. (Virtual machine ID 555B1C43-AC2B-4B9C-A9B2-94BF40753C40)

'homestead' Synthetic SCSI Controller (Instance ID 480D9BCD-B214-461F-976E-2A9A546F9BB8): Failed to Power on with Error 'General access denied error' (0x80070005). (Virtual machine ID 555B1C43-AC2B-4B9C-A9B2-94BF40753C40)

'homestead':  Account does not have permission to open attachment 'C:\Users\sgrat\Desktop\Sites\Homestead\.vagrant\machines\homestead\hyperv\Virtual Hard Disks\ubuntu-18.04-amd64.vhdx'. Error: 'General access denied error' (0x80070005). (Virtual machine ID 555B1C43-AC2B-4B9C-A9B2-94BF40753C40)

Homestead.yaml家园.yaml

ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: hyperv

authorize: c:/Users/sgrat/.ssh/id_rsa.pub

keys:
    - c:/Users/sgrat/.ssh/id_rsa

folders:
    - map: Sites\mysite
      to: /home/vagrant/mysite
      php: '7.2'
      type: "smb"
      smb_host: 127.0.0.1
      smb_username: vagrant
      smb_password: vagrant

sites:
    - map: mysite.test
      to: /home/vagrant/mysite

databases:
    - mysitedb

features:
    - mariadb: true
    - ohmyzsh: false
    - webdriver: false

I cannot speak to the validity of using relative file paths, I just remember I had some issues when I did not use complete.我不能说使用相对文件路径的有效性,我只记得我在不使用完整路径时遇到了一些问题。 I am using Git Bash, but other than that same setup as you: Win 10, Hyper-V, Vagrant 2.2.6.我正在使用 Git Bash,但除了与您相同的设置之外:Win 10、Hyper-V、Vagrant 2.2.6。

Here is my Homestead.yaml file:这是我的 Homestead.yaml 文件:

---
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: C:\Users\leif.lundberg\code
      to: /home/vagrant/code
      type: "nfs"

sites:
    - map: homestead.test
      to: /home/vagrant/code/symfobase/public

databases:
    - homestead

features:
    - mariadb: false

Also, I do not know if your keys mapping is correct and may cause an issue using forwardslash "/" instead of backslash "\".另外,我不知道您的keys映射是否正确,使用正斜杠“/”而不是反斜杠“\”可能会导致问题。

Environment环境

Windows 10 pro with Hyper-V带有 Hyper-V 的 Windows 10 专业版
Vagrant v.2.2.6流浪者 v.2.2.6

Status地位

Trying to starting homestead VM with SMB shared folders via Powershell and admin user, but with no luck.尝试通过 Powershell 和管理员用户使用 SMB 共享文件夹启动 homestead VM,但没有运气。

Shared 'Site' folder and created a dedicated user (usr:vagrant, pwd:vagrant) with full access to shared folder.共享“站点”文件夹并创建了一个具有共享文件夹完全访问权限的专用用户(usr:vagrant、pwd:vagrant)。

Really struggling on this.在这方面真的很挣扎。

Set shared folder as Sites\\mysite (without complete path) since i'm sharing just this specific folder, is it right?将共享文件夹设置为Sites\\mysite (没有完整路径),因为我只共享这个特定文件夹,对吗?

Error错误

PS C:\Users\sgrat\Desktop\Sites\Homestead> vagrant up --provision
Bringing machine 'homestead' up with 'hyperv' provider...
==> homestead: Verifying Hyper-V is enabled...
==> homestead: Verifying Hyper-V is accessible...
    homestead: Configuring the VM...
==> homestead: Starting the machine...
An error occurred while executing a PowerShell script. This error
is shown below. Please read the error message and see if this is
a configuration error with your system. If it is not, then please
report a bug.

Script: start_vm.ps1
Error:

Failed to start VM 'homestead' failed to start.

Synthetic SCSI Controller (Instance ID 480D9BCD-B214-461F-976E-2A9A546F9BB8): Failed to Power on with Error 'General access denied error'.

 Account does not have permission to open attachment 'C:\Users\sgrat\Desktop\Sites\Homestead\.vagrant\machines\homestead\hyperv\Virtual Hard Disks\ubuntu-18.04-amd64.vhdx'. Error: 'General access denied error'.

'homestead' failed to start. (Virtual machine ID 555B1C43-AC2B-4B9C-A9B2-94BF40753C40)

'homestead' Synthetic SCSI Controller (Instance ID 480D9BCD-B214-461F-976E-2A9A546F9BB8): Failed to Power on with Error 'General access denied error' (0x80070005). (Virtual machine ID 555B1C43-AC2B-4B9C-A9B2-94BF40753C40)

'homestead':  Account does not have permission to open attachment 'C:\Users\sgrat\Desktop\Sites\Homestead\.vagrant\machines\homestead\hyperv\Virtual Hard Disks\ubuntu-18.04-amd64.vhdx'. Error: 'General access denied error' (0x80070005). (Virtual machine ID 555B1C43-AC2B-4B9C-A9B2-94BF40753C40)

Homestead.yaml宅基地.yaml

ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: hyperv

authorize: c:/Users/sgrat/.ssh/id_rsa.pub

keys:
    - c:/Users/sgrat/.ssh/id_rsa

folders:
    - map: Sites\mysite
      to: /home/vagrant/mysite
      php: '7.2'
      type: "smb"
      smb_host: 127.0.0.1
      smb_username: vagrant
      smb_password: vagrant

sites:
    - map: mysite.test
      to: /home/vagrant/mysite

databases:
    - mysitedb

features:
    - mariadb: true
    - ohmyzsh: false
    - webdriver: false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM