VMWare开启共享文件夹(vmwaretools)

Windows环境下安装了Linux虚拟机,如果要安装大型软件(例如Oracle),难道需要把安装包上传上去吗(超占空间)?
能直接访问Windows下才磁盘文件就好了。

 

 

强大的VMWare支持文件夹共享功能,这样虚拟机就能无缝访问Windows下的硬盘内容了。

 

1. 开VMWare共享文件夹功能

在关闭虚拟机状态下,右击待指定虚拟机 --> 设置 --> 选项 --> 共享文件夹 --> 总是启用 --> 添加 -->确定


 

 

示例共享了G:\下的几个目录



 

2. 安装vmwaretools

打开虚拟机 --> 右击待安装的虚拟机 --> 安装VMware Tools -->此时(虚拟)系统会默认打开 VMWare的安装压缩包



 

Extract解压到任意一个目录下(例子解压缩到/tmp/vmwaretools)-->右击Open in Terminal(在命令行中打开)



 

安装即为简单,根据回显提示,一路yes或者no即可,注意使用root用户安装。安装全过程如下:

[root@XD-ORACLE vmware-tools-distribu]# cd vmware-tools-distrib/
[root@XD-ORACLE vmware-tools-distrib]# ls
bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl
[root@XD-ORACLE vmware-tools-distrib]# ./vmware-install.pl
A previous installation of VMware Tools has been detected.

The previous installation was made by the tar installer (version 4).

Keeping the tar4 installer database format.

You have a version of VMware Tools installed.  Continuing this install will
first uninstall the currently installed version.  Do you wish to continue?
(yes/no) [yes] yes

Uninstalling the tar installation of VMware Tools.

Stopping services for VMware Tools

Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:                          [  OK  ]
   VMware User Agent (vmware-user):                        [  OK  ]
   Blocking file system:                                   [  OK  ]
   Unmounting HGFS shares:                                 [  OK  ]
   Guest filesystem driver:                                [  OK  ]
   VM communication interface socket family:               [  OK  ]
   VM communication interface:                             [  OK  ]

Stopping Thinprint services in the virtual machine:
   Stopping Virtual Printing daemon:                                   done

/sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file
File /etc/pulse/default.pa is backed up to /etc/pulse/default.pa.old.0.

The removal of VMware Tools 9.6.1 build-1378637 for Linux completed
successfully.

Installing VMware Tools.

In which directory do you want to install the binary files?
[/usr/bin]

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?
[/etc/rc.d]

What is the directory that contains the init scripts?
[/etc/rc.d/init.d]

In which directory do you want to install the daemon files?
[/usr/sbin]

In which directory do you want to install the library files?
[/usr/lib/vmware-tools]

The path "/usr/lib/vmware-tools" does not exist currently. This program is
going to create it, including needed parent directories. Is this what you want?
[yes]


yes
In which directory do you want to install the documentation files?
[/usr/share/doc/vmware-tools]
The path "/usr/share/doc/vmware-tools" does not exist currently. This program
is going to create it, including needed parent directories. Is this what you
want? [yes]
The installation of VMware Tools 9.6.1 build-1378637 for Linux completed
successfully. You can decide to remove this software from your system at any
time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

Before running VMware Tools for the first time, you need to configure it by
invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want
this program to invoke the command for you now? [yes] yes

Initializing...

/usr/bin/xrandr: Failed to get size of gamma for output default

Making sure services for VMware Tools are stopped.

Stopping Thinprint services in the virtual machine:
   Stopping Virtual Printing daemon:                                   done
Stopping VMware Tools services in the virtual machine:
   Guest operating system daemon:                          [  OK  ]
   VMware User Agent (vmware-user):                        [  OK  ]
   Blocking file system:                                   [  OK  ]
   Unmounting HGFS shares:                                 [  OK  ]
   Guest filesystem driver:                                [  OK  ]
   VM communication interface socket family:               [  OK  ]
   VM communication interface:                             [  OK  ]


Found a compatible pre-built module for vmci.  Installing it...


Found a compatible pre-built module for vsock.  Installing it...


The module vmxnet3 has already been installed on this system by another
installer or package and will not be modified by this installer.

Use the flag --clobber-kernel-modules=vmxnet3 to override.

The module pvscsi has already been installed on this system by another
installer or package and will not be modified by this installer.

Use the flag --clobber-kernel-modules=pvscsi to override.

The module vmmemctl has already been installed on this system by another
installer or package and will not be modified by this installer.

Use the flag --clobber-kernel-modules=vmmemctl to override.

The VMware Host-Guest Filesystem allows for shared folders between the host OS
and the guest OS in a Fusion or Workstation virtual environment.  Do you wish
to enable this feature? [yes] yes

Found a compatible pre-built module for vmhgfs.  Installing it...


Found a compatible pre-built module for vmxnet.  Installing it...


The vmblock enables dragging or copying files between host and guest in a
Fusion or Workstation virtual environment.  Do you wish to enable this feature?
[yes] yes

VMware automatic kernel modules enables automatic building and installation of
VMware kernel modules at boot that are not already present. This feature can be

enabled/disabled by re-running vmware-config-tools.pl.

Would you like to enable VMware automatic kernel modules?
[no] no

Thinprint provides driver-free printing. Do you wish to enable this feature?
[yes] yes


Disabling timer-based audio scheduling in pulseaudio.



Detected X server version 1.13.0



Distribution provided drivers for Xorg X server are used.

Skipping X configuration because X drivers are not included.

Creating a new initrd boot image for the kernel.
   Starting Virtual Printing daemon:                                   done
   Checking acpi hot plug                                  [  OK  ]
Starting VMware Tools services in the virtual machine:
   Switching to guest configuration:                       [  OK  ]
   VM communication interface:                             [  OK  ]
   VM communication interface socket family:               [  OK  ]
   Guest filesystem driver:                                [  OK  ]
   Mounting HGFS shares:                                   [  OK  ]
   Blocking file system:                                   [  OK  ]
   VMware User Agent:                                      [  OK  ]
   Guest operating system daemon:                          [  OK  ]
The configuration of VMware Tools 9.6.1 build-1378637 for Linux for this
running kernel completed successfully.

You must restart your X session before any mouse or graphics changes take
effect.

You can now run VMware Tools by invoking "/usr/bin/vmware-toolbox-cmd" from the
command line.

To enable advanced X features (e.g., guest resolution fit, drag and drop, and
file and text copy/paste), you will need to do one (or more) of the following:
1. Manually start /usr/bin/vmware-user
2. Log out and log back into your desktop session; and,
3. Restart your X session.

Enjoy,

--the VMware team

Found VMware Tools CDROM mounted at /media/VMware Tools. Ejecting device
/dev/sr0 ...
/sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file
[root@XD-ORACLE vmware-tools-distrib]#

 

切换到/mnt/hgfs/下就能看到共享的文件夹了

[root@XD-ORACLE vmware-tools-distrib]# cd /mnt/hgfs/FUTENG.Repository/
[root@XD-ORACLE FUTENG.Repository]# ls
Java  Oracle
[root@XD-ORACLE FUTENG.Repository]#

 

至此完成VMware Tools的安装工作。对于大型软件的安装,可直接放置于共享盘,亦可在Windows下直接解压,Linux下安装使用,非常方便。

猜你喜欢

转载自futeng.iteye.com/blog/2065171