Management and construction to the teaching laboratory can have a significant influence on not only the operation of the lab, but also the motivation and expectation of students, thus resulting in a reduction of their academic progress. To address the problem, a cloud-based virtual computer laboratory is proposed in this paper. It aims to release the burden of the lab's operation management and help to rapidly construct such a virtual lab. In this end, the physical servers are virtualized as a pool with virtual computers by employing OpenStack, and the management services to the class are provided for teachers and students. To further facilitate the construction of such a virtual lab, a configuration scheme of the physical resources for the virtual computer pool is presented, which is compatible with the specific scale of the lab. Also an application example for the lab in a college is detailed, which verified the availability of the solution.