-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hyper-V provider #119
Open
tsmolka
wants to merge
3
commits into
boxcutter:main
Choose a base branch
from
tsmolka:patch-1
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+95
−0
Open
Hyper-V provider #119
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Ubuntu preseed file - preseed.cfg | ||
# Works for Ubuntu 10.x, 11.x & 12.x | ||
# | ||
# For more information on preseed syntax and commands, refer to: | ||
# https://help.ubuntu.com/12.04/installation-guide/i386/appendix-preseed.html | ||
# | ||
# For testing, you can fire up a local http server temporary. | ||
# Download the preseed.cfg file locally, cd to the directory where the | ||
# preseed.cfg resides and run hte following command: | ||
# $ python -m SimpleHTTPServer | ||
# You don't have to restart the server every time you make changes. Python | ||
# will reload the file from disk every time there is a request. As long as you | ||
# save your changes they will be reflected in the next HTTP download. Then to | ||
# test with a PXE boot server, use the following kernel boot parameters: | ||
# > linux auto url=http://<your_ip>:8000/preseed.cfg hostname=<hostname> locale=en_US keyboard-configuration/modelcode=SKIP | ||
# | ||
# NOTE: If you netboot/PXE boot Ubuntu, it will ignore the value in hostname, | ||
# but you must provide a hostname as a boot parameter to prevent the Ubuntu | ||
# install from prompting for a hostname | ||
|
||
choose-mirror-bin mirror/http/proxy string | ||
d-i base-installer/kernel/override-image string linux-server | ||
d-i clock-setup/utc boolean true | ||
d-i clock-setup/utc-auto boolean true | ||
d-i finish-install/reboot_in_progress note | ||
d-i grub-installer/only_debian boolean true | ||
d-i grub-installer/with_other_os boolean true | ||
d-i partman-auto-lvm/guided_size string max | ||
d-i partman-auto/choose_recipe select atomic | ||
d-i partman-auto/method string lvm | ||
d-i partman-lvm/confirm boolean true | ||
d-i partman-lvm/confirm_nooverwrite boolean true | ||
d-i partman-lvm/device_remove_lvm boolean true | ||
d-i partman/choose_partition select finish | ||
d-i partman/confirm boolean true | ||
d-i partman/confirm_nooverwrite boolean true | ||
d-i partman/confirm_write_new_label boolean true | ||
d-i user-setup/allow-password-weak boolean true | ||
d-i user-setup/encrypt-home boolean false | ||
|
||
#d-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms | ||
d-i pkgsel/include string openssh-server ntp curl nfs-common linux-headers-$(uname -r) build-essential perl dkms linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) | ||
d-i pkgsel/install-language-support boolean false | ||
# Policy for applying updates. May be "none" (no automatic updates), | ||
# "unattended-upgrades" (install security updates automatically), or | ||
# "landscape" (manage system with Landscape). | ||
d-i pkgsel/update-policy select none | ||
d-i pkgsel/upgrade select full-upgrade | ||
d-i time/zone string UTC | ||
tasksel tasksel/first multiselect standard, server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm trying your pull request with a cherry-pick to update to 16.04.3 ISO URL's (could you please rebase your PR?).
It seems that Packer has some problems with the boot_command. The last key strokes show some errors and I only get
initrd=/installngz
I had this several times. After manually fixing the string to
initrd=/install/initrd.gz --
and pressing ENTER the Packer build seems to work. I remember that other providers also had timing issues typing long boot commands.My setup is an Azure VM running Windows Server 2016 with Packer 1.0.4.
One other thing to mention. We have to quote the file name for the
-var-file
option. Otherwise PowerShell ignores the.json
extension. So my command to run your PR was:The Azure VM was created using a Terraform template: https://github.com/StefanScherer/packer-windows/tree/my/hyperv/terraform
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Stefan, I have just merged my branch with master to upgrade to 16.04.3 ISO (no issue there). I can reproduce issues with
boot_command
you are mentioning on Azure VM as well. On physical machine this works as expected.I have quickly tested
"generation": "2"
VM whereboot_command
seems to be more reliable. Since floppy is not supported I had to usepreseed/url
.When testing, you will probably need to:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. In the meantime I've opened hashicorp/packer#5291 and it seems a bug in Packer. I went through the sources, but couldn't find the right place. It seems the hyperv builder uses some PowerShell code where the delay between each key stroke should be added.
My Azure VM has the DHCP feature installed and running, so this shouldn't be a problem. And yes, packer.exe should have a firewall exception as for other providers as well.
I will try your latest commit tomorrow.