The same way you connected to it without Compass, but inside of compass. Route it through the VM hiarchy to where the server is.
Make sure you have network pass through and so on as appropriate to the VM itself, you’ll essentially connect to the VM just like you would any other remote server, and then from the remote server into the MongoDB Database.
The hard part in answering this, is this depends all on how you’ve configured your host system, your VM, and MongoDB.
@Universal_Simplexity something you can use to make this all easier is instead of a VM or in addition to your VM (set network as pass through of this is academic, otherwise build a proxy and yada yada) is setup Docker to host MongoDB, and then setup Kubernetes to handle all of the network and routing services to MongoDB.
For me I’m a big DevOps guy personally, I use Docker and Kubernetes anytime that I can, because it’s SO easy to setup once you understand it. Can spin up, route and connect anything etc. handle encryptions, firewalls, all of that jazz. I try to avoid VMs unless it’s going to host things like as a server. Then I’ll make a host VM and load it with containers and internetwork the containers.
Then route between VM servers using mininet to a similar way you’d network if you had physical racked servers connected to a network switch etc.
Even an M1 Mac Mini with 8 GB of RAM can handle a lot of MongoDB, web servers etc. the largest container is my Apollo GraphQL which serves as a replication sync, and data transit node to orchestrate data between an 11 node MongoDB replica set, 5 Redis DB replica sets, and 5 CouchDB replica sets. All in 100% sync with 3GB of RAM allocated to it.
By the end of this week.
Node JS and MongoDB accessed via Mongoose is my minimal requirement to deliver a RESTful API microservice to find favourite movies against movies dataset from Kaggle given a userid.
Out of curiosity …
Why would this happen even after a full installation?
Mar 30 09:59:45 simplexity2204 systemd: Started MongoDB Database Server.
Mar 30 09:59:45 simplexity2204 systemd: mongod.service: Failed to locate executable /usr/bin/mongod: No such file or directory
Mar 30 09:59:45 simplexity2204 systemd: mongod.service: Failed at step EXEC spawning /usr/bin/mongod: No such file or directory