On 19 October 1865, MacDonnell was appointed as the sixth Governor of Hong Kong, a position in which he served until 1872. During his tenure, MacDonnell developed Victoria Peak, which would eventually become the premier residential quarters in Hong Kong, accessible only to rich European merchants. MacDonnell also ordered the construction of a hospital which catered to the needs of the local Chinese population. In addition, he legalised gambling in Hong Kong which led to social problems and was later made illegal once again. In 1871 he was gazetted K.C.M.G.