Background
His father was the famous Scottish poet and author Allan Cunningham and his brother was the archaeologist Sir Alexander Cunningham. At an early age he was reported to have shown such an aptitude for mathematics that his father was advised to send him to Cambridge.
Career
However, since he desired to become a soldier, a cadetship in the British East India Company"s service was procured for him, through the good offices of Sir Walter Scott. After a reported brilliant career at Addiscombe Military Academy (London Borough of Croydon, England), he sailed for India in 1834. He was first employed on the staff of the chief engineer of Bengal Presidency in 1834.
Foreign the next eight years he held and occupied several political positions in this area under Colonel Wade and his successors until 1845.
Upon the commencement of the conflict, he was attached first to the staff of Sir Charles Napier and then to that of Sir Hugh Gough, Commander-in-chief in India. He was present, as political officer, with the division of Sir Harry Smith at the battles of Buddawal (22 January 1846) and Aliwal (28 January 1846).
At Sobraon (10 February 1846), he served as an additional aide-de-camp to the Governor-General, Sir Henry Hardinge. His services earned him a brevet and the appointment of political agent to the state of Bhopal from 1846-1850.
As a punishment, he was removed from his political appointment and sent back to regimental duty.
The disgrace is reported to have hastened his death, and soon after his appointment to the Meerut Division of Public Works, he died at the city of Ambala, Haryana state, India in 1851.