After so long, let's talk about the respective features of the file sharing solution between virtual machines and physical machines (which may be supplemented from time to time) and virtual machine file sharing.

Source: Internet
Author: User

After so long, let's talk about the respective features of the file sharing solution between virtual machines and physical machines (which may be supplemented from time to time) and virtual machine file sharing.

Recently I had an idea, so I started to think about it. Now I write some conclusions for future reference:

The requirement is that there is a virtual machine system centos and a physical machine window, and the contents in a directory can be shared and synchronized with each other. Whether it is to modify the system files there, it immediately seems that there is no gap to synchronize to another system,

But only content synchronization should be treated like internal files in the respective directories, but content sources are different from common hard disk partitions.

In the vernacular example, the/home/abc.txt in centos and the d:/abc.txt in the window point to the same storage space. However, the other attributes of the respective files are independent of the system and have no function missing,

For example, the mode on the centos system, uid/gid, or the link function and acl, etc. Then we will compare whether the several solutions have obvious characteristics;


1.

The sharing function provided by virtual can map window files to centos. The advantage is that the configuration is very convenient and can be automatically mounted. one of the major disadvantages is that the user/permission of the file is specified during mount and cannot be changed by chmod/chown. If you need different permissions for each file, you can only give up on it.


2. (s) ftp sharing: It is not bad for pulling or uploading, but it is insufficient for the main notification form requirement. If you want the server to change a file, notify the client that it cannot be done. What should I do? actively query the status of all files. if there is no need for real-time synchronization, You can discard this text;


3. webdav, although put, delete, and query are implemented on the basis of http post and get, there is not much difference between it and ftp unilateral pull query, not to mention the few poorly configurable parameters. The real-time and server-side operation permissions cannot be met. Therefore, in a big sense, its deficiency is no different from sftp;


4.

Smb sharing. Although it has more powerful and common functions than virtaulbox's built-in parameters, you cannot change the attributes of a file by using chmod in centos, it is also specified during mount. this product will not prompt errors, it will only let you do your work in vain, so you can give up different permission requirements for different files, its goal is only to be compatible with different systems to share, real-time file synchronization is sufficient;


5.

Virtualbox and host window write physical partitions at the same time: Although virtualbox supports advanced users to mount physical partitions to a customer system, if it warns: the same partition cannot be written by guest and host at the same time. Otherwise, the partition data may be disordered. I guess there is no such system (window/linux) that is considering sharing partitions with other systems during design, for example, the window system disk C and the other system directly format it. What should we do? The usage of physical partitions in virtualbox is named "raw hard disk access". You can obtain the relevant details by querying the help manual. Therefore, this solution cannot meet the shared data requirements;


6. ntfs-3g, this component only provides access to ntfs in a way that simulates linux, and is not a tool for synchronizing shared partitions; from the instruction documentation, there is no attempt on this, if you want to share a partition, you should at least cooperate with solution 5. I think it is unlikely that I will not test it if I reach my goal;


6. rsync

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.