In this paper, we propose a binaural system for virtual auditory space synthesis and reproduction. We introduce a subjective listening test for head-related transfer function (HRTF) customization and real-time implementation of ambisonic surround sound over headphones. In this test, a listener first selects the closest-matching HRTF dataset from an existing database. The selected HRTF dataset must fulfill the criteria of front-back discrimination and up-down discrimination. Secondly, the selected HRTF dataset is utilized to build a binaural ambisonic system composed of an encoder for synthesizing multiple sound sources, an image-source model for listening-room simulation, an ambisonic rotator responding to head motion in three axes, and a binaural ambisonic decoder. Additionally, we propose a system optimization technique that minimizes computational cost and enhances audio quality. Finally, we present both subjective and objective measurements of the perceived audio quality that were conducted to validate this approach. The audio quality assessment examined the frequency hearing impairment, localization error, and localization blur. The proposed system is especially suitable for mixing and rendering immersive sound in virtual reality.