-
Notifications
You must be signed in to change notification settings - Fork 152
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
Change cloudbase-init script runner user #159
Comments
Hello, Can you give more details on what you are trying to achieve by sharing maybe the cloudbase-init config files and how you did install the MSI? If you have userdata that creates a service and a user to run that service, you can do it via powershell, including the user right 'Log on as a service'. Thanks. |
Please see: https://github.com/cloudbase/cloudbase-init-installer/blob/master/CloudbaseInitSetup/Carbon/Service/Install-Service.ps1#L194 if you need to add the privilege to the user. |
I'm installing cloudbase init using the github release msi files. function Install-CloudbaseInit {
Param(
[Parameter(Mandatory=$false)]
[string]$Version="1.1.4",
[Parameter(Mandatory=$false)]
[string]$Arch="x64"
)
Write-Output "Downloading cloudbase-init"
$cbslInitInstallerPath = Join-Path $env:TEMP "CloudbaseInitSetup_x64.msi"
Start-FileDownload `
-URL "https://github.com/cloudbase/cloudbase-init/releases/download/${Version}/CloudbaseInitSetup_$($Version -replace '\.', '_')_${Arch}.msi" `
-Destination $cbslInitInstallerPath
Write-Output "Installing cloudbase-init"
$p = Start-Process -Wait -PassThru -FilePath "msiexec.exe" -ArgumentList @("/i", $cbslInitInstallerPath, "/qn")
if ($p.ExitCode -ne 0) {
Throw "Failed to install cloudbase-init"
}
}
function Invoke-CloudbaseInitSetupComplete {
Write-Output "Running cloudbase-init SetSetupComplete.cmd"
$setupCompleteScript = Join-Path $env:windir "Setup\Scripts\SetupComplete.cmd"
if(Test-Path $setupCompleteScript) {
Remove-Item -Force $setupCompleteScript
}
& "$env:ProgramFiles\Cloudbase Solutions\Cloudbase-Init\bin\SetSetupComplete.cmd"
if ($LASTEXITCODE) {
Throw "Failed to run Cloudbase-Init\bin\SetSetupComplete.cmd"
}
} I call the Install-CloudbaseInit and then copy the cloudbase-init conf files
filename = cloudbase-init.conf
The user is configured (created and given the logon as service) during the image creation flow itself via the following script.
In the userdata section when I'm creating a vm from this image, the service bootup is failing saying the logon service is not avaiable. But logging into the machine using user ('prashant') and then trying to start the service works (service is configured with 'runneradmin'). This image setup is done via packer using
|
Hi,
I'm trying to setup cloudbase init with windows 2022 using packer for azure. I was able to do so, but I need to change the cloudbase init executor user. From my understanding, this is the user that runs the userdata script that I add. Also, can I setup a password for this user?
Additional context for what I'm trying to do:
I want to configure a windows service to be run via this user. I'm not able to configure the service to be run via a local user. It says 'log on as service' is required (which is setup using the same cloudbase init script).
The text was updated successfully, but these errors were encountered: