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

packer で生成された VM をローカルで起動するにはどうすればよいですか? Vagrantfile を手動で追跡する唯一の解決策はありますか?

編集:

私が呼び出すとvagrant init myNewlyCreatedBox.box 、vagrant は VM を起動しようとしますが、

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.boxubuntu-14-04-x64-vmware.boxfile で指定された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

次に、ベース ボックスに基づいて VM をスピンアップします。

vagrant up

于 2015-08-11T18:19:53.837 に答える