New Question
0

Not able to setup a simple server with nocloud setup

asked 2022-02-06 11:22:31 +0300

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Hi,

i try to install a windows server 2019 with cloudbase-init. I did the following steps to do this:

  • Install a Windows Server 2019 with Desktop Experience
  • Install Cloudbase-Init
  • Added the following lines to "Cloudbase-init.conf" and "Cloudbase-init-unattend.conf".

    metadata_services=cloudbaseinit.metadata.services.nocloudservice.NoCloudConfigDriveService plugins=cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin,cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin,cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin

  • Then i did the sysprep, exported the VM and created a new Hyper-V VM based on teh previous export.

  • The i created a cidata-iso file where i stored meta-data, user-data and network-config files.

meta-data

instance-id: win2019-test
local-hostname: win2019-test
admin-pass: Start123

network-config

version: 1
config:
  - type: physical
    name: interface0
    mac_address: 52:54:00:bd:f9:87
    subnets:
      - type: static
        address: 192.168.28.10
        netmask: 255.255.255.0
        gateway: 192.168.28.1
        dns_nameservers:
          - 192.168.28.1

user-data

#cloud-config
chpasswd: { expire: False }
ssh_pwauth: True
users:
  - name: gisela
    gecos: "Local user created by cloud-init"
    primary_group: Administrators
    passwd: Start123
    inactive: false
    ssh_authorized_keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDKQXrH9ukWnSz3PeX2GwQQmB87Ssfenjou9CWJjp1zvYP/7D3eg8QbF2J4Wty4+89D92FRHC0QxiZbSbrRSmOa6gdF0ikAdHdLVbT6o3nZkaAQZWpoMFWsQNLac7lpgOb60jxCCjEqDVWarUikKoOVhDTon9Tx5E8Iv8ee6fZ6rTJAHQIi6VX9kdNn9NrviM9ILFdzCHsCk3sDsn7qUOWV76S0k61asY7PkkRToCWt692fHeo/eNO2zOButW7blXozOXMxaZIejUBOaGfc49ty5KsEK/G5BJzPib7FkviuXpw/BaHp4N10SRp32cOP6KV6mt4hxlyQUDg70zyg48UdKTnW8gG+ql8+ntGBrM98Juswfydo0J73IzyaVPpAo2nw71qqkMO6goECT7A1UPZgebWQpz7yZp0uJJ1LiS2jisovV7811MXAKuiCmZiQdrVfjVlA3oAhWfOyS80MFsojc+I96o7jx3PnKkKp56i/Il8x2ylLdw8+XmUamLE9Qps= root@hildegard
runcmd:
  - 'echo Custom settings "hello-world from user-data cloud-init script" > C:\Windows\Logs\hello-cloud-init.txt'

When i mount the ISO file and start the VM, it is impossible to login. Administrator is choosen as Login-User and the password is NOT Start123. I think it is randomly generated. Therefore i am not able to access logfiles.

What i have to do to set the Administrator Password to "Start123"?

Regards

Dave

edit retag flag offensive close merge delete

Comments

I'd like to know if you succeeded. I'm now doubting whether NoCloud supports changing the password using admin-pass in meta-data.

shilq gravatar imageshilq ( 2025-09-04 12:45:49 +0300 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2022-02-16 23:34:51 +0300

et5 gravatar image

Make sure you have some of this in your config file

[DEFAULT] username=Administrator groups=Administrators injectuserpassword=true firstlogonbehaviour=no

you can read about each of those here https://cloudbase-init.readthedocs.io... or https://readthedocs.org/projects/clou...

edit flag offensive delete link more

Comments

I'd like to know if you succeeded. I'm now doubting whether NoCloud supports changing the password using admin-pass in meta-data.

shilq gravatar imageshilq ( 2025-09-04 12:45:50 +0300 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-02-06 11:22:31 +0300

Seen: 1,340 times

Last updated: Feb 16 '22