We present results from atomistic molecular dynamics simulations to characterize the effects of cosolvents, such as urea and guanidinium (Gdm) salts, on the water confined in hydrophobic carbon nanotubes. We observed complete drying of the nanotube interiors of diameter ranging from 8 to 17 Å in urea. In contrast, the water population within nanotube cores smaller than 12 Å remains unaffected in GdmCl solution, whereas larger nanotube interiors become partially dehydrated with prevailing presence of stable Gdm +-Gdm + dimers. The molecular arrangement and the lifetime inside the nanotube were found to be characteristics of a particular cosolvent. In both urea and GdmCl solutions, preferential cosolvent intrusion resulting in nanotube dehydration is driven by the stronger dispersion interaction of cosolvent than water with the nanotube. The partial drying of the hydrophobic core is attributed to guanidinium's better hydration and weaker self-association propensity compared to urea, as well as to its moderate ion-pairing with strongly hydrated chloride ions. The Gdm + induced dehydration varies with the charge density of counter-ions, as the presence of high charge-density sulfate ions impedes penetration of guanidinium, and consequent dehydration of the nanotube. These findings provide important insights into the effect of cosolvents on the nano-confined water in a hydrophobic environment. © 2012 The Royal Society of Chemistry.