From 3cc5efe9a81e31d0e39c13f99289ab78b244b53c Mon Sep 17 00:00:00 2001 From: "c.soylu" Date: Tue, 11 Jan 2022 11:50:16 +0100 Subject: [PATCH] Included conf files & reformat Readme --- README.md | 23 +++++++++++++++++++---- conf/cloudbase-init-unattend.conf | 23 +++++++++++++++++++++++ conf/cloudbase-init.conf | 29 +++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 conf/cloudbase-init-unattend.conf create mode 100644 conf/cloudbase-init.conf diff --git a/README.md b/README.md index 55fc39f..40c3fb9 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ There is two files that we need to modify Qemu.pm and Cloudinit.pm. * Qemu.pm to get password as cleartext in meta_data drive when it is a Windows VM. * Cloudinit.pm to generate a metadata json file with variables that are compatible with Cloudbase-Init. -## Proxmox Patch +## Install Proxmox patch We have provided patch file for two different versions, if you are on those versions you can simply download it and apply the patch by doing; ``` @@ -43,22 +43,37 @@ If you want to revert the patch: If you want to apply the patch manually you can follow these steps: [Manual Patching](https://git.geco-it.net/c.soylu/Geco-cloudbase-init/src/branch/master/MANUALPATCH.md) -## Cloudbase-Init LocalScripts +## Windows VM Configuration +Create a Windows VM in proxmox and configure it to your needs. + +### Install Cloudbase-Init +Install Cloudbase-Init Continous Build from the [official website](https://cloudbase.it/cloudbase-init/#download). + +Why Continous Build? Because the stable build dates from 2020 and doesn't include functionalities we use. + +### Cloudbase-Init LocalScripts We have [two scripts](https://git.geco-it.net/c.soylu/Geco-cloudbase-init/src/branch/master/localscripts) that do some fonctionality that Cloudbase-Init doesnt have; * Enabling administrator user when it's name is given to the Cloudbase-Init. * Enabling DHCP on the network adapters. Move those scripts into Cloudbase Solutions\Cloudbase-Init\LocalScripts\ in your program files of your Windows VM. -## Powershell Script +### Configure Cloudbase-Init +Deploy [these two conf files](https://git.geco-it.net/c.soylu/Geco-Cloudbase-Init/src/branch/master/conf) to `C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf`. + +Inside those two files modify the `groups=Administrators` to the Windows group that you want your created user to be in. + +### Run PowerShell Script [This](https://git.geco-it.net/c.soylu/Geco-cloudbase-init/src/branch/master/powershell) powershell script has a few uses. * Deletes the "cloudbase-init" user, delegates "cloudbase-init" service to local Systeme user and modifies execution path of the script also to use local system user. * Installs OpenSSH-Server from optional features of Windows. * Removes a store language package that causes an error when generelazing for sysprep. -Run this script after installing Cloudbase-Init Continous Build. We need continous build because the stable build dates from 2020 and doesnt include functionalities we use. +Run this script after installing and configuring Cloudbase-Init Continous Build. +### Run SysPrep When everything is installed simply run below in powershell to launch sysprep: + ``` cd ‘C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf’ C:\Windows\System32\sysprep\sysprep.exe /generalize /oobe /unattend:Unattend.xml diff --git a/conf/cloudbase-init-unattend.conf b/conf/cloudbase-init-unattend.conf new file mode 100644 index 0000000..8087ae8 --- /dev/null +++ b/conf/cloudbase-init-unattend.conf @@ -0,0 +1,23 @@ +[DEFAULT] +username=Administrator +groups=Administrators +inject_user_password=true +config_drive_raw_hhd=true +config_drive_cdrom=true +config_drive_vfat=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 +logdir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\ +logfile=cloudbase-init-unattend.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=false +metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,cloudbaseinit.metadata.services.httpservice.HttpService,cloudbaseinit.metadata.services.ec2service.EC2Service,cloudbaseinit.metadata.services.maasservice.MaaSHttpService +plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin +allow_reboot=true +stop_service_on_exit=false diff --git a/conf/cloudbase-init.conf b/conf/cloudbase-init.conf new file mode 100644 index 0000000..5ee67b4 --- /dev/null +++ b/conf/cloudbase-init.conf @@ -0,0 +1,29 @@ +[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=cdroom +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=true