The Gibeonites had to pretend that they were from far lands in order to make peace with Joshua. When the Jews realized that they had been fooled, Joshua pressed the Gibeonites into servitude.

Nevertheless, Joshua 11:19-20 states that no town sought peace with the Jews because G-d hardened their hearts. 

The case of the Gibeonites supports the general principle that Jews must not leave any aborigines in the land they conquer. Presumably, the aborigines belonged to the six or seven tribes specifically proscribed, but in any case none of the previous inhabitants could remain in the land. The peace, therefore, could only be one of exile: the natives could leave our land peacefully or be killed.

G-d, however, did not want the peaceful option. He hardened their hearts so that the Jews would exterminate them.
How do we know that the aborigines must have sought peace before the start of hostilities? In Joshua 13:13, and elsewhere, it says that several native clans remained in the land. The Jews, the author laments, did not drive them out. He does not entertain the possibility of peace with them because by that time the option of peace has already closed, since the Jews had started their conquest. 

The option to expel rather than exterminate exists only for towns beyond the Land of Israel proper. We can expel natives in expansionist wars, but must exterminate them inside our own borders, says the Tanakh.