{"id":960,"date":"2020-09-02T21:21:48","date_gmt":"2020-09-03T02:21:48","guid":{"rendered":"http:\/\/zewwy.ca\/?p=960"},"modified":"2020-10-03T13:48:08","modified_gmt":"2020-10-03T18:48:08","slug":"creating-a-windows-image-for-deployment-without-wds-adm","status":"publish","type":"post","link":"https:\/\/zewwy.ca\/index.php\/2020\/09\/02\/creating-a-windows-image-for-deployment-without-wds-adm\/","title":{"rendered":"Creating a Windows Image for Deployment without WDS\/ADM"},"content":{"rendered":"<h1 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Creating_a_Windows_Image\"><\/span>Creating a Windows Image<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Intro\"><\/span>Intro<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>If you got the administrative team in your org to handle all the ins and outs of WDS and ADM deployments including using DISM for driver injection for custom images and ALL THAT jazz. Rock on!<\/p>\n<p>If you find you have only a small amount of OS&#8217;s to support and want to keep up with only one image of the latest version with set software without having to learn all the WDS and ADM, and networking with PXE and DHCP and all that fun stuff then this might be a nice alternative for your needs.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Intro-2\"><\/span>Intro<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>You can technically prep the OS on any laptop or a VM as long as you generalize the image during the final prep stage into OOBE mode. If you want to keep hardware specific drivers and such then do not generalize the image.<\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Basic_Steps\"><\/span>Basic Steps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>I used a VM and started it as follows:<\/p>\n<ol>\n<li>Boot and install Windows 10 (I gave it a bare minimum 40 Gig drive)<\/li>\n<li>At the OOBE first time boot after install, press CTRL+SHIFT+F3, let the system boot into the admin account using AUDIT mode.<\/li>\n<li>Install Apps, All Updates, <a href=\"https:\/\/community.spiceworks.com\/scripts\/show\/4378-windows-10-decrapifier-18xx-19xx\">run the community decrapifer<\/a>, clean up the start menu.<\/li>\n<li>in Sysprep Pick OOBE and shutdown<\/li>\n<li>Using Linux Live DD drive to any shared storage.<\/li>\n<li>Use Linux Live to DD image from shared storage to local desktop\/laptop drive and boot, which will boot right into OOBE ready for AD joining or whatever.<\/li>\n<\/ol>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Caveats\"><\/span>Caveats<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>*known caveat&#8230;<\/p>\n<ol>\n<li><a href=\"https:\/\/zewwy.ca\/index.php\/2018\/09\/14\/bitlocker-cant-find-the-file\/\">Don&#8217;t open Bitlocker area while configuring the system in Audit mode<\/a>.<\/li>\n<\/ol>\n<p>All good right? Well normally after I dd the image and let the OOBE run, I like to extend the partition space from the initial 40 to the remainder of the local disk, whatever size it happens to be until&#8230;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/lTOnQMz.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/lTOnQMz.png\" alt=\"\" width=\"750\" height=\"585\" \/><\/a><\/p>\n<p>You might wondering what the big deal is here, now with the existing system, not much, however if I extend the VM&#8217;s drive to replicate copying this image over, you will notice the ability to extend the partition is grayed out this is cause the sectors of the partition would not be contiguous, which is not allowed with partitions on a disk&#8230; since MS provides no way to nicely move it using Disk Management we have to rely on other tools. In this case I&#8217;m going to rely on gparted.<\/p>\n<p>You can grab gparted live <a href=\"https:\/\/gparted.org\/download.php\">from here<\/a><\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"GParted_to_Move_WinRE_Partition\"><\/span>GParted to Move WinRE Partition<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>This is the part that sucks the most cause even though it&#8217;s easily possible MS made the install wizard place the WinRE partition at the end of the disk (this might be able to be manually configured, but I did the ol, pick disk, click install.<\/p>\n<p>Normally I&#8217;d have my IODD device with a huge drive attach to write stuff to, but in this case since it&#8217;s a VM I&#8217;ll add a 1 Gig disk to save the WinRE partition to while moving the rest of the data to the end of the disk.<\/p>\n<p>So add drive, then edit VM boot options to force into EUFI menu, then once powered on, upper right click disk icon and mount ISO, once all green dots to indicate they are mounted, boot from CD\/DVD&#8230;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/ItW3qhg.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/ItW3qhg.png\" alt=\"\" width=\"1014\" height=\"686\" \/><\/a><\/p>\n<p>No keymap changes, enter yeah default lanuage, auto login whatever&#8230;<\/p>\n<p>there it is, the two drives we want to work with, now lets quickly format the 1 gig drive..<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/152wJX6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/152wJX6.png\" alt=\"\" width=\"1023\" height=\"403\" \/><\/a><\/p>\n<p>So create the MBT (Device -&gt; create partition table), new partition, all space, FS NTFS, click green check mark.<\/p>\n<p>Awesome, as you can see I then mounted that partition and used DD to copy the WinRE partition as a whole&#8230;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/tOEJ7Y2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/tOEJ7Y2.png\" alt=\"\" width=\"1005\" height=\"651\" \/><\/a><\/p>\n<p>I sort of covered up the gparted window but I know \/dev\/sda4 was the WinRE partition based on the size and information.<\/p>\n<p>Now for the biggest pain&#8230; we have to delete that partition, move the data partition over and then re-create the open space as the same partition we just deleted, and copy the contents back, so that the data partition sectors can be contiguous even though it remains the &#8220;3rd&#8221; partition.<\/p>\n<p>Weird computer science&#8230;<\/p>\n<p>Anyway let&#8217;s do this..<\/p>\n<p>Delete the WinRE Parittion, \/dev\/sda4 in my case:<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/xvsIoG7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/xvsIoG7.png\" alt=\"\" width=\"824\" height=\"362\" \/><\/a><\/p>\n<p>shift \/dev\/sda3 to end of disk, I selected move\/size and just dragged the partition on the slider all the way to the right, click ok and it should look like this:<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/AuvWKgX.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/AuvWKgX.png\" alt=\"\" width=\"772\" height=\"371\" \/><\/a>Now we re-create the \/dev\/sda4 as ntfs and hidden,diag flags:<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/cdGzh7A.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/cdGzh7A.png\" alt=\"\" width=\"765\" height=\"497\" \/><\/a><\/p>\n<p>*NOTE* This takes a lot of CPU and Disk I\/O as the all the data has to be shifted which is also why the alerts of possible data loss (if there&#8217;s any issue with the actual disk). So the time it takes depends on the size of the over data partition, also recommend to only do this after a backup, or some alternative copy is made. In terms of VMware I had this on it&#8217;s own VM cloned from another, I avoided a snapshot as it would create a delta v file larger than simply cloning the VM. High CPU and Disk I\/O was noticed during this operation.<\/p>\n<p>*Note* Manage flags will be grayed out till the partition is created and applied.<\/p>\n<p>Then we copy the contents back&#8230;<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/9KLQvSX.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/9KLQvSX.png\" alt=\"\" width=\"923\" height=\"644\" \/><\/a><\/p>\n<p>Time for the fun part, does windows still boot?<\/p>\n<p>Sweet still boots, still in sysprep audit mode, lets quickly check the disk.<\/p>\n<pre>chkdsk \/f<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/POjvsZN.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/POjvsZN.png\" alt=\"\" width=\"555\" height=\"304\" \/><\/a><\/p>\n<p>all&#8217;s good, and here&#8217;s a nice picture to show the data drive at the end of the disk as to be extendable to any machine it&#8217;s deployed to:<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/a1zMZD3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/a1zMZD3.png\" alt=\"\" width=\"750\" height=\"583\" \/><\/a><\/p>\n<p>I can now remove the 1GB drive, and <a href=\"https:\/\/zewwy.ca\/index.php\/2019\/05\/15\/fixing-windowsre\/\">fix the WinRE now.<\/a><\/p>\n<h2 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Fix_WinRE\"><\/span>Fix WinRE<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Checking_with_BCDedit\"><\/span>Checking with BCDedit<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre>bcdedit<\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/i.imgur.com\/lKg5bTz.png\" \/><\/p>\n<h3 style=\"text-align: center;\"><span class=\"ez-toc-section\" id=\"Checking_with_reagentc\"><\/span>Checking with reagentc<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<pre>reagentc \/info<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/SVEimP6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/SVEimP6.png\" alt=\"\" width=\"708\" height=\"223\" \/><\/a><\/p>\n<pre>bcdedit \/set {current} recoveryenabled no\r\nbcdedit \/deletevalue {current} recoveryenabled\r\nbcdedit \/deletevalue {current} recoverysequence<\/pre>\n<p>Then mount that recovery partition we moved above (part 4)<\/p>\n<pre>diskpart\r\nselect disk 0\r\nselect part 4\r\nassign letter=r<\/pre>\n<p><a href=\"https:\/\/i.imgur.com\/DX1mhgv.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/DX1mhgv.png\" alt=\"\" width=\"676\" height=\"710\" \/><\/a><\/p>\n<p>change dir to c:\\windows\\system32\\recovery<\/p>\n<p>fix up reagent.xml to:<\/p>\n<pre class=\"prettyprint prettyprinted\"><span class=\"pun\">&lt;?<\/span><span class=\"pln\">xml version<\/span><span class=\"pun\">=<\/span><span class=\"str\">'1.0'<\/span><span class=\"pln\"> encoding<\/span><span class=\"pun\">=<\/span><span class=\"str\">'utf-8'<\/span><span class=\"pln\"> standalone<\/span><span class=\"pun\">=<\/span><span class=\"str\">'yes'<\/span><span class=\"pun\">?&gt;<\/span>\r\n<span class=\"tag\">&lt;WindowsRE<\/span> <span class=\"atn\">version<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"2.0\"<\/span><span class=\"tag\">&gt;<\/span>\r\n\t<span class=\"tag\">&lt;WinreBCD<\/span> <span class=\"atn\">id<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"\"<\/span><span class=\"tag\">&gt;&lt;\/WinreBCD&gt;<\/span>\r\n\t<span class=\"tag\">&lt;WinreLocation<\/span> <span class=\"atn\">path<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"\"<\/span> <span class=\"atn\">id<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span> <span class=\"atn\">offset<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/WinreLocation&gt;<\/span>\r\n\t<span class=\"tag\">&lt;ImageLocation<\/span> <span class=\"atn\">path<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"\"<\/span> <span class=\"atn\">id<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span> <span class=\"atn\">offset<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/ImageLocation&gt;<\/span>\r\n\t<span class=\"tag\">&lt;PBRImageLocation<\/span> <span class=\"atn\">path<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"\"<\/span> <span class=\"atn\">id<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span> <span class=\"atn\">offset<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span> <span class=\"atn\">index<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/PBRImageLocation&gt;<\/span>\r\n\t<span class=\"tag\">&lt;PBRCustomImageLocation<\/span> <span class=\"atn\">path<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"\"<\/span> <span class=\"atn\">id<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span> <span class=\"atn\">offset<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span> <span class=\"atn\">index<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/PBRCustomImageLocation&gt;<\/span>\r\n\t<span class=\"tag\">&lt;InstallState<\/span> <span class=\"atn\">state<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/InstallState&gt;<\/span>\r\n\t<span class=\"tag\">&lt;OsInstallAvailable<\/span> <span class=\"atn\">state<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/OsInstallAvailable&gt;<\/span>\r\n\t<span class=\"tag\">&lt;CustomImageAvailable<\/span> <span class=\"atn\">state<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/CustomImageAvailable&gt;<\/span>\r\n\t<span class=\"tag\">&lt;WinREStaged<\/span> <span class=\"atn\">state<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/WinREStaged&gt;<\/span>\r\n\t<span class=\"tag\">&lt;ScheduledOperation<\/span> <span class=\"atn\">state<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"4\"<\/span><span class=\"tag\">&gt;&lt;\/ScheduledOperation&gt;<\/span>\r\n\t<span class=\"tag\">&lt;OperationParam<\/span> <span class=\"atn\">path<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"\"<\/span><span class=\"tag\">&gt;&lt;\/OperationParam&gt;<\/span>\r\n\t<span class=\"tag\">&lt;OsBuildVersion<\/span> <span class=\"atn\">path<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"\"<\/span><span class=\"tag\">&gt;&lt;\/OsBuildVersion&gt;<\/span>\r\n\t<span class=\"tag\">&lt;OemTool<\/span> <span class=\"atn\">state<\/span><span class=\"pun\">=<\/span><span class=\"atv\">\"0\"<\/span><span class=\"tag\">&gt;&lt;\/OemTool&gt;<\/span>\r\n<span class=\"tag\">&lt;\/WindowsRE&gt;<\/span><\/pre>\n<p>Then use reagentc to reset the path:<\/p>\n<pre>reagentc \/setreimage \/path r:\\recovery\\WindowsRE<\/pre>\n<p>This succeeded then<\/p>\n<pre>reagentc \/enable<\/pre>\n<p>and of course error <a href=\"https:\/\/social.technet.microsoft.com\/Forums\/windows\/en-US\/0b6dc526-8770-47f7-8002-d66318d77aaf\/answerederror-reagentcexe-operation-failed-4c7?forum=w7itproinstall\">till I read this technet<\/a>&#8230; offf<\/p>\n<p>huh..<\/p>\n<pre>reagentc \/enable \/auditmode<\/pre>\n<p>Yay that worked..<\/p>\n<p><a href=\"https:\/\/i.imgur.com\/yUynpoC.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/i.imgur.com\/yUynpoC.png\" alt=\"\" width=\"750\" height=\"487\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creating a Windows Image Intro If you got the administrative team in your org to handle all the ins and outs of WDS and ADM deployments including using DISM for driver injection for custom images and ALL THAT jazz. Rock on! If you find you have only a small amount of OS&#8217;s to support and &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/zewwy.ca\/index.php\/2020\/09\/02\/creating-a-windows-image-for-deployment-without-wds-adm\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Creating a Windows Image for Deployment without WDS\/ADM&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"sfsi_plus_gutenberg_text_before_share":"","sfsi_plus_gutenberg_show_text_before_share":"","sfsi_plus_gutenberg_icon_type":"","sfsi_plus_gutenberg_icon_alignemt":"","sfsi_plus_gutenburg_max_per_row":"","footnotes":""},"categories":[8],"tags":[297,28],"class_list":["post-960","post","type-post","status-publish","format-standard","hentry","category-server-administration","tag-imaging","tag-windows"],"_links":{"self":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/960","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/comments?post=960"}],"version-history":[{"count":2,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/960\/revisions"}],"predecessor-version":[{"id":990,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/posts\/960\/revisions\/990"}],"wp:attachment":[{"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/media?parent=960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/categories?post=960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zewwy.ca\/index.php\/wp-json\/wp\/v2\/tags?post=960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}