こんにちは、えんせきです。
新年度の1週目に感慨深い思いが沸かなくなって久しいです。
これは情緒的な問題(?)を引き起こす可能性があるので春休みが必要です。春休みが必要です。
つまりなにしたの?
UbuntuにVirtualBoxとVagrantを何も考えずにAptで入れたらVagrantのバージョンが古かった(1.8.1)ので、
最新(2.0.3)のVagrantをダウンロードしてきた。
aptでのバージョン
$ apt update $ apt install virtualbox vagrant $ virtualbox -v 5.1.34_Ubuntur121010 $ vagrant -v Vagrant 1.8.1
これで実行すると、
$ vagrant init bento/ubuntu-16.04 $ vi Vagrantfile
で以下を追加してプロバイダ(VMのホスト)にvirtualboxを利用する設定にする
config.vm.provider "virtualbox" do |vb| vb.memory = "1024" end
$ vagrant up No usable default provider could be found for your system. Vagrant relies on interactions with 3rd party systems, known as "providers", to provide Vagrant with resources to run development environments. Examples are VirtualBox, VMware, Hyper-V. The easiest solution to this message is to install VirtualBox, which is available for free on all major platforms. If you believe you already have a provider available, make sure it is properly installed and configured. You can see more details about why a particular provider isn't working by forcing usage with `vagrant up --provider=PROVIDER`, which should give you a more specific error message for that particular provider.
これはProviderを引数で指定してもダメだった。
解決する
Vagrantのバージョンが古くてVirtualBoxに追いついていないものが入っているようなので、
新しいのをダウンロードしてきて更新する。
$ apt remove vagrant $ wget https://releases.hashicorp.com/vagrant/2.0.3/vagrant_2.0.3_x86_64.deb $ sudo dpkg -i vagrant_2.0.3_x86_64.deb $ vagrant -v Vagrant 2.0.3
バージョンが上がりました。
vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Box 'bento/ubuntu-16.04' could not be found. Attempting to find and install... default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Loading metadata for box 'bento/ubuntu-16.04' default: URL: https://vagrantcloud.com/bento/ubuntu-16.04 ==> default: Adding box 'bento/ubuntu-16.04' (v201803.24.0) for provider: virtualbox default: Downloading: https://vagrantcloud.com/bento/boxes/ubuntu-16.04/versions/201803.24.0/providers/virtualbox.box # 以下もろもろ出てくるけど正常に終わった。
dpkgでいれていてアレだけど、
環境用意したいだけなのに下手にここで詰まるよりは良いと思う。