0

我是包装工的新手。首先,我尝试构建:https ://github.com/shiguredo/packer-templates/tree/develop/ubuntu-14.04 ,效果很好。但是当我想通过我犯错时,vagrant up我得到以下错误:

Vagrant environment or target machine is required to run this
command. Run `vagrant init` to create a new Vagrant environment. Or,
get an ID of a target machine from `vagrant global-status` to run
this command on. A final option is to change to a directory with a
Vagrantfile and to try again.

调用vagrant init一个看起来像默认配置文件的配置文件后,就会创建。但是还是有错误:

Bringing machine 'default' up with 'parallels' provider...
==> default: Box 'base' could not be found. Attempting to find and install...
    default: Box Provider: parallels
    default: Box Version: >= 0
==> default: Adding box 'base' (v0) for provider: parallels
    default: Downloading: base
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /Downloads/packer-templates-develop/ubuntu-14.04/base

如何在本地启动我的打包程序生成的 VM?是手动跟踪 Vagrantfile 的唯一解决方案吗?

编辑:

如果我打电话vagrant init myNewlyCreatedBox.box ,那么 vagrant 也会尝试启动虚拟机,但是

Failed to mount folders in Linux guest. This is usually because
the "prl_fs" file system is not available. Please verify that
Parallels Tools are properly installed in the guest and
can work properly. If so, the VM reboot can solve a problem.
The command attempted was:

mount -t prl_fs -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t prl_fs -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant
4

1 回答 1

2

这些模板将为您生成一个 Vagrant 框。ubuntu-14-04-x64-virtualbox.box如果该过程成功完成,您应该拥有ubuntu-14-04-x64-vmware.box文件指定的template.json文件。要在 Vagrant 中使用这些新创建的框,您需要通过以下方式将与您的特定管理程序对应的框添加到 Vagrant 知道的框列表中:

vagrant box add <nameToReferToBox> <pathToBoxYouJustCreated>

例如

vagrant box add ubuntu-14-04-x64 ubuntu-14-04-x64-virtualbox.box

然后要创建该框的实例(VM),您可以简单地创建一个针对您刚刚导入的新框的 Vagrant 文件:

vagrant init ubuntu-14-04-x64

然后基于基本框启动一个虚拟机:

vagrant up

于 2015-08-11T18:19:53.837 回答