Olympic officials are scrambling to contain an outbreak of the norovirus that has sickened dozens of security guards days ahead of the official kickoff of the 2018 Pyeongchang Winter Games.

Around 1,200 security staff members have been kept in their rooms while they wait to be tested for the highly contagious virus, Olympic representatives said during a news conference on Tuesday. To make up for the personnel shortage, South Korea has deployed 900 members of its military.

At least 41 security guards have tested positive for the virus, which causes stomach pain and diarrhea, according to South Korea’s national news agency Yonhap.

The Olympics will begin on Friday and run through Feb. 25.

The outbreak appears to be centered on security staff members lodging near Olympic sites, but the precise source is unclear.

The first staff members affected were housed in Jinbu, Christophe Dubi, the executive director of the Olympic Games, said during a news conference on Tuesday.

The tap water, the food preparation staff and the food itself are being assessed to trace the route of transmission, according to a statement from the Pyeongchang Organizing Committee.

“As soon as a case, if any more, is identified,” Mr. Dubi said, “of course it is reported, then all the areas get disinfected.”

Mr. Dubi added that while officials did not know the exact source of the virus, the food and beverages at the lodging were up to international safety standards. The guards being tested will remain in their quarters until they are deemed to not have the virus, Lee Hee-beom, the chairman of the organizing committee, said.

Norovirus is best known in the United States as the “cruise ship virus” and in Europe as “winter vomiting flu.”

It is a frequent cause of outbreaks of vomiting and diarrhea on board ships, in nursing homes and in children’s day-care centers, especially in cold weather. The virus is not typically serious for otherwise healthy adults or teenagers, although it can cause several days of misery and dehydration.

Severe dehydration can endanger people unable to take in fluids by themselves, such as young children, the elderly and people with underlying conditions. The most common symptoms of the gastrointestinal disease are nausea, diarrhea and stomach pain, along with fever, headaches and body aches.

It is spread by touching contaminated surfaces, caring for sick people or eating uncooked food that people with the illness have touched. According to the Centers for Disease Control and Prevention, it is the leading cause of outbreaks of food-borne illness in restaurants and salad bars in the United States.

Most of that is from food contaminated by human hands before serving, but fruits and vegetables can be contaminated by sewage in water used to grow them, and oysters or other shellfish can pick it up from sewage. There are many strains of norovirus, so people can catch it more than once in their lives.

Officials said pamphlets detailing the dangers of the virus and ways to avoid contracting the illness would be distributed to those visiting the Olympic sites.