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

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

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

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

Q&A

2回答

1172閲覧

vagrant upのエラー。timed out

退会済みユーザー

退会済みユーザー

総合スコア0

Vagrant

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

0グッド

0クリップ

投稿2018/07/21 13:54

編集2018/07/23 01:17

前提・実現したいこと

オライリーの"入門 ソーシャルデータ"第2版で勉強するために、vagrantベースの仮想化マシンを構築したい。

発生している問題・エラーメッセージ

$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'precise64' 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 'precise64' (v0) for provider: virtualbox default: Downloading: http://files.vagrantup.com/precise64.box default: Download redirected to host: hashicorp-files.hashicorp.com default: An error occurred while downloading the remote file. The error message, if any, is reproduced below. Please fix this error and try again. Failed to connect to hashicorp-files.hashicorp.com port 443: Timed out

接続できない理由が分かりません。

以下、vagrantfileです。

# -*- mode: ruby -*- # vi: set ft=ruby : ########################################################################### # This configuration file is the starting point for understanding how the # virtual machine is configured and provides a default provider that uses # Virtualbox to provide virtualization. It also contains an *experimental* # provider for using an AWS EC2 microinstance in the cloud. The AWS provider # works but is a bit bleeding edge and incomplete from the standpoint of # providing all of the functionality that it should at this time, so it should # only be used by hackers who are comfortable working in the cloud. After # filling in the necessary AWS credentials below use the --provider=aws # option to use the AWS provider. See https://github.com/mitchellh/vagrant-aws # for more details. # # See http://docs.vagrantup.com/v2/vagrantfile/index.html for additional # details on Vagrantfile configuration in general. ########################################################################### Vagrant.configure("2") do |config| # SSH forwarding: See https://help.github.com/articles/using-ssh-agent-forwarding config.ssh.forward_agent = true ######################################################################### # Virtualbox configuration - the default provider for running a local VM ######################################################################### config.vm.provider :virtualbox do |vb, override| # The Virtualbox image override.vm.box = "precise64" override.vm.box_url = "http://files.vagrantup.com/precise64.box" # Port forwarding details # Note: Unfortunately, port forwarding currently is not implemented for # the AWS provider plugin, so you'll need to manually open them through the # AWS console or with the EC2 CLI tools. (It would be possible to do it # all through an additional Chef recipe that runs as part of MTSW2E, but # just isn't implemented yet.) Only port 8888 is essential # to initially access IPython Notebook and get started. # IPython Notebook override.vm.network :forwarded_port, host: 8888, guest: 8888 # Flask override.vm.network :forwarded_port, host: 5000, guest: 5000 # MongoDB override.vm.network :forwarded_port, host: 27017, guest: 27017 override.vm.network :forwarded_port, host: 27018, guest: 27018 override.vm.network :forwarded_port, host: 27019, guest: 27019 override.vm.network :forwarded_port, host: 28017, guest: 28017 # You can increase the default amount of memory used by your VM by # adjusting this value below (in MB) and reprovisioning. vb.customize ["modifyvm", :id, "--memory", "384"] end ######################################################################### # AWS configuration - an experimental provider for running this VM in the # cloud. See https://github.com/mitchellh/vagrant-aws for configuration # details. User specific values for your own environment are referenced # here as MTSW_ environment variables that you could set (or hard code.) ######################################################################### config.vm.provider :aws do |aws, override| aws.access_key_id = ENV['MTSW_AWS_ACCESS_KEY_ID'] aws.secret_access_key = ENV['MTSW_AWS_SECRET_ACCESS_KEY'] aws.keypair_name = ENV['MTSW_KEYPAIR_NAME'] # A Precise64 Ubuntu image that will run as a microinstance in the # region specified aws.ami = "ami-fb68f8cb" aws.region = "us-west-2" aws.instance_type = "t1.micro" override.vm.box = "aws" override.ssh.username = "ubuntu" override.ssh.private_key_path = ENV['MTSW_KEYPAIR_PATH'] # "vagrant plugin install omnibus" to get Chef-Solo on vanilla AMI override.omnibus.chef_version = "11.6.0" end # Chef-Solo provisioning config.vm.provision :chef_solo do |chef| chef.log_level = :debug chef.cookbooks_path = "deploy/cookbooks" chef.json = { :answer => "42", } chef.run_list = [ "recipe[mtsw2e::default]" ] end end

補足情報(FW/ツールのバージョンなど)

同書の付録Aに基づいvirtual box(5.2.16),vagrant(2.1.2_x86_64)をダウンロード、インストールしました。

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

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

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

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

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

euledge

2018/07/21 15:39

Vagrantfileも質問に追記してください
退会済みユーザー

退会済みユーザー

2018/07/23 01:17

追記しました!よろしくお願いします。
guest

回答2

0

なぜ、エラーになるかどうかは置いておいてubuntuの仮想サーバーを立てるのが目的であればboxを別の場所からもってくれば解決できそうです。

Vagrant公式のこのページにあるように ktokrnが指定されているものと hashicorpの提供しているものは同じものだと思いますので、代替しても問題ないと思いますよ。

手元の環境で行ったとき以下の結果になりました。

1. 質問者のVagrantfileと同じ設定
結果: NG

ruby

1Vagrant.configure("2") do |config| 2 config.vm.box = "hashicorp/precise64" 3 config.vm.box_url = "http://files.vagrantup.com/precise64.box" 4end

text

1C:\virtualbox\precises64>vagrant up 2Bringing machine 'default' up with 'virtualbox' provider... 3==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install... 4 default: Box Provider: virtualbox 5 default: Box Version: >= 0 6==> default: Box file was not detected as metadata. Adding it directly... 7==> default: Adding box 'hashicorp/precise64' (v0) for provider: virtualbox 8 default: Downloading: http://files.vagrantup.com/precise64.box 9 default: Download redirected to host: hashicorp-files.hashicorp.com 10 default: Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--) 11An error occurred while downloading the remote file. The error 12message, if any, is reproduced below. Please fix this error and try 13again.

1,2 の結果を見比べるとファイルの置き場所が変わったのではないかなぁとも思います。

2. hashicorpから提供されるbox
結果: OK

ruby

1Vagrant.configure("2") do |config| 2 config.vm.box = "hashicorp/precise64" 3end

text

1C:\virtualbox\precises64>vagrant up 2Bringing machine 'default' up with 'virtualbox' provider... 3==> default: Box 'hashicorp/precise64' could not be found. Attempting to find and install... 4 default: Box Provider: virtualbox 5 default: Box Version: >= 0 6==> default: Loading metadata for box 'hashicorp/precise64' 7 default: URL: https://vagrantcloud.com/hashicorp/precise64 8==> default: Adding box 'hashicorp/precise64' (v1.1.0) for provider: virtualbox 9 default: Downloading: https://vagrantcloud.com/hashicorp/boxes/precise64/versions/1.1.0/providers/virtualbox.box 10 default: Progress: 0% (Rate: 107k/s, Estimated time remaining: 1:02:51))

3. ubuntuから提供されるbox
結果: OK

ruby

1Vagrant.configure("2") do |config| 2 config.vm.box = "ubuntu/precise64" 3end

text

1C:\virtualbox\precises64>vagrant up 2Bringing machine 'default' up with 'virtualbox' provider... 3==> default: Box 'ubuntu/precise64' could not be found. Attempting to find and install... 4 default: Box Provider: virtualbox 5 default: Box Version: >= 0 6==> default: Loading metadata for box 'ubuntu/precise64' 7 default: URL: https://vagrantcloud.com/ubuntu/precise64 8==> default: Adding box 'ubuntu/precise64' (v20170427.0.0) for provider: virtualbox 9 default: Downloading: https://vagrantcloud.com/ubuntu/boxes/precise64/versions/20170427.0.0/providers/virtualbox.box 10 default: Download redirected to host: cloud-images.ubuntu.com 11 default: Progress: 1% (Rate: 34973/s, Estimated time remaining: 2:02:23)

投稿2018/07/23 02:35

euledge

総合スコア2404

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

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

0

よくわからないですが
このgithubに同じ問題の質問が載っていて解決してそうです
https://github.com/hashicorp/vagrant/issues/9897

投稿2018/07/21 16:27

yryuu

総合スコア151

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問