vagrant/website/docs/source/v2/vagrantfile/machine_settings.html.md

2.7 KiB

sidebar_current
vagrantfile-machine

Machine Settings

Config namespace: config.vm

The settings within config.vm modify the configuration of the machine that Vagrant manages.

Available Settings

config.vm.box - This configures what box the machine will be brought up against. The value here should match one of the installed boxes on the system.


config.vm.box_url - The URL that the configured box can be found at. If the box is not installed on the system, it will be retrieved from this URL when vagrant up is run.


config.vm.graceful_halt_retry_count - The number of times to retry gracefully shutting down the system when vagrant halt is called. Defaults to 3.


config.vm.graceful_halt_retry_interval - The amount of time in between each retry of attempting to shut down, in seconds. Defaults to 1 second.


config.vm.guest - The guest OS that will be running within this machine. This defaults to :linux, and Vagrant will auto-detect the proper distro. Vagrant needs to know this information to perform some guest OS-specific things such as mounting folders and configuring networks.


config.vm.hostname - The hostname the machine should have. Defaults to nil. If nil, Vagrant won't manage the hostname. If set to a string, the hostname will be set on boot.


config.vm.network - Configures networks on the machine. Please see the networking page for more information.


config.vm.provider - Configures provider-specific configuration, which is used to modify settings which are specific to a certain provider. If the provider you're configuring doesn't exist or is not setup on the system of the person who runs vagrant up, Vagrant will ignore this configuration block. This allows a Vagrantfile that is configured for many providers to be shared among a group of people who may not have all the same providers installed.


config.vm.provision - Configures provisioners on the machine, so that software can be automatically installed and configured when the machine is created. Please see the page on provisioners for more information on how this setting works.


config.vm.synced_folder - Configures synced folders on the machine, so that folders on your host machine can be synced to and from the guest machine. Please see the page on synced folders for more information on how this setting works.


config.vm.usable_port_range - A range of ports Vagrant can use for handling port collisions and such. Defaults to 2200..2250.