Juozapas Viršilas was born in Būdvietė village, Mosėdis rural district, Kretinga county. He finished Mosėdis primary school in 1937 and Skuodas state gymnasium in 1943. In 1945 he became a student at the Geology Department of the Faculty of natural Sciences of Vilnius University, but later asked to be transferred to the Medical Faculty. His studies were disrupted by Soviet repression: in 1949, Juozapas Viršilas was deported to Irkutsk region. He returned from exile in 1958.