According to my understanding you can do multiple vm connections. For example I create a setup UPF in one VM, AMF and other microservices is another VM, UE and GNB is another vm and they connect via their IP addresses and work succesfully. Just remember while you running microservices be sure at IP addresses in config files is true and accessible via each other.