Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with packages installer.vm #603

Closed
monfora opened this issue Aug 7, 2024 · 10 comments
Closed

Error with packages installer.vm #603

monfora opened this issue Aug 7, 2024 · 10 comments
Assignees
Labels
🐛 bug Something isn't working 😕 needs info Further information is needed

Comments

@monfora
Copy link

monfora commented Aug 7, 2024

What's the problem?

At the end of installation packages to the system there is an error with package.

Steps to Reproduce

clean iso of windows 11 from microsoft -> new vm on virtualbox -> default selected packages on install stage

Environment

  • VirtualBox
  • Windows 11 - 10.0.22631
  • 5.1.22621.3880
  • 2.3.0
  • Boxstarter|3.0.3

Additional Information

terminal_logs.txt
chocolatey.log
chocolatey.1.log
chocolatey.2.log
log.txt

@monfora monfora added the 🐛 bug Something isn't working label Aug 7, 2024
@Ana06
Copy link
Member

Ana06 commented Aug 26, 2024

With the provided information it is not clear to me which package fails and what the error is. Please provide the console output as required in the bug issue template so that we are able to help you.

@Ana06 Ana06 added the 😕 needs info Further information is needed label Aug 26, 2024
@emtuls
Copy link
Member

emtuls commented Aug 27, 2024

Thanks for reporting this @monfora!

@Ana06 I think I see the issue here. It looks like the CustomStartLayout.xml is not being applied (errors out while trying to import it) and this seems to be an issue that others on newer Windows 11 builds are also experiencing: https://www.reddit.com/r/SCCM/comments/1cus7g3/importstartlayout_for_taskbar_stopped_working/

It seems that Microsoft may have either changed the format spec (though I can't find an updated one on the internet), or they are disallowing this ability via PowerShell (some people say their old configs still work when applied via GPO).

Fortunately, it looks like there is a simple fix, which is to store the layout as LayoutModification.xml and place it in C:\Users\default\AppData\Local\Microsoft\Windows\Shell\.

I just tested the fix on a Windows 10 pre-built FlareVM and it worked fine. I'll need to get a proper new Windows 11 build set up to test it there. I also need to test it from a fresh ISO through the full build to see if there may be any other tweaking that is needed (my Win 11 test should help with that as well).

To test, once the file is named correctly and placed in that location (and assuming you've removed any other pinned icons), you can run Stop-Process -Name explorer -Force and it should work. This will need to be adjusted in our repo and installer.vm if it is the route we decide to take.

@emtuls emtuls self-assigned this Aug 27, 2024
@monfora
Copy link
Author

monfora commented Aug 27, 2024

fixed by adding terminal log in first message

@monfora
Copy link
Author

monfora commented Aug 29, 2024

Thanks for reporting this @monfora!

@Ana06 I think I see the issue here. It looks like the CustomStartLayout.xml is not being applied (errors out while trying to import it) and this seems to be an issue that others on newer Windows 11 builds are also experiencing: https://www.reddit.com/r/SCCM/comments/1cus7g3/importstartlayout_for_taskbar_stopped_working/

It seems that Microsoft may have either changed the format spec (though I can't find an updated one on the internet), or they are disallowing this ability via PowerShell (some people say their old configs still work when applied via GPO).

Fortunately, it looks like there is a simple fix, which is to store the layout as LayoutModification.xml and place it in C:\Users\default\AppData\Local\Microsoft\Windows\Shell\.

I just tested the fix on a Windows 10 pre-built FlareVM and it worked fine. I'll need to get a proper new Windows 11 build set up to test it there. I also need to test it from a fresh ISO through the full build to see if there may be any other tweaking that is needed (my Win 11 test should help with that as well).

To test, once the file is named correctly and placed in that location (and assuming you've removed any other pinned icons), you can run Stop-Process -Name explorer -Force and it should work. This will need to be adjusted in our repo and installer.vm if it is the route we decide to take.

Thanks for fix.

@salmanjann
Copy link

salmanjann commented Sep 11, 2024

my netcat.vm package is not installing, other tools are pinned now at taskbar by following the instructions, but the desktop wallpaper is still not changed! @emtuls

Still this error!

error 2

@salmanjann
Copy link

salmanjann commented Sep 11, 2024

The content of CustomStartLayout.xml file is as follows, which is created by itself when installer is run!


<?xml version="1.0" encoding="utf-8"?>
<LayoutModificationTemplate
    xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification"
    xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout"
    xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout"
    xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout"
    Version="1">
  <LayoutOptions StartTileGroupCellWidth="6" StartTileGroupsColumnCount="1" />
  <DefaultLayoutOverride>
    <StartLayoutCollection>
      <defaultlayout:StartLayout GroupCellWidth="6">
      </defaultlayout:StartLayout>
    </StartLayoutCollection>
  </DefaultLayoutOverride>
    <CustomTaskbarLayoutCollection PinListPlacement="Replace">
      <defaultlayout:TaskbarLayout>
        <taskbar:TaskbarPinList>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%AppData%\Microsoft\Windows\Start Menu\Programs\System Tools\File Explorer.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Productivity Tools\Windows Terminal.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Utilities\CyberChef.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Disassemblers\ida.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Networking\fakenet.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\PE\CFF Explorer.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Utilities\procexp.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Utilities\procmon.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Productivity Tools\notepad++.lnk"/>
          <taskbar:DesktopApp DesktopApplicationLinkPath="%TOOL_LIST_DIR%\Productivity Tools\VisualStudio.lnk"/>
        </taskbar:TaskbarPinList>
      </defaultlayout:TaskbarLayout>
    </CustomTaskbarLayoutCollection>
</LayoutModificationTemplate>

@emtuls
Copy link
Member

emtuls commented Sep 11, 2024

Noted! Will try to take a look this week or very soon. Some other priorities came up, but this is on my radar. Thank you for the follow up. :)

@luffy-cmd
Copy link

fixed by adding terminal log in first message

What exactly did you do here? and post that did you restart the installation?

@emtuls
Copy link
Member

emtuls commented Sep 17, 2024

@luffy-cmd I believe they were responding to @Ana06's message in regards to adding additional logs to their message, not actually fixing of the issue at hand.

In regards to the issue, I have a PR in that should fix the problem once it is merged: mandiant/VM-Packages#1137

For now, a temporary workaround that should work would be to copy lines 45-189 from installer.vm (https://github.com/mandiant/VM-Packages/blob/6b95e46f12c9e6fd6247bd9fe271203b0008315d/packages/installer.vm/tools/chocolateyinstall.ps1#L45C5-L190C1) and run them in an admin powershell after the installation fails.

After this, you can then run the following commands to have the taskbar set as expected:

Copy-Item "${Env:VM_COMMON_DIR}\CustomStartLayout.xml" "C:\Users\default\AppData\Local\Microsoft\Windows\Shell\LayoutModification.xml"
Stop-Process -Name explorer -Force

@emtuls
Copy link
Member

emtuls commented Oct 7, 2024

This should now be fixed with #617 and mandiant/VM-Packages#1137 having been merged.

@emtuls emtuls closed this as completed Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 😕 needs info Further information is needed
Projects
None yet
Development

No branches or pull requests

5 participants