CANNES, France — After weeks in the desert, dehydrated and afraid, refugees and migrants who are apprehended crossing the United States-Mexico border are regularly locked in what are called las hieleras: the freezers. They are meant to be short-term holding cells — they have no beds — but they also exact a kind of extrajudicial punishment. As revealed by a Freedom of Information Act request in 2015, migrants are trapped there for nearly two days on average. Children are separated from their families; detainees are deprived of food. Sometimes their lips split. Sometimes their skin turns blue.

The cold of the hieleras is the first thing you feel in “Carne y Arena” (“Flesh and Sand”), a groundbreaking hybrid of art exhibition, virtual reality simulation and historical re-enactment by the Mexican film director Alejandro G. Iñárritu on view here ahead of its art-world debut in June at the Prada Foundation in Milan. You enter a cold-storage chamber, spare but for a few industrial benches, and are instructed to remove your shoes and socks. Dusty slippers and sneakers, recovered from the border zone, litter the floor. Barefoot, you exit the cold room and enter a larger one, its floor covered with sand. Attendants equip you with an Oculus Rift virtual-reality headset, headphones — and a backpack. The darkness gives way, and you find yourself on the border, and in danger.

In the gloaming you can make out an old woman who has broken her ankle, moaning in Spanish for help; a people-smuggler, or coyote, complains in English that they’re slowing down. You can walk through the sand to get close to them, since your headset is equipped with a motion detector. But soon a helicopter appears overhead, its spotlight bearing down on you, and border agents with guns and dogs are ordering you in two languages to put your hands up. With a rifle in your face, you instinctively throw your hands in the air.

Politically urgent and technically accomplished, “Carne y Arena” is the first virtual-reality installation to screen in the official selection of the Cannes Film Festival, which opened its 70th edition this week. Its debut here in an airplane hangar, far from the glamorous Croisette, is a foretaste of its display in arts institutions. Along with its showing at the Prada Foundation, which produced the work with Legendary Entertainment, it will also travel to two museums on either side of the border that President Trump has promised to divide with a wall. The Los Angeles County Museum of Art will host “Carne y Arena” starting in July; the Tlatelolco museum in Mexico City will also feature the VR work this summer.