The boot configuration is very important: `boot_command` specifies the keys to type when the virtual machine is first booted in order to start the OS installer. This command is typed after boot_wait, which gives the virtual machine some time to actually load. The boot_command is an array of strings. The strings are all typed in sequence. It is an array only to improve readability within the template. There are a set of special keys available. If these are in your boot command, they will be replaced by the proper key: - `` - Backspace - `` - Delete - ` ` - Simulates an actual "enter" or "return" keypress. - `` - Simulates pressing the escape key. - `` - Simulates pressing the tab key. - ` - ` - Simulates pressing a function key. - ` ` - Simulates pressing an arrow key. - `` - Simulates pressing the spacebar. - `` - Simulates pressing the insert key. - ` ` - Simulates pressing the home and end keys. - ` ` - Simulates pressing the page up and page down keys. - `` - Simulates pressing the Menu key. - ` ` - Simulates pressing the alt key. - ` ` - Simulates pressing the ctrl key. - ` ` - Simulates pressing the shift key. - ` ` - Simulates pressing the ⌘ or Windows key. - ` ` - Adds a 1, 5 or 10 second pause before sending any additional keys. This is useful if you have to generally wait for the UI to update before typing more. - `` - Add an arbitrary pause before sending any additional keys. The format of `XX` is a sequence of positive decimal numbers, each with optional fraction and a unit suffix, such as `300ms`, `1.5h` or `2h45m`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. For example `` or ``. - ` ` - Any printable keyboard character, and of these "special" expressions, with the exception of the `` types, can also be toggled on or off. For example, to simulate ctrl+c, use `c`. Be sure to release them, otherwise they will be held down until the machine reboots. To hold the `c` key down, you would use ``. Likewise, `` to release. - `{{ .HTTPIP }} {{ .HTTPPort }}` - The IP and port, respectively of an HTTP server that is started serving the directory specified by the `http_directory` configuration parameter. If `http_directory` isn't specified, these will be blank! - `{{ .Name }}` - The name of the VM. Example boot command. This is actually a working boot command used to start an CentOS 6.4 installer: In JSON: ```json "boot_command": [ "", " ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg" ] ``` In HCL2: ```hcl boot_command = [ "", " ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/centos6-ks.cfg" ] ``` The example shown below is a working boot command used to start an Ubuntu 12.04 installer: In JSON: ```json "boot_command": [ "", "/install/vmlinuz noapic ", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", "hostname={{ .Name }} ", "fb=false debconf/frontend=noninteractive ", "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", "keyboard-configuration/variant=USA console-setup/ask_detect=false ", "initrd=/install/initrd.gz -- " ] ``` In HCL2: ```hcl boot_command = [ "", "/install/vmlinuz noapic ", "preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ", "debian-installer=en_US auto locale=en_US kbd-chooser/method=us ", "hostname={{ .Name }} ", "fb=false debconf/frontend=noninteractive ", "keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ", "keyboard-configuration/variant=USA console-setup/ask_detect=false ", "initrd=/install/initrd.gz -- " ] ``` For more examples of various boot commands, see the sample projects from our [community templates page](/community-tools#templates).