VMware文件传输:Transferring Files and Text Between the Host and Guest

ONE: Using the Drag-and-Drop Feature   使用拖放功能
Before you begin, make sure VMware Tools is installed on the virtual machine. To enable or disable the drag-and-drop feature 1 Start Workstation and select the virtual machine. 2 Choose VM > Settings. 3 Click the Options tab and select Guest Isolation. 4

Select or deselect the Enable drag and drop check box and click OK.

TWO: Using the Copy and Paste Feature    使用复制和粘帖功能
To use the copy and paste feature, VMware Tools must be installed on the virtual machine. To enable or disable the copy and paste feature 1 Select the virtual machine. 2 Select VM > Settings. 3 Click the Options tab and select Guest Isolation. 4

Select or deselect the Enable copy and paste check box and click OK.

THREE: Using Shared Folders 使用共享文件夹功能
To set up shared folders 1 Start Workstation and select a virtual machine. 2 Choose VM > Settings. 3 Click the Options tab and select Shared Folders. 4 Select Always enabled or Enabled until next power off or suspend. You can select Enabled until next power off or suspend only when the virtual machine is powered on. This setting disables folder sharing temporarily, until you shut down, suspend, or power off the virtual machine. If you select this option and restart the virtual machine, shared folders are not disabled. You must select this option or Always enabled to enable or disable specific folders in the Folders section. 5 (Optional) For easy access, select the Map as a network drive in Windows guests check box to map a drive to the Shared Folders directory. This directory contains all the shared folders you enable. The drive letter is selected automatically. 6 Click Add. On Windows, clicking Add starts the Add Shared Folder wizard. On Linux, it opens the Shared Folder Properties dialog box. 7 Use the following information to complete the wizard or Properties dialog box: ? Host path – Path on the host to the directory that you want to share. If you specify a directory on a network share, such as D:\share, Workstation always attempts to use that path. If the directory is later connected to the host on a different drive letter, the shared folder cannot be located. ? Name – Name that appears inside the virtual machine. Characters that the guest operating system considers illegal in a share name appear differently when viewed inside the guest. For example, if you use an asterisk in a share name, you see %002A instead of * in the share name on the guest. Illegal characters are converted to their ASCII hexadecimal value. ? Enable this share – Deselect this option to disable a shared folder without deleting it from the virtual machine configuration. You can enable the folder by selecting the check box next to its name in the list. To enable a folder at a later time select its name in the list, click Properties, and enable the folder in the Properties dialog box. ? Read-only – Select this option to prevent the virtual machine from changing the contents of the shared folder in the host file system. Access to files in the shared folder is also governed by permission settings on the host computer. To change these properties, use the Properties dialog box. On Windows, after you select Shared Folders on the Options tab, click Properties. 8 (Optional) To enable shared folders for a virtual machine after a shared folder is created, on the Shared Folders settings panel, use the Folder Sharing section: ? Select Enabled until next power off or suspend to enable folder sharing temporarily, until you power off, suspend, or shut down the virtual machine. If you select Enabled until next power off or suspend and restart the virtual machine, shared folders are not disabled. ? Select Always enabled to enable or disable specific folders in the Folders section. 9 Access the enabled shared folder: To view shared folders in a Linux or Solaris 10 guest

On a Linux virtual machine, shared folders appear under /mnt/hgfs.

FOUR: Folder Mounting for Shared Folders 挂载共享文件夹

? Permissions and Folder Mounting for Shared Folders on Linux Guests The latest version of VMware Tools included in Workstation contains performance improvements, support for symbolic links if you use a Linux host, a new mechanism for mounting shared folders, and permissions enhancements. Performance Improvements Host-guest file sharing is integrated with the guest page cache. Files in shared folders are cached for reading and can be written to asynchronously. However, you do not experience the read caching benefits on files that are being actively written to from the guest. To speed performance, use the ttl (time to live) option to the mount command. Use this option to specify the interval used by the hgfs (host-guest file system) driver for validating file attributes. For example, if you use the following command, attributes are validated every 3 seconds instead of every 1 second, which is the default: mount -o ttl=3 -t vmhgfs .host:/<share> <mountpoint> Note Lengthening the interval involves some risk. If a process in the host modifies a file’s attributes, the guest might not get the modifications as quickly, and the file can become corrupted. Folder Mounting This mechanism allows you to mount one or more directories or subdirectories in a shared folder to any location in your file system in addition to the default location of /mnt/hgfs. You can use the mount program to mount all shares, one share, or a subdirectory within a share to any location in your file system. The following table provides examples. Command Description mount -t vmhgfs .host:/ /home/user1/shares Mounts all shares to /home/user1/shares mount -t vmhgfs .host:/foo /tmp/foo Mounts the share named foo to /tmp/foo mount -t vmhgfs .host:/foo/bar /var/lib/bar Mounts the subdirectory bar within the share foo to /var/lib/bar When you use the mount program, you can use VMware-specific options in addition to the standard mount syntax. To see usage information for the host-guest file system options, enter this command: /sbin/mount.vmhgfs -h Note When you install VMware Tools, an entry is made to etc/fstab to specify the location of shared folders. You can edit this file to change or add entries. To use mount in this way, you must use the virtual machine settings editor in Workstation to set up and enable a shared folder. After the share exists, you can mount the shared folder to other locations besides the default. In previous versions of VMware Tools, when a Linux guest attempted to mount a shared folder, the vmware-guestd program attempted to perform the mount. If it failed, the only evidence of the failure was an empty folder. With the new version of VMware Tools, the Tools services script loads a driver that performs the mount. If the mount fails, a message appears regarding mounting HGFS shares. The mount can fail if shared folders are disabled or if the share does not exist. You are not prompted to re-run the VMware Tools configurator (the vmware-config-tools.pl file). Improved Handling of Permissions Many refinements have been made for Linux guests on both Linux and Windows hosts: ? If you use a Linux host and create files that you want to share with a Linux guest, the file permissions shown on the guest are exactly the same as those on the host. Use fmask and dmask to mask permissions bits for files and directories. ? If you use a Windows host and create files that you want to share with a Linux guest, read-only files are displayed as having read and execute permission for everyone, and other files are shown as fully writable by everyone. ? If you use a Linux guest to create files for which you want to restrict permissions, use the mount program with the following options in the guest: uid, gid, fmask, dmask, ro (read-only), and rw (read-write). Note that rw is the default. If you are using a virtual machine created with the Windows version of Workstation or a previous release of the Linux version of Workstation, you can change only the owner permissions. This behavior is the same as in previous releases. On a Solaris virtual machine, shared folders appear under /hgfs.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值