Those who left China have little to do but wait.

“I live far away and it’s not easy to buy tickets and plan when to go back to China,” said Diego Rocha, 31, who is in his second year of an M.B.A. at Tsinghua-MIT.

Mr. Rocha, who is now home in São Paulo, Brazil, said that if graduation in the spring is delayed he will have a harder time getting a visa to stay and find a job in China. During the final semester, business students are partnered with a local company, something that is now up in the air.

For foreign students living in a country where information is heavily controlled, many like Mr. Rocha and Ryan Trombly, 19, were caught off guard by the sudden panic, adding to their sense of rootlessness.

“It’s funny because it really came out of the blue for a lot of us,” said Ms. Trombly, a sophomore at Duke Kunshan University, a new academic partnership between Duke and Wuhan University in China.

Just a week before authorities began to shut down entire cities to try to contain the outbreak, Ms. Trombly was on a study tour through Nanjing, Shanghai and Hangzhou. “There were a few foreign articles but no domestic attention on the virus, and so we were traveling without masks,” she said.

By the time she left the country on Jan. 24 for a long-planned visit to see her parents in Phoenix over China’s weeklong Lunar New Year holiday, her local train station — usually brimming with people — was the quietest she had ever seen it.