In this capacity, Juan Mackenna convinced the families of Castro, on the island of Chiloé, to move to Osorno to found a colony there. He built the storehouse and two mills, as well as the road between Osorno and present-day Puerto Montt. His successful administration provoked jealousy from Chile's captain-general Gabriel de Avilés, who feared that Juan Mackenna and Ambrosio O'Higgins would create an Irish colony in Osorno. Both Irishmen were loyal to the Spanish crown, though Juan Mackenna had good relations with O'Higgins' son Bernardo, the future emancipator of Chile, and was also connected with the Venezuelan Francisco de Miranda and his group of supporters of South American independence. When Ambrosio O'Higgins died in 1801, Avilés was appointed viceroy of Peru. It took him eight years to remove O'Higgins's protégé Juan Mackenna from Osorno.