Single-stranded RNA (ssRNA) viruses form a major class that includes important human, animal, and plant pathogens. While the principles underlying the structures of their protein capsids are generally well understood, much less is known about the organization of their encapsulated genomic RNAs. Cryo-electron microscopy and x-ray crystallography have revealed striking evidence of order in the packaged genomes of a number of ssRNA viruses. The physical determinants of such order, however, are largely unknown. We study here the relative effect of different energetic contributions, as well as the role of confinement, on the genome packaging of a representative ssRNA virus, the bacteriophage MS2, via a series of biomolecular simulations in which different energy terms are systematically switched off. We show that the bimodal radial density profile of the packaged genome is a consequence of RNA self-repulsion in confinement, suggesting that it should be similar for all ssRNA viruses with a comparable ratio of capsid size/genome length. In contrast, the detailed structure of the outer shell of the RNA density depends crucially on steric contributions from the capsid inner surface topography, implying that the various different polyhedral RNA cages observed in experiment are largely due to differences in the inner surface topography of the capsid.