Virtual Fencing (VF) can be a helpful technology in managing herds in pasture-based systems. In VF systems, animals wear a VF collar using global positioning, and physical boundaries are replaced by virtual ones. The Nofence (Nofence AS, Batnfjordsøra, Norway) collars used in this study emit an acoustic warning when an animal approaches the virtual boundaries, followed by an aversive electrical pulse if the animal does not return to the defined area. The stimuli sequence is repeated up to three times if the animal continues to walk forward. Although it has been demonstrated that animals successfully learn to adapt to the system, it is unknown if this adaptation changes with animal age and thus has consequences for VF training and animal welfare. This study compared the ability of younger and older dairy cows to adapt to a VF system and whether age affected activity behavior, milk yield, and animal long-term stress under VF management. The study was conducted on four comparable strip-grazing paddocks. Twenty lactating Holstein-Friesian cows, divided into four groups of five animals each, were equipped with VF collars and pedometers. Groups differed in age: two groups of older cows (4 lactations) and two groups of younger ones (first lactation). After a 7-d training, paddock sizes were increased by successively moving the virtual fence during four consecutive grazing periods. Throughout the study, the pedometers recorded daily step count, time spent standing, and time spent lying. For the determination of long-term stress, hair samples were collected on the first and last day of the trial and the hair cortisol content was assessed. Data were analyzed by generalized mixed-effect models. Overall, age had no significant impact on animal responses to VF, but there were interaction effects of time: the number of acoustic warnings in the last period was higher in younger cows, and the duration of acoustic warnings at training was shorter for older cows. Moreover, younger cows walked more per day during the training. Finally, no effects on milk yield or hair cortisol content were detected. In conclusion, all cows, regardless of age, adapted rapidly to the VF system without compromising their welfare according to the indicators measured.