HA on VM Rpi 4 - GPIO setup

Hi there, as i am fighting with GPIO for more than 3 weeks i would like to ask for your help. I am running HA on VM at Raspberry 4 and would like to have my PIR sensor at BCM 4 working. As i read i need to setup enviroment bcs of VM but i am really do not know where to put it and what to put it :sob: can you guys help me please?

If you do get the vm talking to the gpio be prepared to replace the gpio integration (it is not reliable). Details in this issue post: