Narrow carbon nanotubes (CNTs) desalinate water, mimicking water channels of biological membranes, yet the physics behind selectivity, especially, relative roles of water and ion interactions within CNT and with surrounding matrix, is still unclear. Here we report ab initio (DFT) inverstigation of the energies involved in transfer of water and ions from bulk solution into bare and water-filled (5,5) nanotubes of diameter 0.68 nm and (6,6) nanotubes of diameter 0.8 nm, more common in experimental studies.In the first part, we will clarify the effect of the medium surrounding CNT, defined by its dielectric constant ε. Since nanotubes need to be embedded in an insulating matrix, ε may have a direct impact on water and ion transfer, yet its effect has not been previously investigated. The transfer energies computed ab initio in the full range 1 < ε < ∞ permit a transparent breakdown to three main contributions: binding to CNT, intra-CNT hydration, and dielectric energy. The results for (5,5) and (6,6) tubes indicate that dielectric energy is small in the case of water transfer. It is however very significant in the case of ions and scales linearly with 1/ε, reminiscent of the Born solvation model, with the slope in the range 75-130 kJ/mol for all analyzed ions and CNTs. This suggests that the dielectric energy is of the order of several tens kJ/mol for CNTs embedded in lipid bilayers (e ~2) and may easily turn ion transfer form preferential uptake to strong exclusion, as observed for K+. In contrast, Cl- appear to be strongly excluded for all ε, thus dielectric energy only enhances the exclusion. Curiously, opposite of conclusions previously drawn from classical MD simulations, ab initio simulations demonstrate that water and ion arrange in a single file in (5,5) tubes, yet it is strongly distorted in (6,6) tubes. Figure below displays most favorable arrangement of water (A) and ions (B,C) in (6,6) tubes. As a result, some species are solvated by more than two water molecules, which significantly affects their overall ion transfer energies, but not as mush its dielectric part.In the second on-going study, we carry out full thermodynamic analysis (including both enthalpy and entropy) of the effect of OH- and H3O+ ions, inherently present in water, on transfer of salt (KCl) and ionic conductance within CNTs. Its main purpose is to rationalize data on ion conductance and its dependence on KCl concentration and pH. Published experimental results indicate that (6,6) channels strongly exclude chloride in neutral conditions thereby conductance predominantly occurs as simultaneous uptake and migration of K+ and OH- ions. This suggests that the energy associated with OH- transfer is several tens kJ/mol lower than for Cl-, however, simulations show no such difference, and cannot explain the abnormally high contribution of OH- to CNT conductance. Based on simulations results, we also reject ion pairing (that may explain recent anion transfer data) and recently proposed electroneutrality breakdown in narrow channels as plausible explanations of the unusually high OH- contribution. However, simulations, currently on-going, point to possibility of some unorthodox transport regimes that might reasonably explain these and other experimental findings. Figure 1