In 1799 he became a jinshi following the Imperial Examinations, ranking 140th in the third grade that year before joining the staff of the Hanlin Academy. A succession of official posts followed, including spells at the Ministry of War and the bureaus responsible for managing the affairs of Guangdong and Shandong respectively. In August 1822 he became Governor-general of Guangxi then in November Governor-general of Shaanxi.
After a rebellion broke out in Xinjiang under the leadership of East Turkestani warlord Jahangir Khoja in 1826, the Daoguang Emperor sent Lu Kun to Shaanxi and Gansu where he was to raise troops to retake the four western cities captured by the rebels. He was also to stockpile materiel for the coming attack and arrange the logistics to transport supplies to Xinjiang. Subsequently, a large Qing army recaptured the lost territory and transported Jhoja to Beijing for execution. Lu Kun gained the admiration of Daoguang for his successful accomplishment of this mission and received promotion to first gradescholar-official.
Further promotion
Following on from his success in Xinjiang, Lu received the appointment of Governor-general of Huguang then on 14September 1832 he became Governor-general of Liangguang with responsibility for Guangdong and Guangxi. Canton, the capital of Guangdong, had long been the epicentre of foreign trade with China. Lu now became responsible for the Canton System operated in the southern port by a group of Chinese merchants known as the Cohong from the Thirteen Factories on the banks of the Pearl River.
Lord Napier's visit to Canton
In 1834 Lord Napier arrived in China aboard HMS Andromacheon a mission to open further ports for trade besides Canton. Instead of remaining in Macau and awaiting official clearance as advised, he made straight for Canton where he tried to deliver a letter to Lu Kun. This was a serious breach of normal protocol - the Cohong had been established explicitly to manage all dealings with foreigners. On the orders of the emperor, Lu rebuffed the Englishman's approach: "The Barbarian Eye, if he wishes to come to Canton, must inform the Hong merchants so that they may petition me." Local Mandarins rejected a further letter from Napier and a stand off ensued, which Lu considered a significant diplomatic victory. Lu then issued an edict ordering the British emissary to return to Macao and decreed a temporary halt on trade with Great Britain to back up his words. Many of the British traders believed that forceful intervention by the British government was now inevitable. Napier next tried to circumvent the Governor-general through a direct appeal to the people of Canton. This only made matters worse, leading Lu to announce publicly: "The Barbarian Eye is indeed stupid, blinded, ignorant... there can be no quiet while he remains here. I therefore formally close the trade until he goes." Lu then ordered all British residents to leave Canton and take up residence in Macao. He irked the British further by allowing French, Dutch and American traders to continue as before. In response, Napier gave orders to three British frigates at anchor in the Canton River, which then sailed upstream to Whampoa. An exchange of fire followed between the British warships and shore batteries during which two British sailors died and all 60 Chinese cannon were knocked out. This incident would form part of casus belli for the First Opium War five years later. Lu Kun agreed to let Napier leave Canton for Macao on the advice of his doctor, where the Englishman died a few days later, probably of Malaria. A year after Napier's visit, on 25February 1835, Lu sent a memorial to Daoguang listing "Eight regulations for dealing with foreigners" that brought in further restrictions on the activities of foreign traders in Canton.