On 7 March 1870 MacDonald joined the Inverness-shire Highland Rifle Volunteers, and in 1871 enlisted in the
92nd Gordon Highlanders at
Fort George. He rose rapidly through the noncommissioned ranks, and had already been a
Colour Sergeant for some years when his distinguished conduct in the presence of the enemy during the
Second Afghan War led to his being offered the choice of being recommended for the Victoria Cross or commissioned in his regiment; he chose the latter. This was an extremely rare honour (7 January 1880). MacDonald served as a
subaltern in the
First Boer War (1880–81), and at the
Battle of Majuba Hill, where he was made prisoner, his bravery was so conspicuous that
General Joubert gave him back his sword. In 1885 he served under
Sir Evelyn Wood in the reorganization of the Egyptian army, and took part in the
Nile Expedition of that year. In 1888 he became a regimental captain in the British service, but continued in Egyptian service, concentrating on training
Sudanese troops. In 1889 he received the
Distinguished Service Order for his conduct at the
Battle of Toski and in 1891, after the action at
Tokar, he was promoted substantive major. After Omdurman, MacDonald became a household name in Britain. He received a brevet promotion to
colonel in the British Army, appointed an
aide-de-camp to
Queen Victoria, and received the thanks of Parliament and a cash award. His fame was especially high in his native Scotland: on 12 May that year, described as "one of the heroes of Omdurman," he was entertained to luncheon by the
City of Edinburgh Council, and many Scots felt that MacDonald, and not Kitchener, was the true hero. '', 27 December 1899 In October 1899, MacDonald received the temporary rank of
brigadier general and was seconded to command the
Sirhind district in the Punjab with headquarters at
Umballa. Following the outbreak of
war in South Africa the same month, he was in December ordered there to command the
Highland Brigade, part of the army of
Lord Roberts. He received the substantive rank of colonel on 4 January 1900, arrived in
Cape Town on 18 January 1900 by the transport Dwarka, and six days later assumed command of the Highland Brigade stationed at
Modder River, with the local rank of
major general. While in South Africa he prepared the way for Lord Roberts's march to the
relief of Kimberley by seizing Koodoesberg (5–8 February 1900), and by this demonstration the attention of the Boers was distracted from the main advance. Later the same month he took part in the
Battle of Paardeberg (16–27 February 1900), where he was wounded by a gunshot in the foot in an attack on a Boer laager. He was discharged from hospital in mid-March, and took part in later operations in
Bloemfontein and
Pretoria. In April 1901 he was knighted as a
Knight Commander of the Order of the Bath (KCB) for his services (dated to November 1900). MacDonald returned to the United Kingdom in May 1901, but soon left for India where he had been appointed to command the South District Army, and was in command of in
Belgaum district, near
Madras. In early 1902 he was appointed Commander-in-Chief of British troops in Ceylon (now
Sri Lanka) with the temporary rank of major general while so employed, and he arrived there and took up the command on 26 March 1902. ==Ceylon: scandal and suicide==