We study formation process of electrostatic solitary waves (ESW) observed by recent spacecraft via one- and two-dimensional electrostatic particle simulations with open boundaries. The previous simulations have demonstrated that ESW correspond to Bernstein-Greene-Kruskal electron holes formed by electron beam instabilities. However, since the previous simulations were performed in uniform periodic systems, wave-particle interaction of an electron beam instability was taking place uniformly in the systems. In the present study, we inject a weak electron beam from an open boundary into the background plasma to study spatial and temporal development of a bump-on-tail instability from a localized source. In the open system, spatial structures of electron holes vary depending on the distance from the source of the electron beam. In an early phase of the simulation run, electron holes that are initially uniform in the direction perpendicular to the magnetic field become twisted through modulation by oblique electron beam modes. As the electron holes propagate along the magnetic field, they are aligned in the perpendicular direction through coalescence. Spatial structures of electron holes in a distant region from the source become one-dimensional. In a long-time evolution of the instability, ion dynamics becomes important in determining spatial structures of electron holes. A lower hybrid mode is excited locally in the region close to the source of the electron beam through coupling with electron holes at the same parallel phase velocity. The lower hybrid mode modulates electron holes excited in later phases, resulting in formation of modulated one-dimensional potentials. Since the perpendicular electric fields of electron holes are carried by the electron holes at the drift velocity of the electron holes, they can be observed even at a distant place from the source.