Skip to content

Latest Ec2Launch V2 no longer updates wallpaper when user logs in

0

We are building many new Windows 2022 base images using the AWS provided AMIs.

We were previously using the following AMI which has EC2 Launch V2.0.1303

  • 2023-08-04 05:51:41 Console: Launch: EC2 Launch v2.0.1303
  • 2023-08-04 05:51:41 Console: AMI-ID: ami-04132f301c3e4f138
  • Console: AMI Origin Version: 2023.06.14
  • Console: AMI Origin Name: Windows_Server-2022-English-Full-Base

We are now using the latest AWS Windows AMI

  • 2023-08-04 05:51:40 Console: Launch: EC2 Launch v2.0.1521
  • 2023-08-04 05:51:40 Console: AMI-ID: ami-0fc682b2a42e57ca2
  • 2023-08-04 05:51:40 Console: AMI Origin Version: 2023.07.12
  • 2023-08-04 05:51:40 Console: AMI Origin Name: Windows_Server-2022-English-Full-Base

This new version does not update the wallpaper.

If I run Ec2Launch manually to update the wallpaper this works fine, so it's more an issue of Ec2aunch not executing the task when user logs in

PS C:\Program Files\Amazon\EC2Launch> .\EC2Launch.exe wallpaper --path C:\ProgramData\Amazon\EC2Launch\wallpaper\Ec2Wallpaper.jpg --attributes hostName,instanceId,privateIpAddress,instanceSize,availabilityZone,architecture,memory,network

2023-08-04 15:08:57 Info: Configure wallpaper. Path: C:\ProgramData\Amazon\EC2Launch\wallpaper\Ec2Wallpaper.jpg; Attributes: hostName,instanceId,privateIpAddress,instanceSize,availabilityZone,architecture,memory,network; Instance Tags: Display none

2023-08-04 15:08:59 Info: Success: Completed wallpaper configuration.

Thanks and have a nice weekend

asked 3 years ago2.2K views

4 Answers
1

That Start Folder link is there for both default users and my user account.

I think it’s a permissions issue with the log file?

If I run the EC2Launch wallpaper command from an administrative PowerShell window it works fine (on both images)

If I run it from a regular PowerShell window on the 2023.06.14 image it also works fine.

If I run it from a regular PowerShell window on the 2023.07.12 image it barfs with issues

panic: Failed to initialize the log files: Failed to set up log folder: Failed to create agent log file: Failed to set permissions on log file: The operation completed successfully.

goroutine 1 [running]:
golang.a2z.com/EC2InitAgent/task.(*Util).InitializeFileLogger(0x0?)
        /local/p4clients/pkgbuild-qS5b5/workspace/src/EC2InitAgent/task/util.go:100 +0x93
golang.a2z.com/EC2InitAgent/cli/internal/cmdtree/wallpaper.ConstructCommand.func1(0xc00019a000?, {0xc00018ccc0?, 0x2?, 0x2?})
        /local/p4clients/pkgbuild-qS5b5/workspace/src/EC2InitAgent/cli/internal/cmdtree/wallpaper/wallpaper.go:49 +0x65
github.com/spf13/cobra.(*Command).execute(0xc00019a000, {0xc00018cca0, 0x2, 0x2})
        /local/p4clients/pkgbuild-qS5b5/workspace/src/EC2InitAgent/build/private/bgospace/Go3p-Github-Spf13-Cobra/src/github.com/spf13/cobra/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc00011d800)
        /local/p4clients/pkgbuild-qS5b5/workspace/src/EC2InitAgent/build/private/bgospace/Go3p-Github-Spf13-Cobra/src/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(0x1eb676f0598?)
        /local/p4clients/pkgbuild-qS5b5/workspace/src/EC2InitAgent/build/private/bgospace/Go3p-Github-Spf13-Cobra/src/github.com/spf13/cobra/command.go:968 +0x19
golang.a2z.com/EC2InitAgent/cli.ExecuteRootCmd()
        /local/p4clients/pkgbuild-qS5b5/workspace/src/EC2InitAgent/cli/executeroot.go:12 +0x91
main.main()
        /local/p4clients/pkgbuild-qS5b5/workspace/src/EC2InitAgent/main.go:20 +0x50

Can someone try and duplicate this logging in as a non administrative user?

answered 3 years ago

0

Machines are domain joined and I am logging in over RDP as a Domain power user who has local admin rights.

Machines are up for hours (restart each day in business hours) so I'm on for more than 5 minutes.

I did not build these instances but I'm working with the team that did to clarify f they did something different with this AMI.

It is useful for me to know that it appears to be just us and not a known issue.

answered 3 years ago

  • Hello again,

    If you are utilizing domain users, you may want to check that the "setwallpaper.ink" shortcut exists in their startup folder at "C:\users%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup". This shortcut is created for all users initially, but for domain users who are created after the fact, the shortcut may not exist. You can read more about this shortcut and where its created by opening your EC2Launch Settings application and going to the "Wallpaper" tab.

    To automatically create this shortcut for all users, you can simply copy the "setwallpaper.ink" file from the local administrator account to your default Windows account here: C:\users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. Or you can simply copy it to the desired users.

    You should also check to ensure that there are no domain policies that would prevent this shortcut from running.

    Thanks.

0

This is happening for me as well, and AWS Support was not able to resolve it. It seems like this may be a bug in EC2Launchv2, and it's interesting that it's only happening with a recent AMI. Also using v2.0.1521, Windows Server 2022.

answered 3 years ago

  • Thanks for reporting that it is happening with you too. I'll try and get our local partners to open a case with AWS.

0

Hello,

Thanks for reaching out, I am happy to help. I understand that you are experiencing issues with EC2Launch v2 no longer updating wallpaper during user logins after using an updated AMI 'ami-0fc682b2a42e57ca2'.

As you may already know, EC2Launch v2 runs as a service [1] and executes at each startup with certain tasks configured per its agent-config.yml file [2]. If you are using the provided AMI 'ami-0fc682b2a42e57ca2' without any configuration to the agent, then the wallpaper is expected to regenerate at login.

I verified that this AMI works as expected in generating this wallpaper by launching a new instance with AMI ami-0fc682b2a42e57ca2. I then logged in with the default 'Administrator' account, and the wallpaper was generated ~5 minutes afterwards. To be clear, it is common for the wallpaper generation to take a few minutes to generate.

I then stopped the instance, changed the instance type, and started it again in order to observe a change in the wallpaper. There was no issue with this and the wallpaper changed within a few minutes.

I was unable to recreate any circumstance you're describing where the wallpaper was not generated during login on this AMI. In order to understand and assist you further, I would ask that you provide step-by-step instructions that can be used to recreate the issue in my environment. Please also provide whether the users login is the 'Administrator' over Remote Desktop, or some other user and or method.

Otherwise, since I am unable to reproduce this issue at this time, we will need to wait for more information from you. If you have access to AWS Support [3], please open a ticket and we can assist you there where we can review your logs (%ProgramData%\Amazon\EC2Launch\log\agent.log) more carefully.

Thanks!

References:

  1. https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch-v2-overview.html
  2. https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch-v2-settings.html
  3. https://aws.amazon.com/contact-us/
AWS
SUPPORT ENGINEER

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.