-
Notifications
You must be signed in to change notification settings - Fork 162
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
Autologin *Still* doesn't work. #318
Comments
try |
Thank you for the response. Sorry; that's what I meant—I'll enter |
Is this maybe related to #1 ? |
I'm having the same issue on Windows 10 where the reboot happens and then it sits on the login screen without logging in. When I manually log in I can see Boxstarter already running. |
@yodurr is this also on Hyper-V? |
Yes, on Hyper-V. The particular scripts I'm running are on aka.ms/devsetup We need to dig into this further to identify root cause. |
I have the same problem. Hyper-V on Windows 10 with a Windows 10 virtual machine. After first reboot it is stuck at the login screen. |
I have done demos with this functionality working with Windows 10 Pro 64bit VM. When did this change, as Autologin was working. Could this be something stemming from Windows 1803. Going to try 1703 and report back. |
In 1703, Boxstarter commits a reboot and on reboot I have to manually login. But script continues to run and also prompts me to provide a password, where in 1803 I dont get this prompt regardless on the next run I still had to provide the password. I initially started the script from 32bit powershell |
ok giving up for now I sent all the way back to Windows 10 1511 and still can not get the OS to autologin. Something must have changed in Boxstarter in 2.11 although I checked my at my recorded demo it I used 2.11 on 1803 and was working. |
So I kept digging further. I never checked the registry for this as the autologin process was working at some point. Here is the local user account SID: Here it the Autologin Registry key and points to the correct SID: What I don't see are the following Registry keys: DefaultUserName Which I assume are for hard coded credentials only which is not the intention here for Boxstarter. If the correct SID is being configured could the issue be stemming from the encrypted string for the password? |
ok this has to be a Windows 10 issue I haven't seen until now I used this settings without even installing Boxstarter:
The autologin mechanism seems broken in my machine. I may have to rebuild and try again. |
Boxstarter can keep executing a script/package, even if the autologin is not working. Here's my experiment: Create a new Boxstarter package based on this very simplistic file Invoke-Reboot Which can be turned into a package with a local copy of Boxstarter by running: Import-Module 'C:\ProgramData\Boxstarter\Boxstarter.Chocolatey'
New-PackageFromScript .\reboot.ps1 my.reboot
Copy-Item $Boxstarter.BaseDir . -Recurse Next I copied over the .\Boxstarter\Boxstarter.bat my.reboot The machine keeps rebooting, even if no autologin happens. It seems to me that the user is logged in, but the machine is just locked (similar to how you lock a machine by pressing |
I think, I know the issue with
Then I am trying to run this as part of "userdata" on AWS and it doesn't work, because userdata is executed under SYSTEM account. And the $creds that I am passing are for local admin account. See the code from
|
I thought I had this problem too, but then realized I was using an "Enhanced Session" with my Hyper-V guest. I use this by default (clipboard redirection FTW), and didn't even think to disable this. |
I've been trying to look at this for some time now and finally got to put some time into it and thought I'd pass on what I found. I've been using Hyper-V Vagrant environments to test this out. Before I started I made sure:
I used a very simple script below to kick it off the reboots on each machine (I am also logged in Remove-Item -Path 'c:\vagrant\reboot.flag' -ErrorAction SilentylContinue
$secpasswd = ConvertTo-SecureString "vagrant" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("vagrant", $secpasswd)
Install-BoxstarterPackage -PackageName c:\vagrant\tests\boxstarter-test.ps1 -Credential $mycreds c:\vagrant\tests\boxstarter-test.ps1 is just something that forces a reboot (once): if (-not (test-path 'c:\vagrant\reboot.flag')) {
New-item 'c:\vagrant\reboot.flag' -ItemType file
Invoke-Reboot
}
choco install putty I went all the way back to Server 2008R2 (PowerShell 3) just for belts and braces. Here are the results:
So from the point of view of giving Boxstarter the credentials of the currently logged in user and getting it to reboot into and auto login, I can't reproduce the issue. One thing to note is that Hyper-V will default to opening an Enhanced Session on OS's that have Integration Services installed (from memory that is Server 2012 R2 onwards) and this is like an RDP session so is not auto logged in. What you need to do is make sure you are checking the Basic Sessions (which is effectively the console session). Some people above have mentioned when they log in Boxstarter is already running and this sounds like this is what is happening? I don't want to teach people to suck eggs but I just wanted to make sure it was clear. |
@9denis I am happy to br proven wrong as I'm only looking at the code. Is there anything that says otherwise? |
I've run a few of the scripts from https://github.com/microsoft/windows-dev-box-setup-scripts onto a Server 2016 a Windows 10 1903 Hyper-V Vagrant box and cannot duplicate this issue. When logged in as a Basic Session the boxes reboot when they should and log back in again (over multiple reboots depending on the script). To reiterate what has been said in previous comments, when connecting to Hyper-V you must connect as a Basic Session for the box to autologin and you to see it. If you use an Enhanced Session you are basically using RDP to the box so it will autologin and run the script but you won't see it until you login yourself. So I cannot reproduce this issue. As there has been no update from anybody else on this issue after my last comment I'm going to go ahead and close this. If there is anymore info on this in future I'm happy to open it again. |
Thank you @lukebal after i changed Hyper-V settings to "Basic Session" and starting the virtual machine with the administrator account, the autologin with the given Credentials worked. I'm happy too! This problem costed me really lots of time. Actually I had the problem only with VM. On a real machine boxstarter worked with no problem. |
I have been testing out a Boxstarter script on a local Hyper-V VM but no matter what I do I can't seem to get the machine to automatically log in after restarting. I've tried writing the switch as "-Credential Get-Credential userName", "-Credential (Get-Credential userName)" (as recommended by another user experiencing this issue) and passing the credentials to the switch through a variable, as "-Credential Get-Credential $creds" but I still have to enter my password each time it restarts. I also tried running the Enable-BoxstarterVM command, but it prompted me to install the Hyper-V Powershell module with the following command that failed:
Install-windowsfeature -name hyper-v -IncludeManagementTools
Any help is appreciated; thanks.
The text was updated successfully, but these errors were encountered: