質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

Q&A

解決済

1回答

644閲覧

vagrant boxイメージをダウンロードしようとするとエラーになる2

roronoazoro

総合スコア113

CentOS

CentOSは、主にRed Hat Enterprise Linux(RHEL)をベースにした、フリーのソフトウェアオペレーティングシステムです。

Linux

Linuxは、Unixをベースにして開発されたオペレーティングシステムです。日本では「リナックス」と呼ばれています。 主にWebサーバやDNSサーバ、イントラネットなどのサーバ用OSとして利用されています。 上位500のスーパーコンピュータの90%以上はLinuxを使用しています。 携帯端末用のプラットフォームAndroidは、Linuxカーネル上に構築されています。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

VirtualBox

VirtualBoxは、現在米オラクル社が開発している、 x86仮想化ソフトウェア・パッケージの一つです。

Vagrant

Vagrantは、VirtualBox上の仮想マシンを コマンドラインから作成してくれるソフトウェアです。 ビルド環境など容易に構築が可能です。

0グッド

0クリップ

投稿2017/07/17 02:50

vagrant boxイメージをダウンロードしようとするとエラーになる
上記サイトの続きです。
一旦整理するために新たに記載いたします。

使用macOS バージョン 10.12.5

何かのきっかけでvagrant box addするとエラーが出るようになってしまいました。
一応ググりながら、色々なことを試してはいるのですが、なかなか思うように行きません。

  1. git cloneでhttpsのものをcloneしようとするとエラーとなる。

  2. どうやら鍵の設定らしく、以前もした覚えがあったが、再度作り直す。以下参照お前らのSSH Keysの作り方は間違っている(以前の鍵はgithub上のものだけ削除、ターミナル上のものはいじらずリンク先のものをそのまま設定)

  3. 順調に鍵の設定が終わり、github上に鍵の登録を済ます。

  4. 前の質問でアドバイスいただいたbrew install curl --with-openssl && brew link curl --forceを試す(終わるのに30分以上かかりました)

  5. 以下のサイトを参考にsudo rm -rf /opt/vagrant/embedded/bin/curlを実行してみるも変化なし。 Vagrant 1.8.7(Mac)の"vagrant box add ~~" でエラーとなる場合の対処法

入力sudo vagrant box add centos7-mysql http://github.com/CommanderK5/packer-centos-template/releases/download/0.7.1/vagrant-centos-7.1.box

bash

1==> box: Box file was not detected as metadata. Adding it directly... 2==> box: Adding box 'centos7-mysql' (v0) for provider: 3 box: Downloading: http://github.com/CommanderK5/packer-centos-template/releases/download/0.7.1/vagrant-centos-7.1.box 4An error occurred while downloading the remote file. The error 5message, if any, is reproduced below. Please fix this error and try 6again. 7 8SSL certificate problem: self signed certificate in certificate chain 9More details here: https://curl.haxx.se/docs/sslcerts.html 10 11curl performs SSL certificate verification by default, using a "bundle" 12 of Certificate Authority (CA) public keys (CA certs). If the default 13 bundle file isn't adequate, you can specify an alternate file 14 using the --cacert option. 15If this HTTPS server uses a certificate signed by a CA represented in 16 the bundle, the certificate verification probably failed due to a 17 problem with the certificate (it might be expired, or the name might 18 not match the domain name in the URL). 19If you'd like to turn off curl's verification of the certificate, use 20 the -k (or --insecure) option. 21MacBook-Pro:~ takanashikazuma$su

入力vagrant box add chef/centos-6.6

bash

1The box 'chef/centos-6.6' could not be found or 2could not be accessed in the remote catalog. If this is a private 3box on HashiCorp's Atlas, please verify you're logged in via 4`vagrant login`. Also, please double-check the name. The expanded 5URL and error message are shown below: 6 7URL: ["https://atlas.hashicorp.com/chef/centos-6.6"] 8Error: SSL certificate problem: self signed certificate in certificate chain 9More details here: https://curl.haxx.se/docs/sslcerts.html 10 11curl performs SSL certificate verification by default, using a "bundle" 12 of Certificate Authority (CA) public keys (CA certs). If the default 13 bundle file isn't adequate, you can specify an alternate file 14 using the --cacert option. 15If this HTTPS server uses a certificate signed by a CA represented in 16 the bundle, the certificate verification probably failed due to a 17 problem with the certificate (it might be expired, or the name might 18 not match the domain name in the URL). 19If you'd like to turn off curl's verification of the certificate, use 20 the -k (or --insecure) option. 21HTTPS-proxy has similar options --proxy-cacert and --proxy-insecure. 22MacBook-Pro:~ takanashikazuma$ 23

随時試したことを記載していこうと思っています。
何かわかるかたいましたらアドバイスよろしくお願いします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

退会済みユーザー

退会済みユーザー

2017/07/19 14:45

bentoのboxを追加しようとした場合どのような表示が出るでしょうか。
guest

回答1

0

ベストアンサー

こんにちは。
前の質問も拝見した経緯で、少し思い当たる点を書き添えてみますね。

  1. git cloneでhttpsのものをcloneしようとするとエラーとなる。
  2. どうやら鍵の設定らしく

こちらに関してですが、httpsでcloneする場合は鍵の設定は不要です。
sshプロトコルでcloneしようとするときは設定が必要ですが、Vagrantのvagrant addがうまくいかないのとは問題が違うと思います。

通常vagrant add でリモートリポジトリからboxをダウンロードする場合はhttp かhttpsを使うので、切り分けて考えたほうがいいです。
(2, 3の鍵登録自体は、自分でGitHubにリポジトリを持つ方ならほぼ皆さん行う作業なので、これはこれで問題はないのですが)

問題はhttpでのboxの取得がうまくいってないところかと思います。


入力のところの、

sudo vagrant box add centos7-mysql http://github.com/CommanderK5/packer-centos-template/releases/download/0.7.1/vagrant-centos-7.1.box

ですが、リポジトリのリリースで提供されている最新のものは centos-7.3.box です。こちらではダメですか?
また、URLも httpではなくて、httpsをつけて実施はダメでしょうか?

https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.3/vagrant-centos-7.3.box

# このように行う vagrant box add centos7-mysql https://github.com/CommanderK5/packer-centos-template/releases/download/0.7.3/vagrant-centos-7.3.box

vagrant box add chef/centos-6.6

こちらは、chef/centos-6.6 に対応するbox存在しない or 見つからなければエラーになります。
エラーメッセージにも、「could not be accessed in the remote catalog」と表示されています。

boxを追加するときに、取得するurlを明示しない場合は、HashiCorpのVagrantのboxのカタログに登録されている同名のものを探して取りに行きます。

上記の centos7-mysql のほうは「GitHub上で提供されているイメージを使う」としてurlが明示されていますが、vagrant box add chef/centos-6.6 だと、取得先が明示されていないので、HashiCorpのVagrantのboxのカタログを探しに行きます。

カタログ一覧は、

https://app.vagrantup.com/boxes/search

になります。

ここに、boxの名前が "chef/centos-6.6” というものが登録されていなければ、「could not be accessed in the remote catalog」になります。
(私も試したり探しましたが、この名前のboxは現在登録されてないみたいですね)


以上を踏まえてですが、一番よくダウンロードされている "ubuntu/trusty64” というイメージはちゃんと追加できるか、もし可能でしたらご確認いただけますか?

うまくいくとこんな流れになります。

$ vagrant box add ubuntu/trusty64 ==> box: Loading metadata for box 'ubuntu/trusty64' box: URL: https://vagrantcloud.com/ubuntu/trusty64 ==> box: Adding box 'ubuntu/trusty64' (v20170619.0.0) for provider: virtualbox box: Downloading: https://vagrantcloud.com/ubuntu/boxes/trusty64/versions/20170619.0.0/providers/virtualbox.box

投稿2017/07/19 23:20

編集2017/07/19 23:22
suama

総合スコア1997

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

roronoazoro

2017/07/20 12:36

たびたびの回答ありがとうございます。 今まとまった時間が確保できないため追って試した結果を記載させていただきたいと思います。 よろしくお願いします。
roronoazoro

2017/07/21 12:50

以前にubuntu/trusty64、vagrant-centos-7.3.box共にインストールしておりました。 今回の場合でいうとchef/centos-6.6が存在しないので当たり前にエラーをしたという解釈でしょうか。 また、別の質問で恐縮ですが、今現在、vagrant boxイメージが9個ほどストックしてあるのですが、こちら容量の問題に響いたりするのでしょうか? よろしくお願いします。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問