Virtual image

A real image is the collection of focus points made by converging rays, while a virtual image is the collection of focus points made by backward extensions of diverging rays.

In other words, a virtual image is found by tracing real rays that emerge from an optical device (lens, mirror, or some combination) backward to perceived or apparent origins of ray divergences.

[1] This is observed in ray tracing for a multi-lenses system or a diverging lens.

For a (refracting) lens, the real image of an object is formed on the opposite side of the lens while the virtual image is formed on the same side as the object.

In diagrams of optical systems, virtual rays (forming virtual images) are conventionally represented by dotted lines, to contrast with the solid lines of real rays.

The formation of the virtual image A' of the object A via a plane mirror. For people looking at the mirror, the object A is apparently located at the position of A' although it does not physically exist there. The magnification of the virtual image formed by the plane mirror is 1.
Top: The formation of a virtual image using a diverging lens . Bottom: The formation of a virtual image using a convex mirror . In both diagrams, f is the focal point, O is the object, and I is the virtual image, shown in grey. Solid blue lines indicate (real) light rays and dashed blue lines indicate backward extension of the real rays.