takafumi blog


【Vagrant】 独自のboxを作成する

環境  Vagrant 1.8.1 VirtualBox 5.0.12



PS> vagrant package --base VMName --output Custom.box
==> VMName: Attempting graceful shutdown of VM...
    VMName: Guest communication could not be established! This is usually because
    VMName: SSH is not running, the authenticationinformation was changed,
    VMName: or some other networking issue. Vagrant will force halt, if
    VMName: capable.
==> VMName: Forcing shutdown of VM...
==> VMName: Clearing any previously set forwarded p
==> VMName: Exporting VM...
==> VMName: Compressing package to: Custom.box

--output は新しいboxの名前


Vagrant:package作成時「VM not created. Moving on…」をエラーが出たら | ログってなんぼ



PS> vagrant box add NewBox Custom.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'NewBox' (v0) for provider:
    box: Unpacking necessary files from: file://Custom.box
    box: Progress: 100% (Rate: 461M/s, Estimated time remaining: --:--:--)
==> box: Successfully added box 'NewBox' (v0) for 'virtualbox'!

PS> vagrant box list
NewBox           (virtualbox, 0)
bento/centos-7.1 (virtualbox, 2.2.2)