Generating a 2008 R2 VM Template with DISM

Hi all!

Here I show how to make a new template for WS 2008 R2 EE with DISM installed in a WS 2012 R2 CU1:

Pre-requisites: WADK 8.1 http://www.microsoft.com/en-us/download/details.aspx?id=39982

Copy wim file from WS 2008 R2 EE image and paste in your local C:\W2008R2_Template

Resuming actions:

  • OS WS 2008 R2 Enterprise
  • Telnet client enabled
  • Spanish regional settings
  • UTC+1 Time Zone
  • All updates added from a repository generated with wsusoffline931 http://download.wsusoffline.net/
  • VHDX with 120GB
  • Boot partition 350MB
  • System Partition 119GB

Hands on:

Open DISM CMD with elevated privileges and execute

Template with Features:
—————————-

dism /Mount-Wim /WimFile:C:\W2008R2_Template\VMTemplate.wim /Index:3 /MountDir:C:\W2008R2_Template\new_vm

dism /image:C:\W2008R2_Template\new_vm /Enable-Feature /FeatureName:TelnetClient

dism /image:C:\W2008R2_Template\new_vm /set-syslocale:es-ES
Dism /image:C:\W2008R2_Template\new_vm /Set-UserLocale:es-ES
Dism /image:C:\W2008R2_Template\new_vm /Set-Inputlocale:040a:0000040a

Dism /image:C:\W2008R2_Template\new_vm /Set-TimeZone:”Romance Standard Time”

Dism /unmount-wim /mountdir:C:\W2008R2_Template\new_vm /commit

Adding updates:
—————–
dism /mount-wim /wimfile:C:\W2008R2_Template\VMTemplate.wim /index:3 /mountdir:C:\W2008R2_Template\new_vm

DISM /image:C:\W2008R2_Template\new_vm /Add-Package /Packagepath:C:\WUpdates2k8R2

Dism /unmount-wim /mountdir:C:\W2008R2_Template\new_vm /commit

Open CMD with elevated privileges and execute:

Creating VHDX:
————

diskpart
create vdisk file=C:\W2008R2_Template\vhdx\VMTemplate.vhdx maximum=122880 type=expandable
select vdisk file=C:\W2008R2_Template\vhdx\VMTemplate.vhdx
Attach vdisk

Create partition primary size=350
Format quick fs=ntfs
Assign letter=M
Active
Create partition primary
Format quick fs=ntfs
Assign letter=V
exit

Open DISM CMD with elevated privileges and execute

—————–

dism /apply-image /imagefile:C:\W2008R2_Template\VMTemplate.wim /index:3 /applydir:V:\

V:\windows\system32\bcdboot V:\windows /s M:

Open CMD with elevated privileges and execute:

Diskpart
Select vdisk file=C:\W2008R2_Template\vhdx\VMTemplate.vhdx
Detach vdisk
exit

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s