You are trying to reinvent the wheel when there is no need to.
To do it your way in Virtualmin just create a subdomain named for each item you want. It’s instant and automatic. Then install the given software at top level.
Going by your example, you have domain.tld. Install wordpress at top level. Then create a subdomain called roundcube.domain.tld. Install roundcube on that subserver at top level.
But the only thing you’re doing is putting the name before the domain instead of after. It’s ridiculous really to go through all of that for what amounts to no difference at all, but it is very simple to do in Virtualmin and it is all automatic no matter which way you want to do it.