Windows 8.1、最新の Vagrant および VirtualBox バージョン。Windows 上の git CLI でコマンドを実行します。
ubuntu/trusty64
問題なく起動でき、atlas.hashicorp.com にログインする必要もありませんでした。
しかし、試してみるとubuntu/xenial64
エラーが発生しました。
vagrant init ubuntu/xenial64; vagrant up --provider virtualbox
また、trusty 64 では でのログインに関する警告は表示されませんでしたvagrant login
が、xenial 64 ではそのような警告が表示されたため、すぐに atlas.hashicorp.com でアカウントを作成しました。
ログインするとvagrant login
、「ログインしました」というメッセージが表示されました。
フォルダーから Vagrant のものを削除し、コマンドをやり直しましたinit
がup
、再び同じエラーが発生します。
$ vagrant init ubuntu/xenial64; vagrant up --provider virtualbox
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/xenial64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
The box 'ubuntu/xenial64' could not be found or
could not be accessed in the remote catalog. If this is a private
box on HashiCorp's Atlas, please verify you're logged in via
`vagrant login`. Also, please double-check the name. The expanded
URL and error message are shown below:
URL: ["https://atlas.hashicorp.com/ubuntu/xenial64"]
Error:
しかし、「エラー:」の部分は空白です。
他の場所で、ボックスの URL をVagrantfile
次のように追加するという提案を見つけました。
config.vm.box_url = "http://example.com/some_box_url.box"
https://stackoverflow.com/a/31538713/631764
コメントで提案されたリンクを使用してこれをテストしています。Vagrantfile
ほとんどのコメントを除いた完全な内容は次のとおりです。
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
# https://docs.vagrantup.com.
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "ubuntu/xenial64"
config.vm.box_url = "https://atlas.hashicorp.com/ubuntu/boxes/xenial64/versions/20160610.0.0/providers/virtualbox.box"
# VirtualBox:
#
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
vb.gui = true
# Customize the amount of memory on the VM:
# vb.memory = "1024"
end
end
しかし、URL を使用してもエラーが発生します:
$ vagrant up --provider virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ubuntu/xenial64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Box file was not detected as metadata. Adding it directly...
==> default: Adding box 'ubuntu/xenial64' (v0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/ubuntu/boxes/xenial64/versions/20160610.0.0/providers/virtualbox.box
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
エラーメッセージは表示されませんでした。
答え1
OSX でも同じ問題が発生し、埋め込まれた curl を削除する必要がありました。
sudo rm /opt/vagrant/embedded/bin/curl
そうすると、バグのある組み込み curl ではなく、システムのデフォルトの curl が使用されるようになります。
答え2
どうやら答えが見つかったようです。
Vagrantの最新バージョン(1.8以降)にはcurl
、Windows 7、8、8.1、10では動作しませんそのまま!
しかし、修正は非常に簡単です。Microsoft Visual C++ 2010 SP1 再頒布可能パッケージをインストールするだけです。
https://www.microsoft.com/en-us/download/details.aspx?id=8328
そのページには互換性のあるオペレーティング システムとして Windows 8.1 は記載されていませんが、私の場合はうまくいきました。システムの再起動は必要なく、仮想マシンはすでに起動して実行されています。
あるいは、Vagrant バージョン 1.7.4 にダウングレードすると、問題も解決するようです。 https://releases.hashicorp.com/vagrant/
私はここで両方の解決策を見つけました: 参考: