无法在流浪者中映射文件夹

时间:2021-03-15 09:42:04

标签: vagrant virtualbox homestead

我使用的是 mac,在此之后我在运行命令 vagrant up 时设置了 vagrant,我没有收到任何错误并且我通过 ssh 成功登录

信息

流浪者版本 = 流浪者 2.2.14

虚拟盒子 = 6.1

代码文件夹路径 = /User/mac/code

Homestead 路径 = /User/mac/Homestead

问题

通过ssh登录后,我在代码目录中看不到我的项目文件夹

enter image description here

当我运行这个命令时,我只看到这两个文件夹,其中代码文件夹丢失

vagrant up --debug

SharedFolderNameMachineMapping1="vagrant"
SharedFolderPathMachineMapping1="/Users/mac/Homestead"

尝试过

代码文件夹权限

enter image description here

我在 vagrant 文件中添加了代码路径,然后运行 ​​vagrant up --provision 然后我仍然看不到我的项目文件夹

Vagrant文​​件路径/Homestead/Vagrantfile,我在config.vm.synced_folder这一行添加了代码路径

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  # config.vm.synced_folder "../data", "/vagrant_data", /Users/mac/code, type: "rsync"

代码

Homestead.yaml

 provider: virtualbox

 authorize: ~/.ssh/id_rsa.pub
  
 keys:
- ~/.ssh/id_rsa

folders:
- map: ~/code
  to: /home/vagrant/code

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

- map: firstproject.local
  to: /home/vagrant/code/firstproject
  type : apache

流浪档案

 # Share an additional folder to the guest VM. The first argument is
 # the path on the host to the actual folder. The second argument is
 # the path on the guest to mount the folder. And the optional third
 # argument is a set of non-required options.
 # config.vm.synced_folder "../data", "/vagrant_data", /Users/mac/code, type: "rsync"

0 个答案:

没有答案