Grim, mainly single-sex dormitory blocks dotted round South Africa's main cities, the hostels are one of the lesser-known legacies of apartheid and the migrant labour system enforced on blacks by the white minority rule that ended two decades ago.
Associated with Dickensian poverty, crime - and, in many cases, Zulu tribalism - they played a major role in the wave of anti-foreigner violence last month in which at least seven people were killed.
Story
Now the anger in the hostels is directed at the hundreds of thousands of African migrants coming to South Africa, either fleeing persecution elsewhere on the continent or seeking work.
They do not have the contacts to enter the hostels, but find meagre accommodation in the townships where they are based.
"In my grandfather's days there were a few foreigners but now foreigners are more than us," said Musa Nkabinde, who knew no-one in Johannesburg when he came looking for work five years ago, but the 22-year-old knew exactly where to stay - the same place as his grandfather and thousands of other migrant workers before him: the hostel.
"This place is not good for us. But we don't have anywhere else to go."
Nkabinde pays just 27 rand ($2.28) a month for his tiny share of floor space in the small room he shares with 14 other men.
The government is considering asking hostel dwellers to leave for temporary shelters while unspecified "permanent units" are built, a prospect that does not appeal.