New dism /apply-image /compact option

Discussion in 'Virtualization' started by murphy78, Jul 22, 2015.

  1. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    #1 murphy78, Jul 22, 2015
    Last edited: Jul 23, 2015
    There's a new /compact option for applying image.
    I've been testing it and the best compression seems to happen when you start with a wim file.
    I tried esd and the result was larger by about half a gig.

    coresl to expanding vm x86 result = 5.7GB
    coresl to expanding vm x64 result = 7.9GB

    This is before actually running the os.
    Procedure was as follows:
    Create a vm in diskmgmt.msc that is expanding max 40gb
    run diskpart
    select vdisk file=c:\vhd\empty.vhd
    attach vdisk
    create partition primary
    format fs=ntfs quick
    active
    assign
    detach vdisk

    dism /apply-image /sourceimage:x:\sources\install.wim /index:1 /applydir:y:\ /compact
    (obv change x and y to the actual drive letters)

    Then boot up the vhd in a vm with a similar arch 10 iso
    cd /d c:\windows\system32
    bcdboot c:\windows /s c:\

    shut down or restart vm.
    You can then boot up from the hard drive.

    Anyway, I have found this useful for tinkering around in a VM since making a lot of these kind of vhd files can really clog up your drives.

    Also, a fair amount of this info came from xinso who was helping me figure out a certain problem.

    EDIT: Further testing suggests that this is not reduced on a vhd over a normal apply/install
     
  2. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,770
    1,101
    60
    Any advantage over wimboot ?
     
  3. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    I think the advantage would be that these files are changeable.
    In short term, I think wimboot would save more space.
    In long term, if you have lots of updates, this option would save more space as you could remove the old unused files.
    With wimboot it's not that simple, they're locked into the wim.
     
  4. Tito

    Tito Super Mod / Adviser
    Staff Member

    Nov 30, 2009
    18,681
    18,589
    340
  5. bay12

    bay12 MDL Junior Member

    Nov 30, 2014
    84
    13
    0

    Hi, did you noticed if running dism.exe in command prompt sometimes is slow and the process seems to "sleep"?
    I'm pretty sure it depends by command promp, sometimes seems it sleeps and i need to hit enter to wake it up!
     
  6. murphy78

    murphy78 MDL DISM Enthusiast

    Nov 18, 2012
    7,389
    11,614
    240
    That's a cmd prompt thing. If it's running and not active and you click on the window it will change to "select " mode and pause

    You can avoid that by alt-tabbing or clicking the title bar instead of the contents.