Ilya Somin points to a recent discussion of what life would be like if we have virtual reality machines that we could spend most of our life in. He's right to mention that this isn't a new debate based on the technology we now have but goes back (in the technological form) at least to the 70s, with Robert Nozick's experience machine.
There may have been other forms of the discussion. In fact, I'd be surprised if it never came up with the Epicureans, although I know of know extant document raising a similar puzzle for them. But it strikes me as odd that the Stoics or some other group wouldn't have raised the possibility of someone being misled about reality but experiencing pleasure, which seriously separates the two views of what counts as a good life. Epicureans would have to find some contingent reason why it would be bad to get in the machine, e.g. it may break down and then you'll miss it later, which constitutes pain (Epicurus' reason for never eating gourmet food) or someone might program in bad experiences while you're in it, and you'll never be able to get out to change the program back to what you wanted (which is similar to the Epicureans' response to the problem raised by an invisibility ring allowing you to get away with whatever you wanted). On the other hand, most people's reasons for not replacing your real experiences with machine-generated ones (at least as a permanent lifestyle) is because it's not real. That's just a bad life.
Somin's post indicates that he's unsure whether people would turn their life over to such a machine. His reason is that there are lots of people with lots of difference preferences. I think he's right about there being variation of preferences, but I think we all have the same basic preferences based on what's really and truly good. We just make mistakes about what will get us those, and those mistakes might lead some people to get into the machine.
I'm a lot less sure than he is that there would be very high numbers of such people, though, at least if my students are any indication. I present this issue in pretty much every ethics class and every ancient philosophy class I teach. That's been somewhere from 30-60 students every semester for the last several years. Once in a while I get a student who says they'd get in the machine. It's never been more than 2-3 in any given class, and more often than not no one thinks they'd get in. Maybe this is weighted in a certain direction because they're college students or something, but I really have a hard time believing a large number of people would turn their whole lives over to a virtual reality just because it's possible to do so.