E. Cobham Brewer 18101897. Dictionary of Phrase and Fable. 1898.
Its all very fine, Ferguson, but you dont lodge here. Capt. Ferguson was the companion of the marquis of Waterford, when that young nobleman made himself notorious for his practical jokes in the middle of the nineteenth century. In one of their sprees the two companions got separated, and the marquis found his way home to the house of his uncle, the Archbishop of Armagh, Charles Street, St. Jamess Square. The marquis had gone to bed, when a thundering knock came at the door. The marquis, suspecting who it was that knocked, threw up the window and said, It is all very fine, Ferguson, but you dont lodge here; and for many years the saying was popular. (See Notes and Queries, Jan. 16, 1886, p. 46.)