BACKGROUND: Simulation is widely used to teach medical procedures. Our goal was to develop and implement an innovative virtual model to teach resident physicians the cognitive skills of type 1 and type 2 diabetes management. METHODS: A diabetes educational activity was developed consisting of (a) a curriculum using 18 explicit virtual cases, (b) a web-based interactive interface, (c) a simulation model to calculate physiologic outcomes of resident actions, and (d) a library of programmed feedback to critique and guide resident actions between virtual encounters. Primary care residents in 10 U.S. residency programs received the educational activity. Satisfaction and changes in knowledge and confidence in managing diabetes were analyzed with mixed quantitative and qualitative methods. RESULTS: Pre- and post-education surveys were completed by 92/142 (65%) of residents. Likert scale (five-point) responses were favorably higher than neutral for general satisfaction (94%), recommending to colleagues (91%), training adequacy (91%), and navigation ease (92%). Finding time to complete cases was difficult for 50% of residents. Mean ratings of knowledge (on a five-point scale) posteducational activity improved by +0.5 (p < .01) for use of all available drug classes, +0.9 (p < .01) for how to start and adjust insulin, +0.8 (p < .01) for interpreting blood glucose values, +0.8 (p < .01) for individualizing treatment goals, and +0.7 (p < .01) for confidence in managing diabetes patients. CONCLUSIONS: A virtual diabetes educational activity to teach cognitive skills to manage diabetes to primary care residents was successfully developed, implemented, and well liked. It significantly improved self-assessed knowledge and confidence in diabetes management.