はじめに
ubuntu16.04を使っている開発プロジェクトの環境を、新PCで作成したら失敗したのでメモ。
発生した問題
- 新PCセットアップ中に、初めて
vagrant up
するとリモートファイルのダウンロードに失敗する- 旧PCでは、ubuntu1604で環境が作れていたのになぜ?
環境
区分 | 値 | 備考 |
---|---|---|
vagrant | 2.1.2 | |
virtualbox | 5.2.18 | |
boxイメージ | ubuntu1604-desktop | ubuntu/bionic64に変更した |
発生したエラー
>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'box-cutter/ubuntu1604-desktop' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'box-cutter/ubuntu1604-desktop'
default: URL: https://vagrantcloud.com/box-cutter/ubuntu1604-desktop
==> default: Adding box 'box-cutter/ubuntu1604-desktop' (v2.0.26) for provider: virtualbox
default: Downloading: https://vagrantcloud.com/box-cutter/boxes/ubuntu1604-desktop/versions/2.0.26/providers/virtualbox.box
default: Download redirected to host: cdn.boxcutter.io
default:
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.
The requested URL returned error: 404 Not Found
確かに、http://cdn.boxcutter.io/ubuntu/virtualbox5.1.10/ubuntu1604-desktop-2.0.26.box にアクセスするとエラーになる。
根本的な原因
2018年1月頃から、バイナリの提供をやめているとのこと。
https://github.com/boxcutter/ubuntu/issues/142
代替案1
16.04系を使うなら、ubuntu/xenial64
にする。
代替案2
16.04ではなく、18.04にする。
https://vagrantcloud.com/search にて、「18.04」で検索すると、18.04のイメージが結構出てくる。
今回は、ubuntu/bionic64 を採用する。
# config.vm.box = "box-cutter/ubuntu1604-desktop"
config.vm.box = "ubuntu/bionic64"
おわりに
無事に仮想環境を作ることができました。この機会に、プロジェクトのOSも16.04から、18.04に上げたいと思います。