A process by which a virus establishes a latent state within its host, either as an integrated provirus within the host genome or as an episome, where viral genome remains in the cytoplasm or nucleus as distinct objects.