LoginSignup
8
11

More than 5 years have passed since last update.

Ubuntu16.04のVagrant Boxを取得する

Last updated at Posted at 2016-11-24

https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04
上記のページから、Ubuntu16.04はAtlasに存在するっぽい。

直接Vagrant用のBoxをatlasからダウンロードする - Qiita

この記事を参考に、BoxのダウンロードURLを作成する。

  • box url: https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04
  • version: v2.3.0 => /versions/2.3.0
  • provider: virtualbox => /providers/virtualbox.box

BoxのダウンロードURLは {url}{version}{provider} と組み立てれば良いとのことなので、これらの情報から以下のURLが生成できる。

https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04/versions/2.3.0/providers/virtualbox.box

これでbox addしてみる。

$ vagrant box add ubuntu16.04 https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04/versions/2.3.0/providers/virtualbox.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'ubuntu16.04' (v0) for provider:
    box: Downloading: https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04/versions/2.3.0/providers/virtualbox.box
==> box: Successfully added box 'ubuntu16.04' (v0) for 'virtualbox'!

Boxをダウンロードできた。

--

(2016/11/25 追記)
上記Boxを利用してvagrant upで起動したところ、

$ vagrant up                                                                         (git)-[master]-
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'ubuntu16.04'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: {{ vm.name }}
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 => 8888 (adapter 1)
    default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
    default: Warning: Connection timeout. Retrying...
...

のままssh接続できない状況になってしまっていました。この状況をググってみると、
Vagrant で bento/ubuntu-16.04 を vagrant up すると Connection timeout になってしまう - Qiita
と報告があり、試してみると無事ssh接続できました。ホント有り難いことです!

※確認環境

  • OS: OS X El Capitan
  • Vagrant: 1.8.7
  • VirtualBox: 5.0.30 r112061
8
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
11