Predicting the thermal conductivity of glasses from first principles has hitherto been a very complex problem. The established Allen-Feldman and Green-Kubo approaches employ approximations with limited validity--the former neglects anharmonicity, the latter misses the quantum Bose-Einstein statistics of vibrations--and require atomistic models that are very challenging for first principles methods. Here, we present a protocol to determine from first-principles the thermal conductivity k(T) of glasses above the plateau (i.e., above the temperature-independent region appearing almost without exceptions in the k(T) of all glasses at cryogenic temperatures). The protocol combines the Wigner formulation of thermal transport with convergence-acceleration techniques, and accounts comprehensively for the effects of structural disorder, anharmonicity, and Bose-Einstein statistics. We validate this approach in vitreous silica, showing that models containing less than 200 atoms can already reproduce k(T) in the macroscopic limit. We discuss the effects of anharmonicity and the mechanisms determining the trend of k(T) at high temperature, reproducing experiments at temperatures where radiative effects remain negligible.