株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

storagectlの引数に当たるところは、ホストマシンごとに変わることがあるよう。
以下コマンドでどのストレージコントローラーが使われているか確認して指定する。

config.vm.provider "virtualbox" do |vb|
  disk_file = "./disk/disk.vdi"
  unless File.exists?(disk_file)
    vb.customize ['createhd', '--filename', disk_file, '--format', 'VDI', '--size', 200 * 1024]
  end
    vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 2, '--device', 0, '--type', 'hdd', '--medium', disk_file]
end

仮想マシンのIDを取得

VBoxManage.exe list vms
"Vagrant_master_1669272616035_76166" {dcd9a484-7c2c-4f11-896d-8cfa7d9de942}
"Vagrant_node1_1669272828944_762" {732c2a06-ed30-4185-8772-475b6e1966f6}

showvminfoでStorageControllerNameを探す

VBoxManage.exe showvminfo dcd9a484-7c2c-4f11-896d-8cfa7d9de942 | grep "Storage Controller Name"
Storage Controller Name (0):            IDE Controller
Storage Controller Name (1):            SATA Controller

適当に仮想マシンを作って、GUIから確認することもおそらくできる。(が、ストレージコントローラーの正確な名前は取得できないみたい)

参考
https://qiita.com/maueki/items/c4ce7c2b7834e3f4ad7d
https://qiita.com/kojiwell/items/8f3e92e029e46f826754#%E8%A3%9C%E8%B6%B3

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)