vagrant box add metadata.json报错

1,248 阅读1分钟
vagrant box add metadata.json
==> box: Loading metadata for box 'metadata.json'
    box: URL: file://E:/xunleixiazia/lc-homestead-6.1.0-2018061700/metadata.json
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Invalid file://hostname/, expected localhost or 127.0.0.1 or none

解决办法就是使用绝对路径。

$ vagrant box add E:/xunleixiazia/lc-homestead-6.1.0-2018061700/metadata.json
==> box: Loading metadata for box 'E:/xunleixiazia/lc-homestead-6.1.0-2018061700/metadata.json'
    box: URL: file:///E:/xunleixiazia/lc-homestead-6.1.0-2018061700/metadata.json
==> box: Adding box 'lc/homestead' (v6.1.0) for provider: virtualbox
    box: Downloading: virtualbox.box
    box:
==> box: Successfully added box 'lc/homestead' (v6.1.0) for 'virtualbox'!