Enhancement Request: Specify Hyper-V Boot Order
- Dominant language
- Ruby
- Stars
- 27.2k
- Forks
- 4.4k
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
Vagrant's Boot Order when using a Hyper-V image puts the Network Adapter before the Hard Drive like so:

This results in slower boot times during `vagrant up` as the PXE Boot Process must time out before continuing.
**Describe the solution you'd like**
It would be nice to be able to configure these settings in the vagrantfile, but looking at the documentation there does not appear to be a way to do so.
This could be done via `Set-VMFirmware` https://docs.microsoft.com/en-us/powershell/module/hyper-v/set-vmfirmware?view=win10-ps
**Describe alternatives you've considered**
For right now after `vagrant up` runs I am manually changing the boot settings, however it would be better to have this in the configuration file.
**Additional context**
Could this be an authoring error when the box was created in packer? I tried having my packer file look like the following, but that does not appear to affect it when it finally flows into vagrant:
```
{
"builders": [
{
"boot_command": [
"a"
],
"boot_order": [
"DVD",
"SCSI:0:0"
],
"boot_wait": "2s",
"cd_files": [
"cdfiles/*"
],
"communicator": "winrm",
"cpus": 2,
"disk_size": "40960",
"generation": "2",
"first_boot_device": "DVD",
"headless": true,
"iso_checksum": "md5:5d1ec50e50a76aa9f0ef13f92272d283",
"iso_url": "en_windows_server_2012_r2_x64_with_updates_from_20210126.iso",
"memory": 2048,
"shutdown_command": "shutdown /s /t 10 /f /d p:4:1 /c \"Packer Shutdown\"",
"shutdown_timeout": "15m",
"switch_name": "Default Switch",
"type": "hyperv-iso",
"winrm_password": "vagrant",
"winrm_port": "5985",
"winrm_timeout": "240m",
"winrm_username": "vagrant"
}
],
"post-processors": [
{
"output": "windows-2012r2-hyperv.box",
"type": "vagrant",
"vagrantfile_template": "vagrantfile.template"
}
]
}
```
Contributor guide
Research direction
Start with the Vagrantfile configuration and the Hyper-V Set-VMFirmware reference, then compare the requested boot-order settings with the supplied Packer hyperv-iso configuration. Done means Hyper-V boot order can be configured for Vagrant-managed machines so the PXE timeout is avoided during vagrant up.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, ruby
- Domain
- devops, infrastructure
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100