Using a sample of 25 683 star-forming and 2821 passive galaxies at z ∼ 2, selected in the COSMOS field following the BzK color criterion, we study the hosting halo mass and environment of galaxies as a function of their physical properties. Spitzer and Herschel allow us to obtain accurate star formation rate estimates for starburst galaxies. We measure the autocorrelation and cross-correlation functions of various galaxy subsamples and infer the properties of their hosting halos using both a halo occupation model and the linear bias at large scale. We find that passive and star-forming galaxies obey a similarly rising relation between the halo and stellar mass. The mean host halo mass of star-forming galaxies increases with the star formation rate between 30 M yr −1 and 200 M yr −1 , but flattens for higher values, except if we select only main-sequence galaxies. This reflects the expected transition from a regime of secular coevolution of the halos and the galaxies to a regime of episodic starburst. We find similar large-scale biases for mainsequence, passive, and starburst galaxies at equal stellar mass, suggesting that these populations live in halos of the same mass. However, we detect an excess of clustering on small scales for passive galaxies and showed, by measuring the large-scale bias of close pairs of passive galaxies, that this excess is caused by a small fraction (∼16%) of passive galaxies being hosted by massive halos (∼3 × 10 13 M ) as satellites. Finally, extrapolating the growth of halos hosting the z ∼ 2 population, we show that M ∼ 10 10 M galaxies at z ∼ 2 will evolve, on average, into massive (M ∼ 10 11 M ), field galaxies in the local Universe and M ∼ 10 11 M galaxies at z = 2 into local, massive, group galaxies. We also identify two z ∼ 2 populations which should end up in today's clusters: massive (>M ∼ 10 11 M ), strongly star-forming (>200 M yr −1 ), main-sequence galaxies, and close pairs of massive, passive galaxies.