0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

windowsのvagrant、i686は32bit。64bitはAMD64。

Posted at

要約

  • i686は32bitCPUだが、64bitのwindowsにおいて、vagrantのi686バージョンは普通にインストールできてしまう
  • できてしまうが、boxイメージによってはvagrant upに失敗する
  • boxイメージによっては普通に動くので、間違えてしまうと気づきにくい

経緯(前書き)

要約だけで情報としては十分だと思いますが、同様事象を検索したときヒットしやすいように、経緯も書いておきます。

経緯

1. はまる

vagrantを最新版にすることにした
windowsの選択肢にはAMD64とi686があった
image.png
当時の私は、特に意識することなくi686を選んだらしい←←←
開発環境で使っていたvagrantはubuntu20.04で、これはvagrant upできた
折角なのでubuntuを最新版(24.04)にすることにした

旧:config.vm.box = "ubuntu/focal64"
新:config.vm.box = "bento/ubuntu-24.04"

vagrant upが失敗する。

The box you're attempting to add doesn't support the provider you requested. Please find an alternate box or use an alternate provider.
Double-check your requested provider to verify you didn't simply misspell it.

Name: bento/ubuntu-24.04
Address: https://vagrantcloud.com/api/v2/vagrant/bento/ubuntu-24.04
Requested provider: virtualbox (i386)

後から見返すと、ここにi386の文字があることでおかしいと気づくべきだったかも。

2. 試行錯誤的な

vagrant up --debug などするうちに、
「CPUがi386と判定されてるんじゃね?」と思い至った。

そしてぐぐっていく。

config.vm.box_architecture = "amd64"

とすることで強制的に64bitCPUと判定させることができるらしい。
これによりエラーメッセージは出なくなったが、構築中に止まったりするようになった。
これでは実用に耐えない。

3. こたえ

原因はvagrantのバグで最新版では直ってる。とかないかなあ。
とvagrantのダウンロードサイトを訪れた
なんやかんやで、

  • i686は32bitである
  • 自分がインストールしたのはi686であった

と気づいた。

確認方法は

  • 私はPC単位でインストーラを保存しているので、インストーラのファイル名で気付けた。
  • ほか、i686であれば32bitアプリなので、インストールフォルダがprogram filex(x86) であることでも確認できる。

AMD64版をダウンロード、インストール、windows再起動、vagrant up
同じエラーが出た。
vagrantのi686版は32bitアプリなので、これが残ったまま64bitアプリであるAMD64版をインストールすると、共存してしまっていた。
i686版をアンインストール、windows再起動、vagrant up
成功👍

ポエム

言い訳をするなら、windows=intel=i386,i486・・・という古い感性に引きずられたのだと思う

参考資料

CPUのアーキテクチャの違いまとめ(x86/x64/x86_64/AMD64/i386/i686とはなんなのか?)
https://blog.framinal.life/entry/2020/04/22/041548

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?