Using a density-functional approach, we calculate the principal vibrational spectra of vitreous SiO2 and vitreous GeO2 and discuss their analogies and differences. For both glasses, we generate model structures consisting of a random network of corner-sharing tetrahedra and differing only by their packing density. The comparison between calculated and measured neutron structure factors supports the validity of our model structures. Our investigation then extends to the vibrational properties, including the inelastic-neutron, infrared, and Raman spectra. For these spectra, good agreement with experiment is also found. Our results support the picture that silica and germania are constituted by a continuous random network of corner-sharing tetrahedra. In particular, the good agreement with experiment for the Raman spectra supports the average intertetrahedral angles of 148 degrees and 135 degrees found in our models of vitreous SiO2 and vitreous GeO2, respectively. The concentration of small ring structures in these glasses is also discussed.