dongyi8795 2015-08-25 20:01
浏览 252

Vagrant没有映射到文件夹Ubuntu

I am attempting to create my laravel environment with homestead. I do vagrant up and it seems to work fine, however when I vagrant ssh there are no folders inside my vagrant.

I have a folder named 'Code' in my home directory.

I am using Ubuntu. Here is my yaml file.

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

authorize: /Users/pocockn/.ssh/id_rsa.pub

keys:
    - /Users/pocockn/.ssh/id_rsa

folders:
    - map: /Users/pocockn/Code
      to: /home/vagrant/Code/

sites:
    - map: laravel.dev
      to: /home/vagrant/Code/Laravel/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 93000
#       to: 9300
#     - send: 7777
#       to: 777
#       protocol: udp
  • 写回答

1条回答 默认 最新

  • dongsheng6056 2015-08-25 23:55
    关注

    Try something like this, use the ~ symbol to specify the home folder and then the folders you are going to use, something like the next example.

    ---
    ip: "192.168.10.10"
    memory: 2048
    cpus: 1
    provider: virtualbox
    
    authorize: ~/.ssh/id_rsa.pub
    
    keys:
        - ~/.ssh/id_rsa
    
    folders:
        - map: ~/Code
          to: /home/vagrant/Code/
    
    sites:
        - map: laravel.dev
          to: /home/vagrant/Code/Laravel/public
    
    databases:
        - homestead
    
    variables:
        - key: APP_ENV
          value: local
    
    # blackfire:
    #     - id: foo
    #       token: bar
    #       client-id: foo
    #       client-token: bar
    
    # ports:
    #     - send: 93000
    #       to: 9300
    #     - send: 7777
    #       to: 777
    #       protocol: udp
    
    评论

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料