There is a loneliness even in crowded spaces. When we are surrounded by other people, we are still in this thing on our own. This is how Ishmael finds himself as he searches for a place to sleep. He arrives in New Bedford, MA on the weekend, so there will not be a ferry to take him to Nantucket until Monday. He has something like a couple of nickles to rub together, so his accommodations will not be luxurious. There are places he doesn't even consider going because they just look too expensive. He finds his place among the homeless.
Ishmael turns out to have to share a bed with a man who is described as a "dark complexioned" savage or cannibal named Queequeg. At first, Ishmael is frightened of the idea of sharing a room with the man he is told about by the landlord. The place is rundown to Ishmael's liking. There is no fire and it is cold. There is a bar made out of a whale jaw. When Queequeg comes in late, Ishmael is already in bed dreaming up with sort of monster he is awaiting. When it turns out Queequeg brings in his harpoon and a pipe shaped like a tomahawk, Ishmael can't stand it and calls out for the landlord. After the landlord calms them both down, Ishmael agrees again to share the bed and then drifts off to what he calls the best sleep of his life.
Compared to the rest of the people in the town, Queequeg treats Ishmael the best. He even gives Ishmael half of his belongings and tells him that in the tradition of his island, the two men are "married". It is revealed that Queequeg is royalty of a south Pacific island who stowed away on a whaler when he became fascinated with the Christians. He thought that he had something to learn from them to take back to his people, but he found out that men are the same no matter where they are from or how they talk.
Ishmael shows up all alone and knows nobody. He has no concrete plans and has never whaled before. He must be incredibly apprehensive, as we see in his initial reaction to Queequeg. As he orients himself to the seaport city, he finds Queequeg to be the most civilized of all the men he encounters. This is opposite of his expectation and that of the 19th century reader. It is an interesting bit of race relations that would seem trite in modern literature. However, for the time, it must have been pretty radical to have the main character make such fast friends with the person who is most misunderstood and least respected. And Ishmael treats Queequeg with a level of respect that puts off other characters in the book.