Onboard CBCT for radiation linear accelerators suffers from limited longitudinal coverage and various image quality problems, especially at wider cone angles. Such problems prevent CBCT being applied in full potentials for many clinical cancer sites, including head-neck, and for many quantitative applications, including tumor response evaluation and daily radiation dose computation. We propose to use CBCT with flexible X-ray source trajectories to overcome these limitations. The core idea is to combine gantry rotation with simultaneous couch motion. Longitudinal coverage can therefore be extended without limitation. Image quality can be enhanced by applying advanced exact CBCT reconstruction algorithm. However, unlike diagnostic CT where helical CBCT is widely used, LINAC onboard CBCT because gantry can only rotate within 360 degrees and couch table cannot move during gantry rotation. To solve the hardware problem, we program the new Varian TrueBeam LINAC machine in developer mode to realize simultaneous gantry and couch motion so to simulate any flexible scan trajectories. We also implemented CBCT simulation algorithms with digital phantoms to support any flexible source trajectories. We implemented and improved Katsevich exact reconstruction algorithm for image reconstruction from projection data obtained in phantom simulations. We have studied a few different source trajectory models including double circle, helical and saddle. The initial digital phantom results were encouraging. The longitudinal coverage was extended. Image quality has been improved using Katsevich reconstruction algorithm. Physics phantom studies on TrueBeam LINAC machine is our next step.