[3] Viren was of Finnish [fi; ru] descent through his paternal grandfather Johan Petterinpoika Viinikka from Virrat.
After graduating from the Nikolaev Maritime Academy in 1889, he served as a mine warfare officer on the battleship Petr Veliky in 1891 and was promoted to lieutenant commander.
At the start of the Russo-Japanese War, Viren was commanding the Bayan as part of the Russian Pacific Squadron based at Port Arthur.
In 1916, he was awarded the Order of St George, 3rd degree, for personal bravery in preventing the explosion of a powder magazine in the Petrovsky Fort at Kronstadt.
However, after the start of March 1917 February Revolution, Viren was one of several senior officers bayoneted in Anchor Square, Kronstadt, by pro-Bolshevik sailors.