I think the secret behind making open source profitable is bringing it to the enterprise level. At first I didn't believe you can make a lot of money with open source but after Red Hat got sold for $34 billion I changed my mind. Also GitHub getting sold for $7.5 billion is pretty impressive.
I recommend watching Bob Young's presentation "So You Want To Start an Open Source Company" on YouTube[1], he is the co-founder of Red Hat.