How open source software companies make profit?

Companies such as videolan, Mozilla, canonical ,etc make open source software. These companies have programmers as employees and they have other expenses such as server maintainance, still they are not in loss. How they make money?