Virus density distribution as a function of genotype considered as a continuous variable and of time is studied with a nonlocal reaction-diffusion equation taking into account virus competition for the host cells and its elimination by the immune response and by the genotype-dependent mortality. The existence of virus strains, that is, of positive stable stationary solutions decaying at infinity, is determined by the admissible intervals in the genotype space where the genotype-dependent mortality is less than the virus reproduction rate, and by the immune response under some appropriate assumptions on the immune response function characterizing virus elimination by immune cells. The competition of virus strains is studied, first, without immune response and then with the immune response. In the absence of immune response, the strain dynamics is different in a short time scale where they converge to some intermediate slowly evolving solutions depending on the initial conditions, and in a long time scale where their distribution converges to a stationary solution. Immune response can essentially influence the strain dynamics either stabilizing them or eliminating one of the strains. An antiviral treatment can also influence the competition of virus strains, and it can lead to the emergence of resistant strains, which were absent before the treatment because of the competition with susceptible strains. © 2020 Mathematical Sciences Publishers.