He entered the Royal Military Academy at Woolwich on 8 August 1791, and received a commission as second lieutenant in the Royal Artillery on 1 January 1794. He was promoted to lieutenant, on 11 March 1794. In June 1795, he served on the coast of France, in the expedition to Quiberon Bay to assist the French royalists.
In 1799, he went to the Cape of Good Hope and served in the First Cape Frontier War of that year.
That year, he was gazetted captain-lieutenant, on 12 October. On 12 September 1803, he was promoted to captain.
During the Adriatic Campaign, he was at the siege of Ischia in June 1809, and commanded the artillery during the capture of four of the Ionian Islands in October that year. He was at the siege and capture of Santa Maura in April 1810.
On 4 June 1811, he was promoted to the brevet rank of major.
He subsequently went to serve in the Peninsular War in Spain, serving as commander of artillery under Sir John Murray at the battle of Castalla on 12 April 1813 and the siege of Tarragona in June. He was at the battles of Ordal and Villafranca on 12–13 September. During the campaign, he was frequently mentioned in despatches.
Williamson returned to England in 1814.
He was promoted to brevet lieutenant-colonel on 13 October 1814, and to regimental major on 20 December 1814. In the following year went to the Netherlands and commanded the artillery of the 3rd Division at the battles of Quatre Bras and Waterloo.
He served with the army of occupation in France, until his promotion to be regimental lieutenant-colonel on 24 March 1817, after he returned to England. He was for some time superintendent of the Royal Military Repository at Woolwich, and prepared a new and extensive course of instruction in artillery, which formed the basis of the exercise of heavy ordnance and of miscellaneous instructions of the gunner for many years after his time.
On 29 July 1825, he was promoted to colonel.
Williamson died at Woolwich on 26 April 1836. On 30 April 1817 Williamson married a Mission Maclean, of Giese in Caithness.