I don’t remember much about this movie anymore as I’ve seen it a few years back on the TV. I’m quite sure that it is indeed a movie and not a TV show episode.
The main protagonist is male (probably white). He works at a huge factory in the middle of a desert. I believe he lives in a nearby town, just like all the other workers and there’s a road leading to the factory.
The factory sort of “farms” humans. There are vast rooms filled with people connected to some sort of a virtual reality (here is the similarity to Matrix). They lay on tables with screens above their heads, onto which the virtual reality is projected.
Many people work at the factory, but most of them are oblivious to the true purpose of the factory. I have no idea what they believe the factory does or what the purpose of the human farm is. I think all of the “slaves” were being born inside of the factory as well.
The main protagonist has a friend in a maintenance section of the factory. Every day during lunch break they meet in the maintenance area, where the main protagonist shouldn’t have access. Him being there leads to the discovery of the true nature of the factory. The leadership of the factory finds out he knows too much and they want to get rid of him. However, he managed to escape the factory (possibly with someone else – either his friend from maintenance or a woman). He proceeds to run across the desert to a nearby town, more specifically some sort of a pub, from where he makes a call to someone. He wants to free all the slaves obviously.
I mainly remember the part when he’s running across the desert, being chased by helicopters and soldiers for hours.
It’s possible that the factory was protected by some kind of an electromagnetic field and robots / clones were somehow involved, but I’m not too sure about that.