How does windows share with virtual machine linux?
File Sharing between virtual machine linux and widows host
Use the shared folder function of virtual machines
Use the shared folders feature in vmware (vmware workstation 5) to transfer files between hosts and ghosts in vmware, without any network-related settings or any network protocol, the host and ghost can be linux and windows operating systems. Here we only introduce that the host is windows and the ghost is set in linux. If the ghost is windows, see setting up shared folders in the help of vmware.
1. Install vmtools for linux:
Choose VM> install vmware tools from the VMware workstation program menu...
Choose VM> removable Devices> CD-ROM> Edit> use iso Image from the vmware workstation program menu (select linux. iso in the vmware installation directory)
Start linux on the guest computer and execute:
Mkdir/mnt/cdrom
Mount/dev/cdrom/mnt/cdrom (the vmtools Installation File is placed in the vmware virtual cdrom. First, you must mount the optical drive to find the Installation File)
Cd/mnt/cdrom
Tar-zxvf VMwareTools-5.5.3-34685.tar.gz/tmp (unzip the installation file to/tmp)
Cd/tmp/vmware-tools-distrib
/Vmware-install.pl
(Run the vwware installation script, which is written in perl)
Here, the installer will ask a series of questions, such as the location of the installation file and the resolution setting. In most cases, the installation of the default vmware tools configuration can work normally, click the Enter key to select the default configuration for each problem.
After the installation, vmware will add a vmhgfs module to the kernel. You can use lsmod to view
2. Set the directory shared by the host computer:
Switch to windows desktop in ghost computer, and choose VM> Settings> Options> Shared Folders from the vmware workstation program menu.
Click "add" in the lower-right corner of the dialog box and click "Next"
Enter the name of the shared directory in the text box "name" (the directory name entered here will be displayed in the linux System of the ghost computer with the same directory name), for example, pai_file; in "host folder", enter the directory to be shared by the windows System in host computer. Assume It is D: \ share and click Finish.
In the next dialog box, select the sharing mode: Enable this share indicates that the sharing is valid for a long time and the directory can be Read and written; Read-only means that the sharing is valid for a long time and the directory is Read-only; disable after this session means that the sharing will expire after the ghost computer is shut down or suspended next time. Generally, select Enable this share and click "finish"
Since then, shared folder settings have been completed
3. Use of shared folder directory
Switch to the linux System of the ghost computer and run:
Cd/mnt/hgfs
Ls
You can see the cmd_file directory and use commands such as cp to perform read and write operations from windows to linux and from linux to windows.
Tip: if the shared folder is created on the desktop of a windows host, you may not see anything when running cd/mnt/hgfs ls on a linux terminal. It is blank, now you can change the path to the root directory of drive D or other disks. Note that the folder should not contain special characters such as spaces. This problem has also plagued me for a long time.
4. Notes
Adding a shared folder in vmware software or performing a version of the shared folder parameter immediately takes effect, that is to say, you can immediately see the newly added shared directory in the linux System of the ghost computer and experience the parameter changes.
Conclusion: The purpose of this article is to reduce the number of new users who repeatedly ask questions about the shared files of vmware host/ghost computer on CU linux and the repeated answers from other brothers, so that the layout is more informative. In addition, I think most of the answers to this question are implemented by using ftp, samba, and nfs (nfs can be implemented by installing microsoft service for unix on windows, it is much easier to use the shared folder method provided by vmware than to use the network protocol for file transfer. For Beginners, copying files using the cp command is much easier than using the ftp and smbmount commands.
After the sharing settings in virtual linux are correct, there is nothing left blank after running cd/mnt/hgfs ls?
My host is windows xp. I Installed vmware tools in linux in vmware6.0, and added mongo_redhat on the windows desktop to VM> Settings> Options> Shared Folders, which is always enabled, but when I run cd, mnt, and hgfs ls on a linux terminal, nothing is displayed. What is the difference ??
A: There may be a path relationship. You should establish the shared directory in the root directory of drive D. The directory should not contain special characters such as Chinese characters or spaces. Try again.