Bandanna that covers all the hair (including bundled up length somehow....I have to do a wide pancake flattish bun or too much hair sticks out and the helmut won't go on), tied on the back of the head. Then helmut. Consider a silk scarf. I cover my forehead with the bandanna/scarf. I do not fold precisely in half because I need a triangled tail to go all the way over my hair in the back, and then tie on top of that so it holds.
When the helmut comes off, if it's tight, the bandanna might too.
That's how I do it.