[SOLVED] Cloudbase Init, do not reset password

spacemancw

New Member
Feb 2, 2024
18
0
1
Trying to get cloudbase init working. I am able to assign an IP address to a new cloned VM and set the hostname. But when the new VM first starts up, it asks me to change the password.

I want the Administrator account to have the same password as the VM template. A prompt waiting for the Administrator to change the password doesnt fly with automation.

I follow the template creation steps for cloudbase init, install cloudbase init, set the conf I want .. maybe my conf is wrong, then run the sysprep :

Code:
cd "C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf"
C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /unattend:Unattend.xml

my conf looks like:
Code:
[DEFAULT]
username=Administrator
groups=Administrators
inject_user_password=false
first_logon_behaviour=no
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
locations=cdrom
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService
verbose=true
debug=true
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
enable_automatic_updates=true
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
log_file=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
logging_serial_port_settings=COM1,115200,N,8
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin, cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin, cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin, cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin, cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin, cloudbaseinit.plugins.common.userdata.UserDataPlugin
allow_reboot=true
stop_service_on_exit=false
check_latest_version=false

then I do :

Code:
qm clone 1007 1008 --name RMCPX01 --full
qm set 1008 --ciuser Administrator
qm set 1008 --cipassword `"$password`""
qm set 1008 --ipconfig0 ip=10.120.10.36/24,gw=10.120.10.254
qm set 1008 --searchdomain acme.corp --nameserver 10.40.10.185,10.50.10.185
qm set 1008 --hostname RMCPX01
qm cloudinit update 1008
qm start 1008

The VM starts up, gets the IP and hostname and DNS, but at the console it asks for a password change.

Do I need inject_user_password=True?

I tried without doing qm set 1008 --cipassword `"$password`"" at all
As the template already has the password I want .. I feel I shouldn't have to touch any password functions .. but maybe that's wrong
Do I need other plugins?
The proxmox environment is 8.3.4

thanks
 
Last edited:
Ok .. I got it working.

My conf file is:



Code:
[DEFAULT]
username=Administrator
groups=Administrators
inject_user_password=true
first_logon_behaviour=no
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
debug=true
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
enable_automatic_updates=true
locations=
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
log_file=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
logging_serial_port_settings=
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
plugins=cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin, cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin, cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin, cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin, cloudbaseinit.plugins.common.userdata.UserDataPlugin
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService
allow_reboot=true
stop_service_on_exit=false
check_latest_version=false


I keep all the qm set commands as they were.
The VM does its out of the box experience on start up, reboots a few times, sets the hostname, IP info and does not ask for a password.

now I can move ahead and use powershell invoke-command to make other changes inside the OS, join domain etc.
 
Ok .. I got it working.

My conf file is:



Code:
[DEFAULT]
username=Administrator
groups=Administrators
inject_user_password=true
first_logon_behaviour=no
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
verbose=true
debug=true
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
enable_automatic_updates=true
locations=
log_dir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
log_file=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
logging_serial_port_settings=
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
plugins=cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin, cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin, cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin, cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin, cloudbaseinit.plugins.common.userdata.UserDataPlugin
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService
allow_reboot=true
stop_service_on_exit=false
check_latest_version=false


I keep all the qm set commands as they were.
The VM does its out of the box experience on start up, reboots a few times, sets the hostname, IP info and does not ask for a password.

now I can move ahead and use powershell invoke-command to make other changes inside the OS, join domain etc.
Hi, I tried following this tutorial: YouTube, but it doesn’t even prompt me to reset the password. Ideally, I’d like to get Cloudbase-Init working, but nothing seems to work. I’ve been struggling with this for seven days and nights—tried changing configs and images, but without success. When I clone the machine, I just end up logging into the same account with the same username and password.