I'm a seasoned Cloud Infrastructure Architect with a proven track record of 10+ years of production experience in AWS, more than 15 years of industry experience. Expert in Terraform & Containerization.
I am now
Windows Imaging Toolkit
I'm a seasoned Cloud Infrastructure Architect with a proven track record of 10+ years of production experience in AWS, more than 15 years of industry experience. Expert in Terraform & Containerization.
I am now
The setting for hiding windows passwords in the unattend seems to cause rendering errors with some hosts:
I had the same issue mentioned earlier (issue #31 ), where i copied the "tell foreman" part to the instal script, which seems to have updated the tftp file to boot from disk on the foreman server, rather than keep getting stuck in the PXE/reimaging loop. However, when the VM boots again to book from from local disk, it ends up at the "Recovery Screen" for windows. I'm not sure if this is due to me not copying the "tell foreman" part correctly, or some other driver issue.
first kudos to you for this project.
I plan on modifying this to do a few things
I only really focus on 2012 deployments, so I have been trying to get everything into an image offline, without using a hyperv to instantiate and recapture.
Hi,
https://github.com/kireevco/wimaging/blob/master/tools/install.root/wimaging/_config.cmd.sample
domain, user and password - what are these for here? If I'm building a generic dedicated server for a customer (without puppet), what should be in here?
Thanks
Do we really need to define %deploymentShare%
in the init scripts?
You do this:
ping -n 1 %deploymentShare% > NUL
and then
echo Downloading Setup Script %deployRoot%\wget.vbs http://%foremanHost%/unattended/script %deployRoot%\peSetup.cmd
I'd rather check the network availability by pinging the %foremanHost%
and move all the logic responsible for mounting/interacting with the %deploymentShare%
to foreman script.
This would help in situations where there are multiple locations or networks in our deployment that require %deploymentShare%
to differ slightly.
Let me know what you think and I will work on this.
Hi,
Is there any issue with current build I am not able to see token getting generated for built option.
Token generated for finish, provision and user_data
No token generated for built.
Below is the trace of prxoy.log
D, [2016-07-20T12:47:18.395768 #2618] DEBUG -- : Retrieving a template from http://sdin-swt-ct-04.sdcorp.global.com:8000//unattended/built?token=527dc2a4-ad34-4821-bdb1-b73f3f348498&url=http%3A%2F%2Fsdin-swt-ct-04.sdcorp.global.com%3A8000
D, [2016-07-20T12:47:18.395998 #2618] DEBUG -- : HTTP headers: {"X-Forwarded-For"=>"10.65.225.158, sdin-swt-ct-04.sdcorp.global.com", "ACCEPT_LANGUAGE"=>"en-US,en;q=0.8", "UPGRADE_INSECURE_REQUESTS"=>"1", "CONNECTION"=>"keep-alive", "ACCEPT_ENCODING"=>"gzip, deflate, sdch", "CACHE_CONTROL"=>"max-age=0", "USER_AGENT"=>"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", "ACCEPT"=>"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8"}
E, [2016-07-20T12:47:18.482038 #2618] ERROR -- : Failed to retrieve built template for {"token"=>"527dc2a4-ad34-4821-bdb1-b73f3f348498", "kind"=>"built"}: Error retrieving built for {"token"=>"527dc2a4-ad34-4821-bdb1-b73f3f348498", :url=>"http://sdin-swt-ct-04.sdcorp.global.com:8000"} from sdin-swt-ct-04.sdcorp.global.com: Net::HTTPInternalServerError
D, [2016-07-20T12:47:18.482130 #2618] DEBUG -- : Error retrieving built for {"token"=>"527dc2a4-ad34-4821-bdb1-b73f3f348498", :url=>"http://sdin-swt-ct-04.sdcorp.global.com:8000"} from sdin-swt-ct-04.sdcorp.global.com: Net::HTTPInternalServerError (RuntimeError)
/usr/share/foreman-proxy/modules/templates/template_proxy_request.rb:24:in get_template' /usr/share/foreman-proxy/modules/templates/templates_api.rb:19:in
GET /:kind'
/usr/share/foreman-proxy/lib/proxy/helpers.rb:14:in log_halt' /usr/share/foreman-proxy/modules/templates/templates_api.rb:18:in
GET /:kind'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:in call' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:863:in
route'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:in instance_eval' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:521:in
route_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:500:in route!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:in
catch'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:497:in route!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:in
each'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:476:in route!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:601:in
dispatch!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:in call!' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
instance_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in invoke' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in
catch'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:566:in invoke' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:411:in
call!'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:399:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/commonlogger.rb:18:in
call'
/usr/share/foreman-proxy/lib/proxy/log.rb:60:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/showexceptions.rb:24:in
call'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:979:in call' /usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:1005:in
synchronize'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:979:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:47:in
call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in each' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/urlmap.rb:41:in
call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/builder.rb:77:in call' /usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/content_length.rb:13:in
call'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/handler/webrick.rb:48:in service' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in
service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in run' /usr/lib/ruby/1.8/webrick/server.rb:173:in
start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in start' /usr/lib/ruby/1.8/webrick/server.rb:162:in
start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in start' /usr/lib/ruby/1.8/webrick/server.rb:92:in
each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in start' /usr/lib/ruby/1.8/webrick/server.rb:23:in
start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in start' /usr/share/foreman-proxy/lib/launcher.rb:137:in
launch'
/usr/share/foreman-proxy/lib/launcher.rb:137:in initialize' /usr/share/foreman-proxy/lib/launcher.rb:137:in
new'
/usr/share/foreman-proxy/lib/launcher.rb:137:in `launch'
/usr/share/foreman-proxy/bin/smart-proxy:6
I, [2016-07-20T12:47:18.482402 #2618] INFO -- : 10.65.225.158 - - [20/Jul/2016 12:47:18] "GET /built?token=527dc2a4-ad34-4821-bdb1-b73f3f348498 HTTP/1.1" 500 320 0.0879
Finish Provision Template
@echo off
echo Activating administrator
net user administrator /active:yes
echo "10.65.168.18 sdin-swt-ct-04.sdcorp.global.com" > C:\Windows\System32\drivers\etc\hosts
set ctr=0
set nettimeout=10
set nwhost=sdin-swt-ct-04.sdcorp.global.com
(echo Updating time)
(sc config w32time start= auto)
sc start w32time
:ntp_testip
::ipconfig /renew
ping -n 1 %nwhost% > NUL
if %errorlevel% == 0 goto ntp_testip_ok
timeout /t 10 >NUL
set /a ctr=ctr+1
echo Retry network. Run %ctr% time(s)
if %ctr% GTR %nettimeout% (
echo Network error! Exiting.
exit 1
)
goto ntp_testip
:ntp_testip_ok
echo Ping to %nwhost% OK!
echo sync time
w32tm /resync
w32tm /resync
:: You can join your machine to the domain right here >
:: < You can join your machine to the domain right here
echo safely remove files
sdelete.exe -accepteula -p 2 -r c:\wimaging
sdelete.exe -accepteula -p 2 c:\Windows\Panther\unattend.xml
sdelete.exe -accepteula -p 2 C:\Windows\Setup\Scripts\SetupComplete.cmd
sdelete.exe -accepteula -p 2 -r c:\minint
sdelete.exe -accepteula -p 2 -r c:\wimaging
echo Running extra commands
@echo off
echo Installing puppet
start /w "" msiexec /qn /i C:\extras\puppet.msi PUPPET_AGENT_STARTUP_MODE=Manual PUPPET_MASTER_SERVER="sdin-swt-ct-04.sdcorp.global.com"
echo set puppet to auto start
sc config puppet start= auto
sc query puppet
echo cleaning up extras
sdelete.exe -accepteula -p 2 -r c:\extras
echo Tell foreman build mode has finished
wget.exe http://sdin-swt-ct-04.sdcorp.global.com:8000/unattended/built?token=527dc2a4-ad34-4821-bdb1-b73f3f348498
sdelete.exe -accepteula -p 2 -r c:\deploy
echo remove leftover directories
rmdir /s /q c:\wimaging
rmdir /s /q c:\minint
rmdir /s /q c:\deploy
rmdir /s /q c:\extras
echo rebooting...
shutdown /r /t 5
Let me know if you need more information.
Thanks
-Vishal Sarin
Hi,
I'm having the same problem as issue #28
I'm running foreman 1.10 on CentOS 7.
Test pxe client is on a VirtualBox VM with 8GB of ram and a hard disk VMDK with 250GB.
I was getting the "Kernel load failure (insufficient memory?)" error when using linux.c32 from syslinux4.05 that can be installed from the CentOS7 repos so I tried what @ishtartec mentioned on issue #28 and downloaded syslinux5.10 from:
https://www.kernel.org/pub/linux/utils/boot/syslinux/5.xx/
and used the linux.c32 file there with foreman tftp, but now I get an error that says "linux.c32: not a COM32R image".
Does anyone know what I could be missing?
Thanks.
Environment: Foreman, VMWare and trying to build windows 2016 VMs using foreman.
Getting stuck in the wimboot process. The VM pxe boots, then downloads wimboot but then fails on boot.sdi and boot.wim.
Is there a good documentation or suggestion to make the pxeboot work with wimboot to provision windows VMs?
Regards,
Rangaa
Hi Dmirty,
I need to add support for windows7, which I nearly got working on my end, but before I start submitting changes, a question to you is - do you have any preference as to what the $os variable should be?
You use $os = "server-2008r2" as an example.
During the TFTP PXE config generation foreman is trying to download 2 files:
startrom.0 and boot.sdi however they dont seem to be copied by any script?
http://deployhost/install/server-2012r2x64.standard/images/startrom.0
then renamed boot/windows-6.3-x64-startrom.0
http://deployhost/install/server-2012r2x64.standard/images/boot.sdi
then renamed boot/windows-6.3-x64-boot.sdi
Did I miss something?
Thanks
This caused a couple of hours of grief but thankfully I've sorted it.
Functions.ps1, Line 221 reads:
Invoke-Expression "& 'dism' /mount-wim /wimfile:$wim_file /mountdir:$mount_dir /name:'$wim_image_name'"
It should read:
Invoke-Expression "& '$dism' /mount-wim /wimfile:$wim_file /mountdir:$mount_dir /name:'$wim_image_name'"
Hi,
the issue is not with the template itself but with the PXE netboot:
Currently using foreman 1.9 and Ubuntu 14
DEFAULT menu
LABEL menu
COM32 linux.c32 boot/wimboot
APPEND initrdfile=boot/windows-x64/bcd,boot/windows-x64/boot.sdi,boot/windows-x64/boot.wim
The netboot ends with Kernel load failure (insufficient memory?)
DEFAULT menu
LABEL menu
COM32 linux.c32
APPEND boot/wimboot initrdfile=boot/windows-x64/bcd,boot/windows-x64/boot.sdi,boot/windows-x64/boot.wim
This goes a bit better but errors in:
wimboot v2.5.1 -- Windows Imaging Format bootloader -- http://ipxe.org/wimboot
Command line: "BOOT_IMAGE=boot/wimboot initrdfile=boot/windows-x64/bcd,boot/windows-x64/boot.sdi,boot/windows-x64/boot.wim"
Emulating drive 0x81
FATAL: no bootmgr.exe
Press any key to reboot...
Any ideas?
Thanks for the great job!
At first I would like to thank you for the work you have invested in this project.
I'm testing wimaging to deploy win7 ATM and wimaging_script_winpe_setup is finishing without errors but then a reboot occurs and, since we did not notify foreman that we have successfully installed the os, the machine is retrieving the images once again, resulting in a bootloop. So I moved the notify foreman part from the finishing scipt to the setup script, but then the finish script cannot run without error since its not allowed to download the provision script (error 405).Such a severe flaw cannot have been overlooked by you so I am wondering if I misconfigured anything?
Again thank you for your help..
So I have been working on several types of Windows installations with Foreman and I could not figure out what was causing the dism error when installing Windows 7. After changing the default pesetup file so i could check out what was going wrong I found that the dism command to apply the image does not work with Windows 7.
To get this to work you need the imagex tool which can be found in WAIK for windows 7. I solved this by adding the imagex files to the extras directory on my repo. I changed the pesetup.cmd to download the extras directory before applying the image and than use the imagex tool to actually apply the image. I think editing the current pesetup.cmd to somthing like shown below would help. In addition to that some instruction could be made to notify people about the imagex requirement.
<% if @host.operatingsystem.minor.to_i > 1 -%> (windows nt version of windows 7 is 6.1 )
dism.exe /apply-image /ImageFile:C:\install.wim /Index:1 /ApplyDir:C:
<% else -%>
C:\Extras\imagex.exe /apply C:\install.wim 1 C:
<% end %>
Like I said i used the extras directory to add the imagex executable during the installation. There might be a more elegant way to do this for example by adding an other directory. If you want the dirty way :-) just put this after the wget that retrieves the install.wim.
echo Downloading extras
md C:\Extras
%WGET% -P c:\Extras -r -np -nH --cut-dirs=3 -R index.html -q --level=0 <%= @host.os.medium_uri(@host).to_s %>/extras/
I don't mind helping with adding this to the current code, but i'm kinda a nub at git(hub) so I don't want to mess things up.
And thanks for the scripts kireevco made everything a whole lot easier! :-)
Hello @kireevco ,
Do you plan to have the tool ready for 2012 server in a near futur?
Thanks,
Matthieu
Hello,
I am having a problem with WinPE that keeps trying to look for an /unattended/script file but it doesn't find it.
The templates WAIK peSetup, WAIK provision unattended.xml, WAIK PXE Linux, WAIK finish, WAIK local users, WAIK extra finish commands all came from this the git master wimaging. They all render without any issue reporting but for some reason it always craps out at the "Downloading Setup Script"
WinPE loads correctly, starts Networking, then it complains the subsystem needed to support the image type is not present. Then "ping to puppet.domain.com OK! Your IP Address. And then it errors out at the "Downloading Setup Script"
Can anybody help out? Also can anybody explain what part of the template is not working? Would I be correct to assume that the template that is not working is the WAIK peSetup and if so, that link" http://puppet.domain.com/unattended/script:
Where is that in the code for the WAIK peSetup template? Please help.
Thank You
We have several static only vlans that we use Foreman bootdisk and ipxe for on Linux.
Have you guys ever done anything like this for Windows? Is there a way to make ipxe work with wimaging or wimboot? Do you know of an alternative for Foreman?
are support added for new server releases ? e.g windows server 2019 ?
I am trying to figure out how the PXE template is working. So far, only hard coding the boot files works for me. Maybe you can help me with some insight.
Shouldn't the template download the files required from installation media? If so, can this work by using the ps - scripts; the boot wim is not pushed to right folder?
Warning!
There was an error rendering the WAIK default PXELinux template: undefined method 'arch' for Host::Managed::Jail (Host::Managed)
Replacing arch
with some other host marco @host.architecture
I got form here does no good either:
PXELinux template: undefined method 'bootfile' for Operatingsystem
Btw, I am running foreman 1.9.1
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.