{"id":311,"date":"2014-06-09T23:23:02","date_gmt":"2014-06-10T05:23:02","guid":{"rendered":"http:\/\/blog.escarra.org\/?p=311"},"modified":"2014-06-10T08:53:52","modified_gmt":"2014-06-10T14:53:52","slug":"out-of-date-sources-for-an-up-to-date-template","status":"publish","type":"post","link":"https:\/\/blog.escarra.org\/?p=311","title":{"rendered":"Out of date sources for an up-to-date template?"},"content":{"rendered":"<p>Say you&#8217;re trying to speed up your VM deployments and create a template with Windows Server 2012 or 2012 R2, and in the process to clean up some valuable HD space you run something like the following:<\/p>\n<blockquote><p><strong>Get-WindowsFeature | Where-Object -FilterScript { $_.Installed -Eq $FALSE } | Uninstall-WindowsFeature \u2013Remove<\/strong><\/p><\/blockquote>\n<p>What that&#8217;ll do is remove the binaries off any uninstalled feature and save you a few gigs&#8230; BUT you will need the media, or the sources in a share, any time you want to install a feature, which is fine&#8230; as long as your template does not get updated. The moment you run Windows Update and go through the motions, your media will no longer work if you want to add features, and installations will fail with something like this:<\/p>\n<blockquote><p><span style=\"color: rgb(255, 0, 0);\">Error: 0x800f081f<\/span><\/p>\n<p><span style=\"color: rgb(255, 0, 0);\">The source files could not be found.<\/span><br \/>\n<span style=\"color: rgb(255, 0, 0);\"> Use the &#8220;Source&#8221; option to specify the location of the files that are required to restore the feature. For more information<\/span><br \/>\n<span style=\"color: rgb(255, 0, 0);\"> on specifying a source location, see http:\/\/go.microsoft.com\/fwlink\/?LinkId=243077.<\/span><\/p><\/blockquote>\n<p>To update your sources so that you can use them when installing features, you can use the install.wim file on your media and grab the latest patches using\u00a0<strong>WSUS Offline Updater<\/strong> (<a href=\"http:\/\/www.wsusoffline.net\/\">http:\/\/www.wsusoffline.net\/<\/a>), then merge the updates with the sources. Here&#8217;s how:<\/p>\n<ul>\n<li>Copy the Sources\\install.wim file from your Windows Server 2012 or 2012 R2 DVD media to somewhere in your hard drive.<\/li>\n<li>Create a temporary folder, let&#8217;s call it C:\\Win2012R2<\/li>\n<li>Remove the read-only attributes of your local install.wim file because we will be modifying it<\/li>\n<li>Run\u00a0<strong>dism.exe \/get-wiminfo \/wimfile:C:\\install.wim<\/strong> and take note of\u00a0the Index for the edition you&#8217;re using<\/li>\n<li>Run\u00a0<strong>dism.exe \/mount-wim \/WimFile:C:\\install.wim \/index:4 \/mountDir:C:\\Win2012R2<\/strong>. Note i&#8217;m using Index 4, which is for Datacenter (non-core)<\/li>\n<li>Run\u00a0<strong>WSUS Offline<\/strong> and download all patches for the edition you&#8217;re using, and create an ISO from them<\/li>\n<li>Mount the ISO with the updates, then run\u00a0<strong>dism.exe \/image:C:\\Win2012R2 \/Add-Package \/PackagePath:F:\\w63-x64\\glb<\/strong>. In my case, the ISO was mounted on drive F:<\/li>\n<li>Run the previous command at least twice. There are times where updates won&#8217;t slipstream into the sources unless they are at the right version. This is the case with Update 1 for Server 2012 R2.<\/li>\n<li>Once all updates are injected, run\u00a0<strong>dism.exe \/Unmount-Wim \/MountDir:C:\\Win2012R2 \/commit<\/strong> which will write the install.wim file back with changes and is ready for use.<\/li>\n<\/ul>\n<p>When it comes time to install features, just use\u00a0<strong>Add-WindowsFeature <\/strong>with\u00a0<strong>-source:wim:\\\\server\\share\\install.wim<\/strong><strong>:4<\/strong> (note the Index number at the end).<\/p>\n<p>For more detail, you can check out <a href=\"http:\/\/blogs.technet.com\/b\/joscon\/archive\/2012\/11\/14\/how-to-update-local-source-media-to-add-roles-and-features.aspx#pi47623=2\">this TechNet article<\/a>\u00a0in combination with WSUS Offline to help you with the patch downloads.<\/p>\n<p>Thanks for reading!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Say you&#8217;re trying to speed up your VM deployments and create a template with Windows Server 2012 or 2012 R2, and in the process to clean up some valuable HD space you run something like the following: Get-WindowsFeature | Where-Object -FilterScript { $_.Installed -Eq $FALSE } | Uninstall-WindowsFeature \u2013Remove What that&#8217;ll do is remove the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false,"jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[19],"tags":[],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.escarra.org\/index.php?rest_route=\/wp\/v2\/posts\/311"}],"collection":[{"href":"https:\/\/blog.escarra.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.escarra.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.escarra.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.escarra.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=311"}],"version-history":[{"count":3,"href":"https:\/\/blog.escarra.org\/index.php?rest_route=\/wp\/v2\/posts\/311\/revisions"}],"predecessor-version":[{"id":314,"href":"https:\/\/blog.escarra.org\/index.php?rest_route=\/wp\/v2\/posts\/311\/revisions\/314"}],"wp:attachment":[{"href":"https:\/\/blog.escarra.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.escarra.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.escarra.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}