Sysprepping a customized image on a VM

Yes.

Merging this thread back to your original VM sysprep. Please don't start new ones when you didn't resolve the first question.
Thank you.

However, when I booted into Windows RE on my physical laptop, I couldn't get the RE to detect the presence of the VHDX image file on my external HDD that was plugged into this laptop.
 
What's with all this MacriumPE, WinRE nonsense?

Return to your VM, boot off the original Windows ISO (untouched). When Setup gets to the first screen, open a CMD window with shift-F10.
Find out which drive letter is mapped to the installed image.
Code:
cd E:
dism /capture-image /imagefile:E:\install.wim /capturedir:E:\ /name:"Win10" /description:"Windows 10 Image" /compress:maximum /checkintegrity /verify
wpeutil shutdown

Reboot your VM, get normal Windows running and enable network folder sharing. Copy install.wim to the host, replacing your ISO folder's version with this exported image.
 
What's with all this MacriumPE, WinRE nonsense?

Return to your VM, boot off the original Windows ISO (untouched). When Setup gets to the first screen, open a CMD window with shift-F10.
Find out which drive letter is mapped to the installed image.
Code:
cd E:
dism /capture-image /imagefile:E:\install.wim /capturedir:E:\ /name:"Win10" /description:"Windows 10 Image" /compress:maximum /checkintegrity /verify
wpeutil shutdown

Reboot your VM, get normal Windows running and enable network folder sharing. Copy install.wim to the host, replacing your ISO folder's version with this exported image.
No, that is not the point at all. You said that VHDX can be used to deploy on a physical machine. I told you I couldn't do that, and asked you why. My external HDD was plugged into my physical laptop with the VHDX on it, I booted into Windows.ISO, went to System Image Restore and the system couldn't find any backups. It couldn't detect this VHDX image even tho it was there.
 
No, that is not the point at all. You said that VHDX can be used to deploy on a physical machine. I told you I couldn't do that, and asked you why. My external HDD was plugged into my physical laptop with the VHDX on it, I booted into Windows.ISO, went to System Image Restore and the system couldn't find any backups. It couldn't detect this VHDX image even tho it was there.

Re-read my reply. This answer looks obvious.
Or is VHDX strictly for virtual machines?

I instructed you to run the VM (mounting the updated VHDX), and use the ISO to get to a WinPE command shell. Where do any sysprep guides mentioned System Image Restore? Restore only reads backup images it created, which are WIM-based.

You're making assumptions that different Windows volume formats are compatible, when they're not.
- MRIMG
- VHDX
- System Image Restore (WIM)
 
Re-read my reply. This answer looks obvious.



I instructed you to run the VM (mounting the updated VHDX), and use the ISO to get to a WinPE command shell. Where do any sysprep guides mentioned System Image Restore? Restore only reads backup images it created, which are WIM-based.

You're making assumptions that different Windows volume formats are compatible, when they're not.
- MRIMG
- VHDX
- System Image Restore (WIM)
Jesus I'm sorry, I must have been really tired that day because I totally read that as 'Can VHDX be deployed on a physical machine?' 'Yes'
I apologize. Totally misread that.

So just to be clear this time:

I run the VM, create that VHD or VHDX (in VirtualBox - which I am running now - it's VHD; in Hyper-V it's VHDX) image, then boot into the Windows installation iso (Windows.iso - the original one off the website of Microsoft) then press Shift + F10 to get the cmd prompt and then use the DISM Capture Image command, get the .wim file on the C Drive of the VM, then I mount that VHD drive on my physical machine, extract the .WIM file out of it, but then what do I do with it?
 
Resume the VM where you last made edits. Boot off the untouched ISO.
You should always be keeping a copy of the original ISO around, mostly so you can start clean whenever you don't like an image.

Turn on the VM's folder sharing with the host, made any host folder available to the VM as a writeable folder. Copy the WIM to that network folder, you've just exported it without doing any file or volume conversion. Same way you read or write any files from the host to the running VM.
 
Resume the VM where you last made edits. Boot off the untouched ISO.
You should always be keeping a copy of the original ISO around, mostly so you can start clean whenever you don't like an image.

Turn on the VM's folder sharing with the host, made any host folder available to the VM as a writeable folder. Copy the WIM to that network folder, you've just exported it without doing any file or volume conversion. Same way you read or write any files from the host to the running VM.
You just described to me how to get the .WIM file from the VM on my physical machine. I can double-click on the VHDX on my physical machine and still would get all the content of it. Fine either way.

But my question pertained to 'What do I do AFTER I have the .WIM file on my physical machine'?
 
Replace the install.wim on the extracted ISO's sources folder. Make a new ISO, or continue editing with NTLite.
 
It doesn't matter which one. If you want re-use your custom ISO's folder, make sure you make a new unattended file since you no longer need to sysprep.
 
It doesn't matter which one. If you want re-use your custom ISO's folder, make sure you make a new unattended file since you no longer need to sysprep.
But it HAS TO be named install.wim, right? It can't be given a custom name like 'sysprep.wim' or sth, correct? Or else the system wouldn't think it's the original install.wim file.
 
It doesn't matter which one. If you want re-use your custom ISO's folder, make sure you make a new unattended file since you no longer need to sysprep.
Sorry for the double-post but I just want to give an update: So this time, it worked! Amazing feeling and thank you for the info you gave me.

I do have a question and issue tho:

When I created the sysprep'd image on the hyper-V VM off a .iso file I had created in NTLite, it had the auto-unattend.xml file thus it gave the answers to Microsoft's about 10 questions they always ask you when you install Windows. I created the sysprep'd image, I saved its .WIM file on the C Drive of the VM, then I shut down the VM, mounted its VHDX image, grabbed the .WIM file and replaced the original install.wim file with this custom install.WIM file in the Windows.ISO file. However, when I successfully deployed this sysprep'd Windows.ISO on the physical laptop, I noticed Microsoft asked me those 10 default questions again, which makes me suspect that somehow the auto-unattend.xml file had somehow got lost (that was part of the original NTLite ISO I had made). My question is, how could it get lost if I deployed the NTLite ISO containing this auto-unattend.xml file on the VM to begin with? Did sysprepping remove it?
 
Copy back the autounattend.xml from wherever. NTLite doesn't auto-import it back into the preset (for technical reasons), but if it's on the root of the ISO folder then it gets included on the ISO.
 
Copy back the autounattend.xml from wherever. NTLite doesn't auto-import it back into the preset (for technical reasons), but if it's on the root of the ISO folder then it gets included on the ISO.
Is it possible to have the language and the 'skip every question' parts of the auto-unattend section filled out but not the setting up of the microsoft and offline account parts? So basically is it possible to get the Windows installation to not ask me any questions, only ask me to set up my offline and microsoft account? If the image has already been sysprepped that is, so I'd load that image in NTLite to fill out the auto-unattend section after the sysprepping takes place. I've been trying to make this happen for a couple of hours and it never asks me to create my account even tho I set those 2 (offline and microsoft account setup) to 'false', the windows installation doesn't care, it just jumps to the login screen where there's the 'Other User' but I can't login since I wasn't asked to create my account
 
Why won't it skip everything but the user account setup?
I only tried a few times myself to make unattend stuff work, and ended up abandoning it. I'll try again in the future and if successful write up a guide on it. But as you can see from the other threads, I don't think many people have been super successful with that, and end up settling for some compromise instead, where they get just a few select things working and call it good.

Microsoft complicated it a bit over the years, and a big part of the problem is that each new operating system and edition of Windows, such as 1809, 1903, 21H2, etcetera, keep changing certain things like renaming registry keys, making some keys obsolete, adding new keys, new default user account thing, changing how start menu works, the new CloudStore system, and so forth, so it's becoming really hard for people to stay on top of it. A solution from just 1 year ago may not work at all now in some cases.

In other words it's going to take a lot of trial and error to get it right, and you may even potentially find some things that need to be updated in NTLite along the way. Focus on the basics first, to build up your skills making a working image, before tackling the advanced stuff.
 
Last edited:
I only tried a few times myself to make autounattend stuff work, and ended up abandoning it. I'll try again in the future and if successful write up a guide on it. But as you can see from the other threads, I don't think many people have been super successful with that, and end up settling for some compromise instead, where they get just a few select things working and call it good.

Microsoft complicated it a bit over the years, and a big part of the problem is that each new edition of Windows, such as 1809, 1903, 21H2, etc keep changing certain things like renaming registry keys, making some keys obsolete, adding new keys, new default user account thing, changing how start menu works, the new cloudstore system, and so forth. So it's becoming really hard for people to stay on top of it. A solution from just 1 year ago may not work at all now in some cases.

In other words it's going to take a lot of trial and error to get it right, and you may even potentially find some things that need to be updated in NTLite in the process. This is why we're trying to get you to focus on the basics first, to build up your skills making a working image, before tackling the advanced stuff.
Correct, I have been on this for 10 hours now and jfc... If I had this drive to do my actual job I'd be a millionaire by now
 
Swap it
<OOBE>
<HideEULAPage>true</HideEULAPage>
<HideLocalAccountScreen>true</HideLocalAccountScreen>
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
<HideWirelessSetupInOOBE>true</HideWirelessSetupInOOBE>
<NetworkLocation>Other</NetworkLocation>
<ProtectYourPC>3</ProtectYourPC>
<SkipMachineOOBE>true</SkipMachineOOBE>
<SkipUserOOBE>true</SkipUserOOBE>
</OOBE>

Why don't you set up the "admin" account right away after installation, you can change it to whatever you want?

<AutoLogon>
<Enabled>true</Enabled>
<LogonCount>9999999</LogonCount>
<Username>Administrator</Username>
<Password>
<PlainText>true</PlainText>
<Value></Value>
</Password>
</AutoLogon>

<UserAccounts>
<AdministratorPassword>
<PlainText>true</PlainText>
<Value></Value>
</AdministratorPassword>
<LocalAccounts>
<LocalAccount wcm:action="add">
<DisplayName>Admin</DisplayName>
<Group>Administrators</Group>
<Name>Administrator</Name>
<Password>
<PlainText>true</PlainText>
<Value></Value>
</Password>
</LocalAccount>
</LocalAccounts>
</UserAccounts>
 
Correct, I have been on this for 10 hours now and jfc... If I had this drive to do my actual job I'd be a millionaire by now
Yeah, this is the downside to closed-source stuff like Windows. It takes a lot of deconstructing, and searching for undocumented settings in order to achieve results. You really have to know Windows and NTLite inside out to get some of the advanced things accomplished nowadays.
 
Back
Top