New scientific knowledge is needed more urgently than ever, to address global challenges such as climate change, sustainability, health, and societal well-being. Could artificial intelligence (AI) accelerate science to meet these global challenges in time? AI is already revolutionizing individual scientific disciplines, but we argue here that it could be more holistic and encompassing. We introduce the concept of virtual laboratories as a new perspective on scientific knowledge generation and a means to incentivize new AI research and development. Despite the often perceived domain-specific research practices and inherent tacit knowledge, we argue that many elements of the research process recur across scientific domains and that even common software platforms for serving different domains may be possible. We outline how virtual laboratories will make it easier for AI researchers to contribute to a broad range of scientific domains, and highlight the mutual benefits virtual laboratories offer to both AI and domain scientists.