How do I create a pipable image

Comments, questions, bug reports, etc.
Post Reply
mojomatt
Posts: 3
Joined: Mon Feb 12, 2018 8:17 pm

How do I create a pipable image

Post by mojomatt »

Hi, I'm unable to create a functioning pipable Windows Server 2016 image using the below process. Can anyone help me figure out what's going wrong. Ultimately I'm trying to apply a Windows image by piping it from the WGET utility into Wimlib. Thanks

Wimlib version = 1.12.0

Process...
Start with the original INSTALL.WIM file from the Microsoft 2016 server cd.
Use this command to create the pipable image... wimoptimize install.wim --pipable
This supposedly creates a pipable image which I then place on my web server.
I then boot a client into WinPE and use this command in an attempt to apply it...
wget -O - http://<my web server address>/install.wim | wimapply - 1 c:\

The error message I get is as follows...


X:\Windows\System32>z:\wget\bin\wget -O - http://<Address of web server>/install.wim | z:\Wimlib\x86\wimapply - 1 c:\
SYSTEM_WGETRC = c:/progra~1/wget/etc/wgetrc
syswgetrc = z:\wget/etc/wgetrc
--2018-02-12 19:24:23-- http://<Address of web server>/install.wim
Connecting to <Address of web server>:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4827677501 (4.5G)
Saving to: `STDOUT'

[ERROR] Invalid chunk size in compressed resource! --.-K/s
ERROR: Exiting with error code 2:
The WIM contains invalid compressed data.
0% [ ] 0 --.-K/s in 0s


Cannot write to `-' (Broken pipe).



The .wim image info is as follows...


WIM Information:
----------------
Path: D:\xampp\htdocs\install.wim
GUID: 0x724ce906d1bef5439ca6d9456ddb3b2e
Version: 68864
Image Count: 4
Compression: LZX
Chunk Size: 32768 bytes
Part Number: 1/1
Boot Index: 0
Size: 4827655497 bytes
Attributes: Pipable, Integrity info, Relative path junction

Available Images:
-----------------
Index: 1
Name: Windows Server 2016 SERVERSTANDARDCORE
Description: Windows Server 2016 SERVERSTANDARDCORE
Display Name: Windows Server 2016 Standard
Display Description: This option (recommended) reduces management and servicing by installing only what is needed to run most server roles and applications. It does not include a GUI, but you can fully manage the server locally or remotely with Windows PowerShell or other tools. For more details see "Windows Server Installation Options."
Directory Count: 14181
File Count: 67403
Total Bytes: 9355319911
Hard Link Bytes: 3433875718
Creation Time: Mon Nov 21 09:42:26 2016 UTC
Last Modification Time: Mon Nov 21 09:42:53 2016 UTC
Architecture: x86_64
Product Name: Microsoft® Windows® Operating System
Edition ID: ServerStandard
Installation Type: Server Core
HAL: acpiapic
Product Type: ServerNT
Product Suite: Terminal Server
Languages: en-US
Default Language: en-US
System Root: WINDOWS
Major Version: 10
Minor Version: 0
Build: 14393
Service Pack Build: 0
Service Pack Level: 0
Flags: ServerStandardCore
WIMBoot compatible: no

Index: 2
Name: Windows Server 2016 SERVERSTANDARD
Description: Windows Server 2016 SERVERSTANDARD
Display Name: Windows Server 2016 Standard (Desktop Experience)
Display Description: This option is useful when a GUI is requiredfor example, to provide backward compatibility for an application that cannot be run on a Server Core installation. All server roles and features are supported. For more details see "Windows Server Installation Options."
Directory Count: 21602
File Count: 113681
Total Bytes: 15429024054
Hard Link Bytes: 6355334032
Creation Time: Mon Nov 21 09:49:55 2016 UTC
Last Modification Time: Mon Nov 21 09:50:26 2016 UTC
Architecture: x86_64
Product Name: Microsoft® Windows® Operating System
Edition ID: ServerStandard
Installation Type: Server
HAL: acpiapic
Product Type: ServerNT
Product Suite: Terminal Server
Languages: en-US
Default Language: en-US
System Root: WINDOWS
Major Version: 10
Minor Version: 0
Build: 14393
Service Pack Build: 0
Service Pack Level: 0
Flags: ServerStandard
WIMBoot compatible: no

Index: 3
Name: Windows Server 2016 SERVERDATACENTERCORE
Description: Windows Server 2016 SERVERDATACENTERCORE
Display Name: Windows Server 2016 Datacenter
Display Description: This option (recommended) reduces management and servicing by installing only what is needed to run most server roles and applications. It does not include a GUI, but you can fully manage the server locally or remotely with Windows PowerShell or other tools. For more details see "Windows Server Installation Options."
Directory Count: 14136
File Count: 67091
Total Bytes: 9351624885
Hard Link Bytes: 3433228342
Creation Time: Mon Nov 21 09:54:43 2016 UTC
Last Modification Time: Mon Nov 21 09:55:14 2016 UTC
Architecture: x86_64
Product Name: Microsoft® Windows® Operating System
Edition ID: ServerDatacenter
Installation Type: Server Core
HAL: acpiapic
Product Type: ServerNT
Product Suite: Terminal Server
Languages: en-US
Default Language: en-US
System Root: WINDOWS
Major Version: 10
Minor Version: 0
Build: 14393
Service Pack Build: 0
Service Pack Level: 0
Flags: ServerDataCenterCore
WIMBoot compatible: no

Index: 4
Name: Windows Server 2016 SERVERDATACENTER
Description: Windows Server 2016 SERVERDATACENTER
Display Name: Windows Server 2016 Datacenter (Desktop Experience)
Display Description: This option is useful when a GUI is requiredfor example, to provide backward compatibility for an application that cannot be run on a Server Core installation. All server roles and features are supported. For more details see "Windows Server Installation Options."
Directory Count: 21583
File Count: 113561
Total Bytes: 15446943337
Hard Link Bytes: 6357820601
Creation Time: Mon Nov 21 10:02:02 2016 UTC
Last Modification Time: Mon Nov 21 10:02:34 2016 UTC
Architecture: x86_64
Product Name: Microsoft® Windows® Operating System
Edition ID: ServerDatacenter
Installation Type: Server
HAL: acpiapic
Product Type: ServerNT
Product Suite: Terminal Server
Languages: en-US
Default Language: en-US
System Root: WINDOWS
Major Version: 10
Minor Version: 0
Build: 14393
Service Pack Build: 0
Service Pack Level: 0
Flags: ServerDataCenter
WIMBoot compatible: no
synchronicity
Site Admin
Posts: 473
Joined: Sun Aug 02, 2015 10:31 pm

Re: How do I create a pipable image

Post by synchronicity »

Are you using Powershell? Powershell corrupts binary data by default; try cmd.exe instead.

If not, I don't know what the problem is, but to check whether the install.wim file somehow was built incorrectly or became corrupted you could try downloading it locally, then applying it (a) with the contents sent on stdin, and (b) normally, with the file specified directly, not on stdin. If both of those work, then the problem would have to be with wget or how wget is being used.
mojomatt
Posts: 3
Joined: Mon Feb 12, 2018 8:17 pm

Re: How do I create a pipable image

Post by mojomatt »

Hi,

I'm starting with the file install.wim directly from the Microsoft Windows Server 2016 CD. I can apply it as is without problem. I can also apply it after making it a pipable image (by running wimoptimize install.wim --pipable) by applying it specifying it directly. I only have problems when I actually try to pipe the pipable image into wimapply by running a command like... z:\wget\bin\wget -O - http://<Address of web server>/install.wim | z:\Wimlib\x86\wimapply - 1 c:\

I don't know what you mean by "applying it (a) with the contents sent on stdin" Can you explain further?

Is it possible Windows Server 2016 is not supported by Wimlib?

Thanks
mojomatt
Posts: 3
Joined: Mon Feb 12, 2018 8:17 pm

Re: How do I create a pipable image

Post by mojomatt »

OK I think I figured out what you meant by "applying it (a) with the contents sent on stdin"

So I wrote a small vbscript to output the .wim file contents to the console and when I pipe the output into Wimapply I'm getting this error...

X:\Windows\System32>cscript //Nologo z:\out.vbs | z:\Wimlib\x86\wimapply - 1 c:\

[ERROR] "[fd 0]": Invalid magic characters in header
ERROR: Exiting with error code 43:
The file did not begin with the magic characters that identify a WIM file.



If I use Powershell to pipe out the contents of the wim I get this error...

[ERROR] "[fd 0]": Header size is invalid (68 bytes)
ERROR: Exiting with error code 17:
The WIM header was invalid.


Every tool I used to pipe out the image gives me a different error from WIMAPPLY. Is anyone able to use the pipable feature of WIMAPPLY? If so, what tool do you use to pipe the data into WIMAPPLY?

Here is the beginning of my pipable .wim file...
X:\Windows\System32>cscript //nologo z:\out.vbs
WLPWM
¥,@u}b11T☺

¬a↔-°-ƒº,☺¬Å♫♀ ,Kh.→FOH↨
1<?O%zTá‼g¼Ä☼h<ê▬o"5ÉÅân♣ëúºZ¿☻'n0k↔?☼T=►ÿ>úU♦UA3←UÄêܪå+c9èvt+"O#,r"§Mí§6-_òA>╪Oúóá♥<(ôC>S↓>¶ú<I→I4►é+c?☼☼«:?MB·OòI\#sö±¼±?BÉ↔_Yo¬ô>+äx?F§y¬zbjäN'3¶C¶B?♥Y9?·ïbO<U??d>+éÄî_Y¬uÜ☺-▼O°?·7RÇÉM&K~ZíöDû)A"I♣%8PE↕÷?mI9¼k'¡&"$òz Ti╪oDôJRDª+Ak@dG·↓


Any other thoughts?
synchronicity
Site Admin
Posts: 473
Joined: Sun Aug 02, 2015 10:31 pm

Re: How do I create a pipable image

Post by synchronicity »

I don't know what you mean by "applying it (a) with the contents sent on stdin" Can you explain further?
I meant using a shell redirection like:

Code: Select all

wimapply - dir < test.wim
Note also that as I suggested you should use cmd.exe instead of Powershell, since Powershell doesn't work with binary data streams.
Post Reply