microsoft / devhome

The new Dev Home experience for Windows!
https://aka.ms/devhomedocs
MIT License
3.63k stars 323 forks source link

Restart events do not work for Dev Box machines #3299

Open joadoumie opened 4 months ago

joadoumie commented 4 months ago

Dev Home version

No response

Windows build number

No response

Other software

No response

Steps to reproduce the bug

  1. Trigger a restart event in Windows Customization or in Environments flow
  2. Click the restart button on the banner in environments OR decline the restart on the modal popup in Windows Customization and then click the restart button on the banner

Expected result

Restart flow is initiated.

Actual result

Nothing happens -- there is no way to tell that the restart action has not worked. In this case I have an access denied error.

Included System Information

No response

Included Extensions Information

No response

joadoumie commented 4 months ago

@nieubank @bbonaby for visibility. I believe this only affects Windows Customization and Environments for the time-being.

bbonaby commented 4 months ago

hmm, its probably the use of shutdown.exe on some computers. @joadoumie, can you try opening command prompt or a terminal window (non-admin) on that machine and running the following command.

shutdown.exe -r -t 0

If you have permission the machine should restart.

if you get an access denied message can you tell me if you see your username or the Users group in this group policy?

Type in "group policy" the start menu and click the "Edit Group Policy" app -> In the app select "Local Computer Policy" -> Computer Configuration -> Windows Settings -> Security Settings -> Local Policies -> User Rights Assignment

image

Just looked in my Dev Box and yea, looks like the Users group isn't in this policy by default

I guess there are 3 things we can either do.

  1. When we enable the optional features we also add the user account to this group. Issue here is that they will keep this permission/right even after the reboot unless they take themselves out. Also, maybe some enterprises prevent them from even updating the policies so this might not work.
  2. Find some other way to invoke a reboot if possible.
  3. Check if the user is in the group. if they are, then show the reboot button. If they aren't then just show an info bar telling them they need to reboot.

related #2954

huzaifa-d commented 1 month ago

Moving to P3 as this is a niche issue and the most that can be done here is show an additional message saying that the restart wasn't successful.