Virtual fencing (VF) enables livestock grazing without physical fences by conditioning animals to a virtual boundary delimited with an audio tone (AT) and an electric pulse (EP). The present study followed the adaptation process of lactating dairy cows to a VF system with changing virtual boundaries and investigated its impact on animal welfare. Twenty cows were divided into stratified groups (2× VF; 2× electric fencing, EF) of five individuals. Each group grazed half-days in a separate EF paddock of comparable size during 3 d of acclimation (P0), followed by 21, 14, 14, and 7 d of experimental treatment (P1 to P4). At the start of the trial, all cows were equipped with an IceQube pedometer (Peacock Technology Ltd, Stirling, UK) and a VF collar (Nofence AS, Batnfjordsøra, Norway). During P0, cows were accustomed to their first paddock with a deactivated virtual boundary and wearing the sensors. In P1 to P4, an active virtual boundary for the VF groups, and a second EF for the EF groups was set up parallel to an outer EF within their paddock. Throughout the trial, the sensors continuously tracked cow positions and activity behavior at 15-min intervals. From P1 onwards, the VF collars additionally recorded each AT and EP per cow with a georeferenced time stamp. During P0 to P4, daily feed intake, body weight, and milk yield were recorded in the barn. A total of 26 milk samples were collected per cow to determine milk cortisol levels. Behavioral observations were conducted for 2 h on day 23 to record agonistic behaviors, vocalizations, and excretions. The total number of stimuli per cow ranged from 37 to 225 ATs (mean ± SD: 1.9 ± 3.3 per day) and 3 to 11 EPs (mean ± SD: 0.1 ± 0.7 per day) throughout the trial. The maximum number of EPs per day was 8 for an individual cow and occurred once on D1. Mean EP/AT decreased by 55% during the first three half-days of grazing and with each paddock change from 0.2 EP/AT in week 1 to 0.03, 0.02, and 0 EP/AT in weeks 4, 6, and 8, respectively. Linear and generalized mixed effects models revealed that milk yield and cortisol, feed intake, body weight, and activity and lying behavior did not significantly differ between VF and EF groups. A higher number of agonistic behaviors were observed in the VF groups when the VF system was activated. However, due to the short observation periods only few contacts were observed in total. Overall, all cows adapted to the VF system without evidence of lasting adverse effects on animal welfare.