HONG KONG — For a taste of what's in store for Americans, look to Hong Kong, where businesses have been enforcing work-from-home arrangements for six weeks because of coronavirus fears.

The social experiment of teleworking en masse has unearthed pitfalls, comical moments and potential opportunities. With the virus hitting the United States and Europe, millions more will probably need to crowd into homes with children and spouses while finding a way to stay productive.

Businesses in Hong Kong say the biggest challenge is getting staff to stay focused and on task. Terence Lin, who runs an online jewelry and used-car sales business, has repeatedly caught employees slacking off on social media and playing games during work hours.

“I can see that they keep logging into Facebook, posting photos on their stories, showing up on online games,” he said of his employees, who are scattered across Hong Kong and several Chinese cities. A favorite is “Wangzhe Rongyao,” or “Honor of Kings,” a multiplayer fantasy battle game based on historical Chinese heroes. “They are always online there, and they think I can’t see them!” Lin said.

Employers, including government departments, closed offices here in January when the coronavirus spread rapidly in China. Though some workers have trickled back to their desks, many corporate offices will remain shut for at least several more weeks.

U.S. companies are preparing for similar: Twitter is encouraging its 5,000 employees to work from home — already mandatory for staff in East Asia. Seattle-based Microsoft and Amazon have urged employees to avoid the office, and banks are preparing contingency plans if the outbreak worsens. (Amazon CEO Jeff Bezos owns The Washington Post.) Facebook asked Bay Area employees, including those at the Menlo Park headquarters, to stay at home from Friday.

In Hong Kong, some businesses are enforcing morning video chats to deter workers from lounging around in their pajamas. Food-delivery companies, online video platforms and virtual private network providers are enjoying a boom in business, bucking wider economic worries.

Some firms have seen the allure of this brave new world — allowing them to cut down on pricey office rents, attract global talent and provide flexibility — and are considering shifting to teleworking full-time.

“All signs point to this being something we will just have to deal with in the long term, so we will just have to be prepared,” said Eric Burns, chief executive of Panopto, a Seattle-based company that provides video streaming and management software to universities as they switch to e-learning.

Interest from China and Hong Kong in its software has surged 1,000 percent compared with a year ago, Burns said, and he is getting inquiries from officials in Seattle and elsewhere in the United States. “It is the same set of problems worldwide,” he said.

Business is soaring for Deliveroo, a London-based food-delivery platform. Brian Lo, the firm’s Hong Kong general manager, said there has been a “massive explosion” in lunch orders, which almost doubled in February from the previous month, while dinner orders also rose as some people avoid eating in crowded restaurants. Overall, he said, orders in Hong Kong were 65 percent higher last month compared with January.

Companies in Hong Kong expect work-from-home arrangements to continue until schools reopen in late April.

Ben Cheng, co-founder of Hong Kong-based software company OurSky, said the firm marked a teleworking milestone this week: celebrating the first remote birthday party for a member of the team. About 30 employees logged into video conferencing app Zoom and sang him a birthday song, he said.

Next, they are considering a remote hot-pot gathering in lieu of monthly team dinners.

“We need to figure out how we do this if this becomes a longer-term arrangement,” Cheng said. “How do you keep a team feeling close to each other, especially when, like us, you are a smaller company? There’s still that need to do some team bonding.”

To keep employees motivated, Lin, of the online platform Jewellery-Box, says he uses apps such as WeChat and DingTalk, a business productivity platform owned by Alibaba, to communicate with staff.

“I can see what time they wake up, what time they check in,” he said. During morning meetings, Lin said employees must switch on their video function. “I require them to clean themselves up, or at least not wear pajamas and look proper for the workday.”

Deliveroo holds a team call every Monday via Google Meets and similarly encourages people to use the camera function.

“Obviously some people are more disheveled than others, but it kind of forces you to be more present,” Lo said.

OurSky and Jewellery-Box are looking to continue remote working beyond the outbreak, hoping to adapt their culture, instill discipline and recruit talent from anywhere.

Cassie Law, a 27-year-old public relations executive in Hong Kong, said she still finds herself in her pajamas late into the morning, glued to her laptop. She feels more pressure to respond constantly to emails compared with when she’s in the office, so she tends to shower later in the day.

“When I miss emails from my boss or clients I worry that they may think I’m not working,” she said.

But there are distractions. Hardest to ignore are her parents, with whom she lives — common in Hong Kong, where rents are among the world’s highest.

“They talk to me all the time,” Law said. “I think they don’t really realize I’m actually working.”

Tiffany Liang contributed to this report.