packer
packer copied to clipboard
Windows - allow sshd service to interact with desktop
When creating a service on windows, you can choose to allow the service to interact with the desktop. This way, user can launch GUI apps.
@mahmoud-ashi thanks for raising this, I will try to include this in the upcoming release.
As a workaround, i used: # Enable auto login for powershell_elevated_interactive to work! # https://gist.github.com/StefanScherer/adbb421dc0adca75b49e0031a99595a5
@Bnaya thanks for sharing this.
@mahmoud-ashi can you describe please your scenario a bit more detail? Do you lack permissions or the consol session (e.g. for GUI apps)?
I would like to share my code, and my use case: https://github.com/Bnaya/vagrant-webdriver-collection/blob/master/Vagrantfile#L31-L42
My use case is, that i want to start webdriver-manager
, and if it's not running with: powershell_elevated_interactive: true,
it doesn't work + after user login it doesn't work
@Bnaya did you also try with setting the privileged
flag? https://github.com/Bnaya/vagrant-webdriver-collection/blob/bbb398fe81cd3a61ea9a0b79a9a023f676ccdd5f/Vagrantfile#L46
According to the docs both are required to make the interactive script work: https://www.vagrantup.com/docs/provisioning/shell.html#powershell_elevated_interactive
@Bnaya any luck with this?
@mahmoud-ashi any luck with this so far? I will add the necessary settings in the upcoming release, but you can try the settings here as well in the meantime: https://docs.microsoft.com/en-us/windows/win32/services/interactive-services. Besides the flag for the service, a global registry key needs to be changed as well.
However, it seems from the article as well that this is a not recommended approach. Could you try something like scheduled tasks for the same scenario?