Windows 10 Cloudbase-init set registry value during boot

red_book

New Member
Oct 27, 2020
4
0
1
27
Is there a way to set a registry value during boot of a windows 10 VM?
Using snippets?
 
hi,

it's doable but probably not the best way to go about it via PVE snippets.
if you have qemu guest agent installed then you could execute shell commands through that [0] with qm guest exec <VMID> -- <yourcommand>
you could call that with a snippet.



but there are many other ways of doing this using windows-specific methods. you can have a powershell script like this:
Code:
Set-ItemProperty -Path "HKLM:\Some\Registry\Path" -Name "SomeEntry" -Value 123
and make it run at boot. this should set the value of the given path for the registry entry

you can then also add that in your cloudbase-init, with local script execution [1]

[0]: https://pve.proxmox.com/wiki/Qemu-guest-agent
[1]: https://cloudbase-init.readthedocs.io/en/latest/plugins.html#local-scripts-execution-main
 
Last edited: