Sharing data between VMs

den

Member
Feb 19, 2015
64
2
6
Hi Guys.

I have my MYDATA folder on VM1. And I want to access that data from VM2. How can I do this?

From the host, I can see inside both VM1 and VM2.

My setup:
<HOST>
> VM1
/var/lib/vz/private/VM1/home/MYDATA

> MV2
(Cannot see MYDATA from VM1)


-----------OR--------------------------------------


Or how can I access data on the host from a VM?
 
Here is what I used on OpenVZ (Proxmox v3.x):

https://openvz.org/Bind_mounts

Example container 301 have /var/backup folder inside vm mount to proxmox folder /backup/hosting1/ispconfig/backup
File: /etc/vz/conf/301.mount

#!/bin/bash
. /etc/vz/vz.conf
. ${VE_CONFFILE}
SRC1=/backup/hosting1/ispconfig/backup
DST1=/var/backup
mount -n -t simfs ${SRC1} ${VE_ROOT}${DST1} -o ${SRC1}
 
  • Like
Reactions: LiSergey