Specifically I am looking for any CLI commands that can do the job.Two VM's exist on a server both are red hat linux based.Thank you
Specifically I am looking for any CLI commands that can do the job.Two VM's exist on a server both are red hat linux based.Thank you
While the best way would be to use the network, like SSH, SCP, rysnc or NFS, there are ways to share files at the virtual host level between 2 VMs. However, this is typically harder to configure and more prone to errors. I would suggest a network approach for all but special use cases.
In VMware for example, you can setup a virtual disk and share it to the two VMs. However, you need to be very careful with how you do this - because most OSes will expect to have their own disk and have full control over it, and might behave unexpectedly when another VM modifies that disk.
Protocols like NFS take care of this for you, and NFS is a lot cleaner solution for this problem.
Well the whole point of VMs is to be able to isolate your running code. For example, you want to run two Apache instances but you don't want anything to be shared by them so you build two VMs and now you can run them in isolation on the same server (where the VMs run). So the only way to transfer files between VMs is by normal server file sharing mechanisms like scp or rsync or nfs mounted file systems or samba mounted file systems. Otherwise you are hacking the virtual machine environment. Maybe instead of running VMs you want to run something a little more hackable like containers or even a chrooted environment to "isolate" your running code?