-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Windows --unattended
doesn't start on boot until at least one login
#3186
Comments
I have an EC2 user data script that looks like this (Pulumi code for reference): const windowsUserData = `<powershell>
Start-Transcript -Path "C:\\UserData.log" -Append
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
choco install tailscale -y
& "C:\\Program Files (x86)\\Tailscale IPN\\tailscale.exe" up --authkey=${tailscale_auth_key} --accept-dns --accept-routes --unattended
</powershell>`;
const windows_build = new aws.ec2.Instance("windows build", {
ami: "ami-08c213ebdf7b857c2",
instanceType: "t2.2xlarge",
associatePublicIpAddress: true,
tags: {
Name: "pulumi windows build",
},
rootBlockDevice: {
volumeSize: 128,
},
keyName: "foo",
vpcSecurityGroupIds: [sg.id],
subnetId: publicSubnets[0],
userData: windowsUserData,
getPasswordData: true,
}); When I start this EC2 instance the machine briefly appears in my Tailscale list of machines on login.tailscale.com. However it quickly disconnects. When I RDP in to the Windows box I see that Tailscale is running but is not authorized (it asks me to sign in). The logs for the user data script don't show any failures, but also don't show any output from Tailscale which is weird. If I wasn't seeing it connect briefly in the Tailscale console I would assume that my 24 hours of powershell experience has led me down a bad path, but it's clearly working at least temporarily:
Is this what the issue is describing? Or is this a different issue? |
I'm not sure what this bug was about. @12nick12, what did you expect to happen? What does "would make it start automatically" mean? Connect to a tailnet? Which? Did you authenticate once already and reboot and it didn't come back up? |
I might be having this problem. Server 2019 Core, installed 1.22.0 and ran tailscale up --unattended. Authenticated, all is well. Reboot and tailscale doesn't run, tailscale status says logged out. |
Still on Windows Hyper-V Server 2019 (It's Windows Server 2019 Core with Hyper-V role preinstalled). Uninstalled tailscale, deleted C:\ProgramData\Tailscale, reinstalled 1.18, tailscale up --unattended, authenticated and rebooted. Service did not reconnect. tailscale-service-20220226T094339-1645886619.txt |
Uninstalled. removed C:\ProgramData\Tailscale. Rebooted. Installed 1.18, 'tailscale up --unattended' authenticated with a different account, confirmed it was up. sc stop tailscale, sc start tailscale and it didn't reconnect, so the problem is not the reboot, it's easy to reproduce just by stopping and starting the service. |
Might be a duplicate of #2137 |
Hey there, more info here: I'm running the following on a machine (both Windows 10 and Windows Server 2019) without tailscale installed with PowerShell as Administrator, using Google Auth on Tailscale:
My machine is successfully connected to tailscale, when I reboot my machine is not connected to tailscale. Happens with both --authkey and without --authkey. If I run The issue seems isolated to the command line Repro steps and more information: With a fresh install, no GUI, no
It's interesting that ForceDaemon is true in there, LoggedOut is false Update: If I toggle the setting in the GUI which produces local settings, then close the GUI then do that sequence again, tailscale still doesn't come back up after redoing the steps above. |
@rlabrecque and @jazzdan I think I have a workaround for you in #2137 (comment) One thing you had wrong, even if this bug is fixed, is in Powershell you need to wait for the MSI installer to finish. You can do this with |
Can confirm this on fresh Windows server 2019 installation. Auth with authkey and --unattended, reboot -> no tailscale connectivity until I login again. After logging in toggled unattended off and back on in Tailscale GUI, reboot, tailscale connectivity now ok without logging in. |
--unattended
doesn't start on boot until at least one login
Possibly related to use of HKLM before anyone has logged in: #2346 |
…t state Numerous issues have been filed concerning an inability to install and run Tailscale headlessly in unattended mode, particularly after rebooting. The server mode `Prefs` stored in `server-state.conf` were not being updated with `Persist` state once the node had been succesfully logged in. Users have been working around this by finagling with the GUI to make it force a rewrite. This patch makes that unnecessary by ensuring the required state is updated appropriately. Fixes #3186 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
…t state Numerous issues have been filed concerning an inability to install and run Tailscale headlessly in unattended mode, particularly after rebooting. The server mode `Prefs` stored in `server-state.conf` were not being updated with `Persist` state once the node had been succesfully logged in. Users have been working around this by finagling with the GUI to make it force a state rewrite. This patch makes that unnecessary by ensuring the required server mode state is updated when prefs are updated by the control client. Fixes #3186 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
…t state Numerous issues have been filed concerning an inability to install and run Tailscale headlessly in unattended mode, particularly after rebooting. The server mode `Prefs` stored in `server-state.conf` were not being updated with `Persist` state once the node had been succesfully logged in. Users have been working around this by finagling with the GUI to make it force a state rewrite. This patch makes that unnecessary by ensuring the required server mode state is updated when prefs are updated by the control client. Fixes #3186 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
…t state Numerous issues have been filed concerning an inability to install and run Tailscale headlessly in unattended mode, particularly after rebooting. The server mode `Prefs` stored in `server-state.conf` were not being updated with `Persist` state once the node had been succesfully logged in. Users have been working around this by finagling with the GUI to make it force a state rewrite. This patch makes that unnecessary by ensuring the required server mode state is updated when prefs are updated by the control client. Fixes tailscale#3186 Signed-off-by: Aaron Klotz <aaron@tailscale.com>
What is the issue?
Have to run "C:\Program Files (x86)\Tailscale IPN\tailscale.exe" up --login-server=https://scale.domain.com --unattended for it to start.
I was under that understanding that --unattended would make it start automatically.
Steps to reproduce
Have to run "C:\Program Files (x86)\Tailscale IPN\tailscale.exe" up --login-server=https://scale.domain.com --unattended for it to start
Are there any recent changes that introduced the issue?
No response
OS
No response
OS version
Windows 10
Tailscale version
1.16.1
Bug report
No response
The text was updated successfully, but these errors were encountered: