Windows Provisioning made Easy!

Hi

I love the idea of this. Can you advise what the ISC DHCP config should look like for a Win 2016 host? I have:

host win2016test {
hardware ethernet 00:1a:4a:34:fe:a5;
fixed-address 192.168.96.31;
option host-name “win2016test”;
next-server sat6.local;
}

Using Satellite 6.6… I’m also missing a bunch of templates. Could you advise where I could find missing templates such as Windows default iPXE, Windows peSetup.cmd and the Windows partition table?

Thanks!

Hi there!
@UXabre Thank you for your tutorial, it’s really helpful!
i have some question.
There is tagging traffic on a NIC. I use native vlan to deploying OS.
One more VLAN should be set up on this NIC. Is it possible for Windows?
I’ve added necessary networks in foreman and settings os host.

Hi @Andrey,
VLAN tagging is possible only on windows servers (and some very limited NICs offer support for it as well in the non-server editions but that’s something you’ll have to look into).
Now, on that subject, these scripts are not adapted for that use-case unfortunately; but feel free to share any adjustment to the templates (and more specifically, the network templates) to the community.

Kind regards,
Arend

2 Likes

:+1:
This wasn’t in the latest, found this thread by luck.

if you are booting UEFI with iPXE and the WinPE complains that it can’t find the peSetup.cmd the note that under UEFI iPXE uses different syntax to name the downloaded files:

initrd --name peSetup.cmd <%= foreman_url(‘script’) %>
initrd --name BCD ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bcd) %>
initrd --name boot.sdi ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootsdi) %>
initrd --name boot.wim ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootwim) %>

1 Like

Hi, i ran in to this problem and im not quite sure what i did wrong here…
May somebody help me please? :sweat_smile:

Kind regards,
Nathaniel

Hi Nathaniel,

From what I can tell, you are already using iPXE so the iPXE chainload part can be omitted in your case and just load the regular pxelinux bootloader instead. The error is because the tftp server is not able to muster up the ipxe.lkrn file (which is part of the ipxe-bootimgs package).

The reason why we use the iPXE chainloader is because that one has support for HTTP loading, which we need to download the installation script (peSetup.cmd) into the image.

Let me know how that went :slight_smile:

1 Like

Hi,
i tried what you said and now im at the same point as @odhub already was. My version is 6.04-5 so it should work right? Im kinda confused :sweat_smile:

CLI

Hi @ndonahue,

So, these are the files that I have copied to the /var/lib/tftpboot folder. (Sorry for the long list but I’m trying to shotgun us a way to a solution :stuck_out_tongue: )

  • /usr/share/ipxe/ipxe.lkrn
  • /usr/share/syslinux/chain.c32
  • /usr/share/syslinux/ldlinux.c32
  • /usr/share/syslinux/menu.c32
  • /usr/share/syslinux/libcom32.c32
  • /usr/share/syslinux/libutil.c32
  • /usr/share/syslinux/linux.c32
  • /usr/share/syslinux/pxelinux.0
  • /usr/share/syslinux/vesamenu.c32

You could copy the linux.c32 file and take it from here (I think I have all these files for a reason though…although is has been ages since I worked on this so might be there are too many files; at least you know have the locations where you should be able to find them).

1 Like

Small update: I encountered a problem when installing windows with ipxe.resouce exceeds length of file
could not boot :Error 0x7048281

I can only confirm that I have the same issue. I see that the ‘…patching WIM dir.file peSetup.cmd’ message is missing compared to the BIOS boot. iPXE downloads the file correctly from the server, so that’s not the issue. It just seems that BOOTX64.EFI is completely ignoring the file.

did you ever figure this out?
i’m stuck at the exact same thing.
tftp:///
what is weird is that PXE doesnt have this problem, it can pull ipxe.lkrn from tftp (via DHCP option), but iPXE seems to ignore it

this error is typical for not enough memory
i’ve seen that with linux PXE. try with 4GB

i was never able to fix this issue, so I looked up in which provision template the code was (it was windows default iPXE), then cloned the template and modified the script to hardcode my IP instead of the ${next-server},publish the template for my location and org. Change the template used in windows to the new one
yes - hardcoding is not nice, but DHCP next-server option didnt seem to be the issue as it worked fine for PXE (before chaining)

1 Like

I’m really missing the mark here. My Windows Deployments are working great. Everything from booting iPXE, partioning, pushing the image with DISM… EXCEPT for my finish scripts. I really need my domain join powershell script to run at the end - can’t figure out why it’s not executing.

I’ve tried calling it as a snippet and just putting it raw into a script template as well. I can’t see any sign of it running once the I get past the first boot. I know it works because pasting into powershell and running it gets the system on the domain. Any ideas?

1 Like

Replying to my former self:
If I had read Windows Provisioning made Easy! - #89 by ottal99 thoroughly last year I would already have been able to boot both UEFI and BIOS systems, but Filename requirements should be documented · Issue #11 · ipxe/wimboot · GitHub opened my eyes. The current Windows iPXE template provided by Foreman is not working for UEFI systems, and needs to be altered. This works correctly for both BIOS and UEFI:

initrd --name peSetup.cmd <%= foreman_url('script') %> peSetup.cmd

initrd --name BCD ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bcd) %> BCD
initrd --name boot.sdi ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootsdi) %> boot.sdi
initrd --name boot.wim ${boot-url}<%= @host.operatingsystem.bootfile(medium_provider,:bootwim) %> boot.wim

If I find the time I will open an issue in the foreman-project for this, as this should work out-of-the-box IMHO.

2 Likes

If you call your code as a finish script it is a .bat file so the first command will open powershell and all other commands will fails since they are not known with cmd.
You can test this by logging onto a finished host and running the foreman-finish.bat manually in C:\deploy\ .

If you want to execute a command in powershell you will need to use.
powershell.exe -command “insert command here”

For domain join you could also use the below cmd command to accomplish the same thing.
netdom join %computername% /domain:example.com /userd:example\user /passwordd:password

1 Like

Curious to know if anybody has tried this with Windows 11? Since I think it would require Secureboot enabled?

me too.

looking to prepare for the eventual EOL of win 10

I’ve finally with the help from this page got efi provisioning with windows - using foreman 3.9.1.

I am stumped as to the windows_default_user_data template as it looks like it creates a sysprep file not a powershell command. I don’t see how it can possibly work as a ps1 file, it just errors out on the first line of a yaml file