Last active
January 20, 2021 23:52
-
-
Save sawanoboly/84c880399acee7035d46 to your computer and use it in GitHub Desktop.
VagrantでVM起動時に、追加ディスクを作成してアタッチ - VirtualBox Provider ref: http://qiita.com/sawanoboly/items/cbd056252a130a4b961e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VBoxManage storageattach <uuid|vmname> | |
--storagectl <name> | |
[--port <number>] | |
[--device <number>] | |
[--type dvddrive|hdd|fdd] | |
[--medium none|emptydrive|additions| | |
<uuid|filename>|host:<drive>|iscsi] | |
[--mtype normal|writethrough|immutable|shareable| | |
readonly|multiattach] | |
[--comment <text>] | |
[--setuuid <uuid>] | |
[--setparentuuid <uuid>] | |
[--passthrough on|off] | |
[--tempeject on|off] | |
[--nonrotational on|off] | |
[--discard on|off] | |
[--bandwidthgroup <name>] | |
[--forceunmount] | |
[--server <name>|<ip>] | |
[--target <target>] | |
[--tport <port>] | |
[--lun <lun>] | |
[--encodedlun <lun>] | |
[--username <username>] | |
[--password <password>] | |
[--initiator <initiator>] | |
[--intnet] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -- snip -- | |
config.vm.define machine do |config| | |
config.vm.provider :virtualbox do |vb| | |
at_disk = 'tmp/name_of_file.vdi' | |
unless File.exists?(at_disk) | |
vb.customize ['createhd', '--filename', at_disk, '--size', 5 * 1024] | |
end | |
vb.customize ['storageattach', :id, '--storagectl', 'IDE Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium', at_disk] | |
end | |
end | |
end | |
# -- snip -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment