-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add Packer template for Windows XP #266
base: master
Are you sure you want to change the base?
Conversation
Wow. What is the use case for that? I mean, other than collecting packer templates ;-) When I started with Packer years ago I also thought about Win XP, but never found a way to do this. Instead of using wget, what about some built-in tools (maybe bitsadmin.exe, or other things described eg. in https://stackoverflow.com/questions/4619088/windows-batch-file-file-download-from-a-url) |
😨 |
Let's say i'm an archaeologist :)
The thing is that there is no I tried many things to download files natively, even VBscript: ' Set your settings
strFileURL = "https://download.microsoft.com/download/0/8/c/08c19fa4-4c4f-4ffb-9d6c-150906578c9e/NetFx20SP1_x86.exe"
strHDLocation = "c:\temp\dotnet.exe"
' Fetch the file
Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
objXMLHTTP.open "GET", strFileURL, false
objXMLHTTP.send()
If objXMLHTTP.Status = 200 Then
Set objADOStream = CreateObject("ADODB.Stream")
objADOStream.Open
objADOStream.Type = 1 'adTypeBinary
objADOStream.Write objXMLHTTP.ResponseBody
objADOStream.Position = 0 'Set the stream position to the start
Set objFSO = Createobject("Scripting.FileSystemObject")
If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
Set objFSO = Nothing
objADOStream.SaveToFile strHDLocation
objADOStream.Close
Set objADOStream = Nothing
End if
Set objXMLHTTP = Nothing
End if But it always failed. But if you can figure out how to use this |
Seems like it's possible ! |
I just looked into my MSDN downloads and found some XP downloads with type "CDR" - I had to think what this could be. Wow, we were able install operating systems from CD-ROM 😆 |
I gave it some minutes and added the vmware-iso section. But my problem is that I don't see a network card in the VM. VMware Fusion tells me that the e1000 network card is present. |
When i tested with Qemu, i had internet access after the installation. Is it not the case for you on vmware ? |
I made some progress since last time. This has been solved by disabling the Now WinRM is opened, but misconfigured. Any ideas ? |
Wow! |
hi @StefanScherer , I tested my winrm setup script on a dedicated VM, and attempted a connection with PyWinRM: so this winrm script is not working only in the context of packer. |
This PR is fantastic! @sneal can you summon the WinRM gods? |
@joefitzgerald i actually found the issue. It turns out that the Therefore the WinRM error is totally correct ! Right now i'm trying to tweak the autounattend file to setup an admin |
I have my first successful build of this packer template on QEMU ! 🎉 Looking at this forum, it seems that setting the user accounts are the responsability of another file
So let's not go too complicated for this PR. TODO:
|
Thanks @Wenzel for all the hard work. I'll try to find some time to test again with vmware-iso soon. The product key from MSDN shouldn't be added. What we need in general would be this hashicorp/packer#4530 to be able to insert variables into static floppy files. That would help all Windows Packer templates. |
@StefanScherer, from what I can tell from folks who have worked with Packer before, like in mwrock/packer-templates, the pattern to use to prep files is to use some external tool to template the files before a run and then run your packer command. For example, if you want to parameterize an autounattend.xml file you would put some unique string in the file as a parameter, "{{ user |
@StefanScherer I removed the product key from (Sorry i forgot that it was still opened :) ) |
This is an attempt to create a Packer template for Windows XP, and open WinRM for provisioners.
Work in Progress
WinRM requires DotNet 2.0.
I had to add wget in the floppy to download the necessary files after the initial installation is done.
At this point, WinRM is installed and I'm calling a
setup_winrm.bat
script to open it, but somehow Packer cannot connect to it :/If anyone is interest and can give me some help, i would appreciate !
Thanks.