OWNING 50% OF A US COMPANY on H4

Hi!
I am in the US on a H4 visa. A friend proposed me to open a company here, owning 50% each. He would do all the work. I would just put capital and occasionally share my expertise and suggestions. Clearly I would collect the dividends the company would pay at the end of each year.

Is this legal on H4? I already own American companies shares and I get the dividends, so I see this to be exactly the same right?

thanks!
Mauro