This paper describes a test facility for the design and validation of advanced microgrids (MGs) to integrate high penetration of renewable energy and electric vehicles. The UFMG MG laboratory is a joint effort of UFMG, industry, and government. The UFMG MG laboratory is a physical simulation tool for the design, development, testing, and didactic purposes of advanced MG projects under islanded and grid-connected operating modes. Using commercial inverters, and flexible digital control cards, the testbed is modular and flexible in terms of control of inverters, communication technology, and MG architectures. The capabilities of such a testbed in the development of MG management systems are illustrated by means of experimental results considering an advanced MG performing grid-connected ancillary services, such as self-consumption and power factor regulation. The example also highlights the flexibility of the setup incorporating user-adjustable communication latency and user-defined communication failure.