Distributing MySQL and apache for openemr

Is it possible to distribute MySQL and apache on different VMs? If so, can the packages be installed like below?

VM1 - Web server

php php-xml php-mbstring php-mysql apache2

VM2 - Mysql DB

mysql-server

Please confirm the feasibility.

Yes. It’s possible. The Openemr installation must enter the host(IP) where the Mysql server is installed

Yes, as long as you make sure the two machines can route to each other, which isn’t a given if you’re just spinning up two unconnected VMs. If you’re using containers or an orchestration tool you’ll probably be fine.