When an ideal Bose gas is enclosed in two boxes with different volumes connected by a narrow tube, and the temperature is below the transition temperature for Bose-Einstein condensation, it is expected that the particles will be localized in the larger box, because the ground state is localized here. In this paper, we consider the effect of the interaction between particles on the localization using Gross-Pitaevskii theory. Our consideration is limited to the case of positive scattering length and zero temperature. We determine a condition for the localization with an approximate method. It is shown that the system must be extremely dilute or extremely small for localization to occur. The localization condition is confirmed by a numerical calculation.