I have two VMs (linux) in Azure. Both are in the same Vnet. Logging through Vm1 (, i can easily ping Vm2(, that means both can comunicate. Now I have an external drive mount in Vm2, it called /data. My question are:

  • how can I move directories from Vm1 to Vm2 mounted drive?
  • can I add a symbolic link from a directory in Vm1 to Vm2?

NB: I can do the above in the same VM i.e. external drive mount in VM1 and move data from C disk to mounted disk.


For now, Azure does not support mount one disk(VHD) on two VMs, so you could not move directories from Vm1 to Vm2 mounted drive. As David said, a symbolic link does not support cross VMs.

On your scenario, Azure File Share is a choice. Azure File Share supports mount on multiple VMs. Applications running in Azure virtual machines or cloud services or from on-premises clients can mount a file share in the cloud, just as a desktop application mounts a typical SMB share. Any number of application components can then mount and access the File storage share simultaneously.

More information about how to use Azure File Storage with Linux please refer to this link.

  • thank you Walter for your answer. I'm gonna learn Azure File Storage. One more thing : can we have symbolic link between my VM directory and Azure file Share? – user2946641 Jan 26 '17 at 1:27
  • I suggest you mount your VM directory on Azure File Share. After you do this, your VMs could read and write the directory. – Shui shengbao Jan 26 '17 at 1:33
  • @user2946641 You could create symbolic on file Share. It is easy for you to use ln -sf – Shui shengbao Jan 26 '17 at 1:35
  • Thank you very much Walter, i will try that and let you know. – user2946641 Jan 26 '17 at 1:37
  • @user2946641 It's my pleasure. – Shui shengbao Jan 26 '17 at 1:38

You cannot add a symbolic link that crosses machine (or VM) boundaries. To see a disk from a different machine, you'd either need to share the disk (e.g. smb share) that other machines could then connect to on the vnet, or use something like Azure File Storage (an smb share in blob storage). Once an Azure File Storage share is mounted, you may then create symlinks to specific folders within the share, just like you'd do with a local disk.

As for copying / moving between machines, Linux has a built-in scp utility (which sits atop ssh for secure file-copying). This is different from a command-line cp or mv since it requires specific parameters such as credentials.

  • Thank you David. Good to learn new thing : Azure File Storage. After mounting the file share in my VM, will i be able to make a symbolic link between directory in Vm1 the file shared? – user2946641 Jan 26 '17 at 1:32
  • see edit. TL;DR yes – David Makogon Jan 26 '17 at 1:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.