3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrantで作成したVMのHDD容量を増やす方法

Last updated at Posted at 2017-02-28

VMのファイルが格納されているディレクトリに移動

$ cd /Users/xxxx/VirtualBox VMs/vm_default_xxxxxxx

ファイルを確認

$ ls
Logs						vm_default_xxxxxx.vbox
box-disk1.vmdk					vm_default_xxxxxx.vbox-prev

vdiにフォーマット変換する

$ VBoxManage clonehd "box-disk1.vmdk" "clone-disk1.vdi" --format vdi

確認

$ VBoxManage showhdinfo clone-disk1.vdi

UUID:           a3d98aa8-ccd0-4899-9c83-xxxxxx
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /Users/xxxx/VirtualBox VMs/vm_default_xxxxxxx/clone-disk1.vdi
Storage format: vdi
Format variant: dynamic default
Capacity:       40280 MBytes
Size on disk:   40194 MBytes
Encryption:     disabled

サイズ(Capacity)を増やす

$ VBoxManage modifyhd clone-disk1.vdi --resize 61440

確認(Capacityが増加)

$ VBoxManage showhdinfo clone-disk1.vdi
UUID:           a3d98aa8-ccd0-4899-9c83-xxxxxx
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /Users/xxxx/VirtualBox VMs/vm_default_xxxxxxx/clone-disk1.vdi
Storage format: vdi
Format variant: dynamic default
Capacity:       61440 MBytes
Size on disk:   40194 MBytes
Encryption:     disabled

vmdkにフォーマット変換する

$ VBoxManage clonehd "clone-disk1.vdi" "box-disk2.vmdk" --format vmdk

=> Virtualボックスのストレージで新規作成したvmdkを指定する
(動作の確認ができたら古いvmdkとcloneしたvdiは削除が良い)

3
4
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
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?