[TUTORIAL] HOWTO: Scripts to make cloudbase work like cloudinit for your windows based instances

Would anyone familiar with cloudbase-init be able to test the packaged fix? I tested it a couple of times now but have trouble setting the hostname of the VM, it works when on Mira's (Proxmox) side, maybe I'm missing something, curious about others.

It seems to have made it into the no-subscription repository now, too, after I looked at the code today on one of our no-subscription servers.

What needs testing seems to be:
- Is the hostname of the VM set correctly by cloudbase-init;
- Is the password of the user defined set correctly;
- Is the network configuration set correctly (there seems to be room for more improvement, e.g. multiple nics / dual-stack configs, but the basics work!);
- SSH keys are passed through now, not sure how to test this myself currently.
 
Someone can upload the patched files for Proxmox 8.2.2 ?
/usr/share/perl5/PVE/API2/Qemu.pm and /usr/share/perl5/PVE/QemuServer/Cloudinit.pm

Thanks
 
Someone can upload the patched files for Proxmox 8.2.2 ?
/usr/share/perl5/PVE/API2/Qemu.pm and /usr/share/perl5/PVE/QemuServer/Cloudinit.pm

Thanks
If you update to 8.2.4 (available in enterprise repo), you get the patched version from the repository.
 
Hey,
I’ve installed Windows Server 2025 with Cloudbase Setup. Everything seems to work fine, except that the password set via Cloud-Init isn’t applied. The IPv4 address configured through Cloud-Init works without any issues.

When I start the VM, Windows prompts me to set a new password.

Has anyone encountered this issue before or knows how to fix it?

Additional info:
In Proxmox, the username is set to "Default" by default, while in the Cloudbase Config, it’s set to "Administrator." Even if I change the username in Proxmox to "Administrator," the problem persists.

Thanks in advance!
 
Hey,
I’ve installed Windows Server 2025 with Cloudbase Setup. Everything seems to work fine, except that the password set via Cloud-Init isn’t applied. The IPv4 address configured through Cloud-Init works without any issues.

When I start the VM, Windows prompts me to set a new password.

Has anyone encountered this issue before or knows how to fix it?

Additional info:
In Proxmox, the username is set to "Default" by default, while in the Cloudbase Config, it’s set to "Administrator." Even if I change the username in Proxmox to "Administrator," the problem persists.

Thanks in advance!
Same here with Windows Server 2019, PVE8.3.2 and Cloudbase-init 1.1.7.dev9. I always have to change the password on first start and the username and password set in Proxmox' cloudinit config is ignored.
Is it still needed to patch some Proxmox files? And did you ever find a solution?
 
Same here with Windows Server 2019, PVE8.3.2 and Cloudbase-init 1.1.7.dev9. I always have to change the password on first start and the username and password set in Proxmox' cloudinit config is ignored.
Is it still needed to patch some Proxmox files? And did you ever find a solution?
Did you set first_logon_behavior=no in the cloudbase-init.conf file, as mentioned above and in the docs?
 
Sorry Mira, forgot to mention. Yes, I did.
In the meantime I found out that the password didn't met the complexity standards. This is solved.
But it's still not possible to use the username set in Proxmox cloudinit config.

With this config I expect the user to be proxmox. But it is always changed to Admin.

Looking at the logs it seems, cloudbase-init is reading the username from meta_data.json. But there is none.

cloudbase-init.conf
INI:
[DEFAULT]
username=Admin
groups=Administrators
inject_user_password=true
first_logon_behaviour=no
rename_admin_user=true
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
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
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
check_latest_version=true
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService
plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,
        cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,
        cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin,
        cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin, cloudbaseinit.plugins.common.userdata.UserDataPlugin,
        cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,
        cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,
        cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,
        cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin

META_DATA.JSON
JSON:
{"network_config":{"content_path":"/content/0000"},"admin_pass":"<password>","uuid":"0e6d5741cb810029225256ca05711b409762699a"}

USER_DATA
Code:
#cloud-config
hostname: cloudinit-test
manage_etc_hosts: true
fqdn: cloudinit-test
user: proxmox
password: <password>
chpasswd:
  expire: False
users:
  - default
package_upgrade: true

Here are the relevant log lines:
Code:
2025-01-22 14:50:38.355 2408 INFO cloudbaseinit.init [-] Executing plugin 'CreateUserPlugin'
2025-01-22 14:50:38.355 2408 DEBUG cloudbaseinit.metadata.services.base [-] Using cached copy of metadata: 'openstack/latest/meta_data.json' _get_cache_data C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\metadata\services\base.py:75
2025-01-22 14:50:38.355 2408 DEBUG cloudbaseinit.utils.classloader [-] Loading class 'cloudbaseinit.osutils.windows.WindowsUtils' load_class C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\utils\classloader.py:35
2025-01-22 14:50:38.371 2408 INFO cloudbaseinit.plugins.common.createuser [-] Renaming builtin admin user "Administrator" to Admin and setting password
2025-01-22 14:50:38.449 2408 DEBUG cloudbaseinit.osutils.windows [-] Creating logon session for user: True\Admin create_user_logon_session C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\osutils\windows.py:650
 
Yes, the username can't be set currently from the outside. You have to set it in the cloudbase-init.conf.
And that only works for the Admin user so far.

As far as I know there's no way to pass in a custom administrator username via metadata.
 
Oh. Read about this. But thought this is fixed in the meantime.
Who would have to do some work here? Cloudbase or Proxmox?
 
Oh. Read about this. But thought this is fixed in the meantime.
Who would have to do some work here? Cloudbase or Proxmox?
That's a limitation of the disk-based ConfigDrive datasource we currently use. So this change would have to be in cloudbase-init.
When I get the time, I'll see if anything has changed since the last time I looked.
 
Did you set first_logon_behavior=no in the cloudbase-init.conf file, as mentioned above and in the docs?
Hi @mira, sorry for the late reply.

first_logon_behavior=no is active.

See my config:
Code:
[DEFAULT]
username=Administrator
groups=Administrators
netbios_host_name_compatibility=true
inject_user_password=true
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
ntp_use_dhcp_config=true
real_time_clock_utc=true
ntp_enable_service=true
rdp_set_keepalive=true
enable_automatic_updates=true
logdir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
logfile=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.windows.ntpclient.NTPClientPlugin, cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin, cloudbaseinit.plugins.windows.createuser.CreateUserPlugin, cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin, cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin, cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin, cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin, cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin
allow_reboot=true
stop_service_on_exit=false
check_latest_version=false

Is there anything I should change in my config to make it work better?

Additionally, I have a partition issue: I expanded the disk, but I can't extend the C: partition, and it doesn't expand automatically.

mstsc_Fm65foQQeN.png