He graduated from the gymnasium in Moscow, entered the electrical engineering faculty, but his studies were interrupted by the First World War.
During World War I, he was in an ensign school, served in the Imperial Russian army and was sent to the front, where he rose to the rank of lieutenant.
During the Russian Civil War, Yermachenka was an officer in the White Army, adjutant of General Pyotr Wrangel, and reached the rank of lieutenant colonel.
In 1921 Yermachenka was appointed ambassador of the Belarusian Democratic Republic in Istanbul and general consul for the Balkans.
On 20 April 1939 Yermachenka sent together with Vasil Zacharka, the president of the Belarusian Democratic Republic in exile, a seventeen-page memorandum to Adolf Hitler personally asking him to take into account the interests of Belarus in any future developments.