欢迎各位兄弟 发布技术文章

这里的技术是共享的

You are here

共享文件夹 无桌面的(命令行) linux 安装VMWare Tools 不知什么原因 同样的操作我要重装一下才行 有大用 有大大用 有大大大用

如果共享目录起作用 说明 VMWare Tools 安装成功了  

不知什么原因 同样的操作redhat5我要重装一下才行

redhat6 装不起来见/node-admin/12364

 可以通过 cd /mnt 查看到该目录下面多了一个hgfs目录,

要切记 执行安装 vmware tools 时   /mnt 目录  未被挂载 ,

未被使用 /mnt/hgfs 就是可以访问的共享文件夹

(hgfs这个文件夹好像不需要创建?好像是自动创建)

1、在vmware虚拟机选项下,选择安装vmware-tools


1535171703712957.png



2、将vmware安装目录下的linux.iso装载到系统中

2.1、选择需安装VMWareTools的虚拟机,右击--可移动设备--CD/DVD--设置 (好像不需要,又好像需要)

2.2、选择CD/DVD(SATA)--使用ISO映像文件--选文件--打钩设备状态下的“已连接”--确定 (好像不需要,又好像需要)

3、在系统中输入如下命令挂载:mount /dev/cdrom /mnt

4、进入/mnt 会看到

5、(重要)将VMWareTools-10.0.10-4301679.tar.gz 拷贝到其他目录,我是拷贝到目录/home

# cp VMWareTools-10.0.10-4301679.tar.gz /home/VMWareTools-10.0.10-4301679.tar.gz

不拷贝直接解压会出错,错误如下

6、进入目录/home,解压VMWareTools-10.0.10-4301679.tar.gz,解压后出现vmware-tools-distrib

  cd /home

  tar -zxf  VMWareTools-10.0.10-4301679.tar.gz

注意:为防止出错最好还是卸载掉CDROM

(因为 /mnt/hgfs 将要作为 共享文件夹挂载的目录,所以 刚刚挂载的 /mnt

目录必须卸载掉)

[root@Centos6 ~]# umount /dev/cdrom


6-2) vmware tools 涉及到 共享文件夹,所以要配置一下共享文件夹

image.png

image.png

7、进入目录vmware-tools-distrib,运行安装文件./vmware-install.pl,一路enter就可以了

8、恭喜,完成了

 看到 successfully 和 下面的  enjoy 应该是安装好了吧

image.png


此时 通过 # ls /mnt  可以看到 hgfs 文件夹了,这就是共享文件夹




来自 https://www.cnblogs.com/ddbear/p/6857199.html


VMware Tools 安装

VMware Workstation 12 Pro 
Ubuntu 16.04 
遇到的问题:VMware->虚拟机->安装VMware Tools,灰色,无法点击 
解决方式: 
1.Shut Down Ubuntu。 
2.虚拟机->设置->CD/DVD(SATA)->连接中选择“使用ISO映像文件”,点击后面的浏览按钮选择VMware软件安装目录下的linux.iso文件,点击OK后退出设置。 
3.启动Ubuntu。 
4.选择“Devices”中的“VMware Tools”,选中VMwareTools-数字-数字.tar.gz(我的显示VMwareTools-10.0.6-3595377.tar.gz) 
5.选中的文件复制到桌面,对文件进行解压,得到“vmware-tools-distrib”文件夹。 
6.输入“cd vmware-tools-distrib”,进入vmware-tools-distrib目录中。 
7.输入“sudo ./vmware-install.pl”,一路Enter确认。 
显示信息: 
shuoquan1205@ubuntu:~/Desktop/vmware-tools-distrib$ sudo ./vmware-install.pl 
[sudo] password for shuoquan1205: 
The installer has detected an existing installation of open-vm-tools on this 
system and will not attempt to remove and replace these user-space 
applications. It is recommended to use the open-vm-tools packages provided by 
the operating system. If you do not want to use the existing installation of 
open-vm-tools and attempt to install VMware Tools, you must uninstall the 
open-vm-tools packages and re-run this installer. 
The packages that need to be removed are: 
open-vm-tools 
The installer will next check if there are any missing kernel drivers. Type yes 
if you want to do this, otherwise type no [yes]

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]

Uninstalling the tar installation of VMware Tools.

Stopping services for VMware Tools

Stopping VMware Tools services in the virtual machine: 
VMware User Agent (vmware-user): done 
Unmounting HGFS shares: done 
Guest filesystem driver: done

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

The removal of VMware Tools 10.0.6 build-3595377 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]

What is the directory that contains the init scripts? 
[/etc/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]

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 10.0.6 build-3595377 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] 
The file /usr/bin/vmware-hgfsclient that this program was about to install 
already exists. Overwrite? [no] 
The file /usr/bin/vmhgfs-fuse that this program was about to install already 
exists. Overwrite? [no] 
The file /sbin/mount.vmhgfs that this program was about to install already 
exists. Overwrite? [yes] 
Initializing…

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: 
VMware User Agent (vmware-user): done 
Unmounting HGFS shares: done 
Guest filesystem driver: done

update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults 
update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults 
The module vmci has already been installed on this system by another installer 
or package and will not be modified by this installer.

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

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

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

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

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] 
The vmxnet driver is no longer supported on kernels 3.3 and greater. Please 
upgrade to a newer virtual NIC. (e.g., vmxnet3 or e1000e)

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] 
Thinprint provides driver-free printing. Do you wish to enable this feature? 
[yes]

Creating a new initrd boot image for the kernel. 
update-initramfs: Generating /boot/initrd.img-4.4.0-15-generic

Starting Virtual Printing daemon: done 
Checking acpi hot plug done 
Starting VMware Tools services in the virtual machine: 
Switching to guest configuration: done 
Guest filesystem driver: done 
Mounting HGFS shares: done 
The configuration of VMware Tools 10.0.6 build-3595377 for Linux for this 
running kernel completed successfully.

Enjoy,

–the VMware team


来自  https://blog.csdn.net/naruto1205/article/details/51638955


在 Linux 虚拟机中手动安装或升级 VMware Tools

对于 Linux 虚拟机,您可以使用命令行工具手动安装或升级 VMware Tools。

本次Linux 虚拟机为CentOS6.5


先决条件
开启虚拟机。
确认客户机操作系统正在运行。
由于 VMware Tools 安装程序是使用 Perl 编写的,因此,请确认在客户机操作系统中安装了 Perl。

安装VMware Tools的目的        

VMware Tools是VMware虚拟机中自带的一种增强工具,相当于VirtualBox中的增强功能(Sun VirtualBox Guest Additions),是VMware提供的增强虚拟显卡和硬盘性能、以及同步虚拟机与主机时钟的驱动程序。
只有在VMware虚拟机中安装好了VMware Tools,才能实现主机与虚拟机之间的文件共享,同时可支持自由拖拽的功能,鼠标也可在虚拟机与主机之前自由移动(不用再按ctrl+alt),且虚拟机屏幕也可实现全屏化。

步骤
1、在主机上,从 Workstation Pro 菜单栏中选择虚拟机 > 安装 VMware Tools。
如果安装了早期版本的 VMware Tools,则菜单项是更新 VMware Tools。
2、在虚拟机中,以 root 身份登录到客户机操作系统并打开终端窗口。

3、不带参数运行 mount 命令以确定 Linux 发行版是否自动装载 VMware Tools 虚拟 CD-ROM 映像。
如果装载了 CD-ROM 设备,将按以下方式列出 CD-ROM 设备及其装载点:
/dev/cdrom on /mnt/cdrom type iso9660 (ro,nosuid,nodev)

 

       

到此步骤时,我遇到了一个问题,纠结了好久:

就是我通过mount /dev/sr0 /mnt 命令挂载光驱(即把CentOS CDROM挂载在/mnt目录中,就可以访问被里面的内容了),可是我在mnt目录下却看不到东西。        

这是什么原因呢?        

原来是因为我挂载的/nmt分区已经挂载,所以才会出现上述情况!!!        

 解决方法:先umount /mnt 卸载掉   然后 mount /dev/sr0 /mnt        

附注:下图红框中的提示是正常的.无需解决.

/dev/sr0写保护,以只读方式挂载。
mount命令默认以读写方式挂载一个设备,而光盘是只读的,所以在挂载光盘这个块设备时会出现上述从读写方式切换为以只读方式挂载光盘的提示。如果不想看到这个提示,就请在mount命令后面添加参数,指定以只读方式来挂载设备。

       

接下来的步骤:

4、转到工作目录,例如 /tmp/

5、解压缩安装程序。

tar zxpf /mnt/cdrom/VMwareTools-x.x.x-yyyy.tar.gz
x.x.x 值是产品版本号,yyyy 是产品版本的内部版本号。
如果尝试安装 tar 安装以覆盖 RPM 安装或相反,安装程序将检测以前的安装并且必须转换安装程序数据库格式,然后才能继续操作。

6、会发现目录下多了个文件夹vmware-tools-distrib,里面有一个vmware-install.pl文件

7、使用./vmware-install.pl来执行文件        

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
[root@localhost mnt]# cd ../..                                        
[root@localhost /]# cd /tmp                                        
[root@localhost tmp]# ls                                        
keyring-0Xytmd  keyring-hyGJPh  keyring-UvmLHe      virtual-carsonzhu.FBAXXT                                        
keyring-4WJiO6  keyring-Hzpfne  orbit-carsonzhu     virtual-carsonzhu.YLd5ur                                        
keyring-Dtts8C  keyring-nPu72R  orbit-gdm                                        
keyring-fRCtRE  keyring-P2Kgdv  pulse-JJ4pstxF4ptg                                        
keyring-GgwNeg  keyring-tLjlND  pulse-rR5aSeUpvxJC                                        
[root@localhost tmp]# cd /mnt                                        
[root@localhost mnt]# cp VMwareTools-10.0.0-2977863.tar.gz /tmp                                        
[root@localhost mnt]# cd /tmp                                        
[root@localhost tmp]# ls                                        
keyring-0Xytmd  keyring-Hzpfne   orbit-gdm                                        
keyring-4WJiO6  keyring-nPu72R   pulse-JJ4pstxF4ptg                                        
keyring-Dtts8C  keyring-P2Kgdv   pulse-rR5aSeUpvxJC                                        
keyring-fRCtRE  keyring-tLjlND   virtual-carsonzhu.FBAXXT                                        
keyring-GgwNeg  keyring-UvmLHe   virtual-carsonzhu.YLd5ur                                        
keyring-hyGJPh  orbit-carsonzhu  VMwareTools-10.0.0-2977863.tar.gz                                        
[root@localhost tmp]# tar zxpf VMwareTools-10.0.0-2977863.tar.gz                                        
[root@localhost tmp]# ls                                        
keyring-0Xytmd  keyring-nPu72R      pulse-rR5aSeUpvxJC                                        
keyring-4WJiO6  keyring-P2Kgdv      virtual-carsonzhu.FBAXXT                                        
keyring-Dtts8C  keyring-tLjlND      virtual-carsonzhu.YLd5ur                                        
keyring-fRCtRE  keyring-UvmLHe      VMwareTools-10.0.0-2977863.tar.gz                                        
keyring-GgwNeg  orbit-carsonzhu     vmware-tools-distrib                                        
keyring-hyGJPh  orbit-gdm                                        
keyring-Hzpfne  pulse-JJ4pstxF4ptg                                        
[root@localhost tmp]# cd vmware-tools-distrib                                        
[root@localhost vmware-tools-distrib]# ls                                        
bin  doc  FILES    installer  vgauth             vmware-install.real.pl                                        
caf  etc  INSTALL  lib        vmware-install.pl                                        
[root@localhost vmware-tools-distrib]# ./vmware-install.pl                                        
 
Creating a new VMware Tools installer database using the tar4 format.                                        
 
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]                                        
In which directory do you want to install the common agent library files?                                        
[/usr/lib]                                        
In which directory do you want to install the common agent transient files?                                        
[/var/lib]                                        
In which directory do you want to install the documentation files?                                        
[/usr/share/doc/vmware-tools]                                        
The path "yes" is a relative path. Please enter an absolute path.                                        
 
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 10.0.0 build-2977863 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]                                        
 
Initializing...                                        
  
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:                          [确定]                                        
   VMware User Agent (vmware-user):                        [确定]                                        
   Unmounting HGFS shares:                                 [确定]                                        
   Guest filesystem driver:                                [确定]                                        
  
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.                                        
 
The module pvscsi has already been installed on this system by another                                        
installer or package and will not be modified by this installer.                                        
 
The module vmmemctl has already been installed on this system by another                                        
installer or package and will not be modified by this installer.                                        
 
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]                                        
 
Could not create the '/mnt/hgfs' directory.  Please make sure it is writeable                                        
and/or not currently in use.                                        
The filesystem driver (vmhgfs module) is used only for the shared folder                                        
feature. The rest of the software provided by VMware Tools is designed to work                                        
independently of this feature.                                        
 
If you wish to have the shared folders feature, you can install the driver by                                        
running vmware-config-tools.pl again after making sure that gcc, binutils, make                                        
and the kernel sources for your running kernel are installed on your machine.                                        
These packages are available on your distribution's installation CD.                                        
[ Press Enter key to continue ]                                        
 
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]                                        
 
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]                                        
 
Thinprint provides driver-free printing. Do you wish to enable this feature?                                        
[yes]                                        
  
Disabling timer-based audio scheduling in pulseaudio.                                        
 
Do you want to enable Guest Authentication (vgauth)? Enabling vgauth is needed                                        
if you want to enable Common Agent (caf). [yes]                                        
 
Do you want to enable Common Agent (caf)? [yes]                                        
   
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.                                        
Generating the key and certificate files.                                        
Successfully generated the key and certificate files.                                        
   Starting Virtual Printing daemon:                                   done                                        
   Checking acpi hot plug                                  [确定]                                        
Starting VMware Tools services in the virtual machine:                                        
   Switching to guest configuration:                       [确定]                                        
   VM communication interface:                             [确定]                                        
   VM communication interface socket family:               [确定]                                        
   Blocking file system:                                   [确定]                                        
   Guest operating system daemon:                          [确定]                                        
   VGAuthService:                                          [确定]                                        
   Common Agent:                                           [确定]                                        
The configuration of VMware Tools 10.0.0 build-2977863 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 ...                                        
Found VMware Tools CDROM mounted at /mnt. Ejecting device /dev/sr0 ...                                        

8、紧接着输入命令reboot重启就好了!  

 

附:修改虚拟机中linux系统的分辨率

       

       

 

“I find that the harder i work,the more luck i seem to have!”


来自 https://www.cnblogs.com/carsonzhu/p/5503425.html


最小化安装CentOS6.5下安装VMwareTools              

1、在虚拟机设置里查看,确定你的虚拟机有连着CentOS6.5镜像。

image.png 

2、安装环境所需要的库,安装软件(CentOS6.5系统安装好后,并配置好网络,默认yum在线安装是可用的,如果是rhel6.5则需要修改/etc/yum.repos/里的repo文件或下载一个并修改,如有遇到可百度看下)

[root@Centos6 ~]# yum install -y gcc gcc-c++ automake make

[root@Centos6 ~]# yum install -y kernel-devel

3、右键要安装VMwareTools工具的虚拟机,选择“安装VMware Tools” 。

image.png 

4、接着新建一个cdrom挂在目录

[root@Centos6 ~]# mkdir /mnt/cdrom/

然后把CentOS6.5 CDROM挂载到/mnt/cdrom/中,然后你就可以查看里面的内容了

[root@Centos6 ~]# mount /dev/cdrom /mnt/cdrom/

mount: block device /dev/sr0 is write-protected, mounting read-only

此时你可以看到VMwareTools-9.6.0-1294478.tar.gz

 

image.png 

5、我们不能再/mnt/cdrom/目录直接解压然后执行文件,如果你做了你会发现执行会出问题,所以我们把VMwareTools-9.6.0-1294478.tar.gz复制到/tmp/目录下

[root@Centos6 cdrom]# cp VMwareTools-9.6.0-1294478.tar.gz /tmp/

[root@Centos6 cdrom]# cd /tmp/

[root@Centos6 tmp]# ls

VMwareTools-9.6.0-1294478.tar.gz  yum.log

注意:为防止出错最好还是卸载掉CDROM

[root@Centos6 ~]# umount /dev/cdrom

6、解压

[root@Centos6 tmp]# tar zxvf VMwareTools-9.6.0-1294478.tar.gz

[root@Centos6 tmp]# ls

VMwareTools-9.6.0-1294478.tar.gz  vmware-tools-distrib  yum.log

[root@Centos6 tmp]# cd vmware-tools-distrib/

[root@Centos6 vmware-tools-distrib]# ls

bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl

7、执行vmware-install.pl

[root@Centos6 vmware-tools-distrib]# ./vmware-install.pl

Creating a new VMware Tools installer database using the tar4 format.

 

Installing VMware Tools.

 

In which directory do you want to install the binary files?

[/usr/bin]

…………

…………

接着就是一路回车了,直到显示成功为止

The configuration of VMware Tools 9.6.0 build-1294478 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

 

/sbin/restorecon:  Warning no default label for /tmp/vmware-block-restore0/tmp_file

8、最后重启

[root@Centos6 ~]# reboot

9、如果你的Centos没有安装ntp,没有时间同步的话,VMwareTools可以让你与主机保持时间一致,你只需在设置里勾上“将客户机时间与主机同步”

image.png 

[root@Centos6 ~]# date

Sun Aug 31 17:28:09 CST 2014

可以查看时间是否与主机一致

 

 

参考文档:

http://www.2cto.com/os/201111/112284.html 

http://blog.163.com/devinliu@126/blog/static/1364973492013810772684/ 


来自  https://wenku.baidu.com/view/f3706ca204a1b0717fd5ddfd.html

普通分类: