This is inflammation or swelling in your lungs that make it hard for oxygen to reach the blood. Viral pneumonia is pneumonia caused by a virus. About half of all people with pneumonia have viral pneumonia. Viral pneumonia is usually less serious than bacterial pneumonia and can take 2-4 weeks to recover.