How to share files with virtual machine linux

  

Use the shared folder function of virtual machine to use vmware (vmware workstation 5) shared folders function to achieve file transfer between host (host) and ghost (ghost is virtual LINUX) in vmware No network related settings, no network protocol, host and ghost can be linux and windows operating system
, here only the host is windows, ghost is the setting under linux, if ghost is windows, please Refer to the vmware help setting up shared folders. 1. Install vmtools for linux: Select VM >install VMware tools in the vmware workstation program menu. Select VM >removable Devices >CD-ROM >Edit >USE ISO Image in the vmware workstation program menu (select vmware installation In the directory linux.iso, linux.iso in the virtual machine folder, not under Red Hat Linux) start the linux in guest
, execute: mkdir /mnt/cdrom mount /dev/cdrom /mnt /cdrom (The installation file of vmtools is placed in the virtual cdrom of vmware. You must first mount the CD-ROM drive to find the installation file.) cd /mnt/cdrom tar -zxvf VMwareTools-5.5.3-34685.tar.gz -C /tmp ( Extract the installation files to /tmp)

cd /tmp/vmware-tools-distrib ./vmware-install.pl (There is a permission problem with su root running under super user) (execution) Vwware installation script, this script is written in perl) Here, the installer will ask the installation file storage location and set the resolution and other issues, in most cases, the default configuration vmware tools can work normally, so ,Here Each issue press the Enter key to select the default configuration. After installation, vmware will add a vmhgfs module to the kernel, you can use lsmod to view 2. Set the host computer shared directory: Switch to the windows desktop in the ghost computer, select VM>Settings>Options>Shared in the vmware workstation program menu Folders Click the “add” button at the bottom right of the dialog box, click “Next” Enter the name of the shared directory in the text box "name" (the directory name filled in here will be displayed in the linux system of the ghost computer) The same directory name), assuming share_file; in the "host folder", fill in the host computer windows directory that the system wants to share, assuming D:\\share and then click to complete the next dialog is to choose the way to share: Enable this share means that the share is valid for a long time, the directory can be read and written; Read-only means that the share is valid for a long time, and the directory is read-only; the disable after this session mode means that the next ghost computer is closed or suspended. After that, sharing will be invalid. Under normal circumstances, select Enable this share and then click "Complete". Since then, the shared folder is set to use 3. The shared folder directory is switched to the ghost computer's Linux system. Execute: cd /mnt/hgfs ls You can see the share_file directory. And can use cp and other instructions to achieve windows to linux, linux to windows read and write operations


Tip: If your shared folder is built on the windows host's desktop, probably in linux When the terminal runs cd /mnt/hgfs ls, nothing is seen, it is blank. At this time, you can change the path to the root directory of the D drive or other disk. Note that the folder should not have special characters such as spaces. This problem also plagued me for a long time. 4. Note that adding a shared folder to the vmware software or the version of the shared folder parameter is effective immediately, which means that you can immediately see the new addition in the ghost computer's Linux system. The shared directory and the experience to change the parameters of the conclusion: The purpose of writing this article is to reduce the problem of sharing files on the vmware host/ghost computer on the CU linux version. Repeat hands to ask questions and answer other brothers repeated, the layout is more Introduction more. In addition, I think that most of the questions answered by ftp, samba or even nfs (nfs can be implemented on Windows with microsoft service for Unix), using shared folder method with vmware is better than using network protocol to achieve file transfer. It's much more convenient, and for beginners, copying files with the cp command is much simpler than using the ftp and smbmount commands.



After the virtual linux sharing settings are correct, After running cd /mnt/hgfs ls is blank, nothing is going on?

My host is windows xp, linux installed in vmware6.0, installed vmware tools, and VM>Settings>Options>Shared Folders added share_redhat on windows desktop, always enabled But when the cd /mnt/hgfs ls is running on the linux terminal, nothing appears, blank, what is going on? ?

A: There may be a relationship between the paths. You should create a shared directory in the root directory of the D drive. Do not have special characters such as Chinese characters or spaces. Try it

Copyright © Windows knowledge All Rights Reserved