Stanislaw Lem’s The Futurological Congress?
People lived on shelves that were only as big as bunk beds, but, thanks to hallucinogenic drugs, they thought they were living in spacious apartments with all the amenities. Everything they experienced was virtual. Decades before computer graphics or the internet or the personal computer, Lem foresaw our future.