VMware Workstation的Ubuntu虚拟机中安装VMWare Tools

期间,重新安装VMWare Tools,结果又遇到之前就遇到的那个提示:

Enter the path to the kernel header files...?

1.参考:

Error while validating for Ubuntu 12.10 Kernel headers

去安装对应版本的linux source,结果是本身就已经安装好了:

1

2

3

4

5

6

7

8

9

10

crifan@ubuntu:~$ sudo apt-get install linux-headers-$(uname -r)

Reading package lists... Done

Building dependency tree      

Reading state information... Done

linux-headers-3.8.0-27-generic is already the newest version.

The following packages were automatically installed and are no longer required:

  dkms fakeroot g++-4.7 libdumbnet1 libstdc++6-4.7-dev zerofree

Use 'apt-get autoremove' to remove them.

0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

crifan@ubuntu:~$

2. sudo apt-get update&&sudo apt-get dist-upgrade

3.可以先去看看自己此处是否对应目录已有头文件,结果是有的:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

crifan@ubuntu:~$ ls /usr/src/linux-

linux-headers-3.8.0-19/         linux-headers-3.8.0-27/         linux-source-3.2.0/

linux-headers-3.8.0-19-generic/ linux-headers-3.8.0-27-generic/ linux-source-3.2.0.tar.bz2

crifan@ubuntu:~$ ls /usr/src/linux-headers-3.8.0-

linux-headers-3.8.0-19/         linux-headers-3.8.0-27/        

linux-headers-3.8.0-19-generic/ linux-headers-3.8.0-27-generic/

crifan@ubuntu:~$ ls /usr/src/linux-headers-3.8.0-27-generic/

arch    Documentation  fs       ipc      kernel    mm              samples   sound   usr

block   drivers        include  Kbuild   lib       Module.symvers  scripts   tools   virt

crypto  firmware       init     Kconfig  Makefile  net             security  ubuntu

crifan@ubuntu:~$ ls /usr/src/linux-headers-3.8.0-27-generic/include

acpi         clocksource  crypto  generated  keys   math-emu  memory  net     ras   rxrpc  sound   trace  video

asm-generic  config       drm     Kbuild     linux  media     misc    pcmcia  rdma  scsi   target  uapi   xen

crifan@ubuntu:~$

所以,手动输入对应的路径,但是还是提示是非法的路径:

1

2

3

4

5

6

7

8

9

Searching for a valid kernel header path...

The path "" is not a valid path to the 3.8.0-27-generic kernel headers.

Would you like to change it? [yes]

  

Enter the path to the kernel header files for the 3.8.0-27-generic kernel? /usr/src/linux-headers-3.8.0-27-generic/include

  

The path "/usr/src/linux-headers-3.8.0-27-generic/include" is not a valid path

to the 3.8.0-27-generic kernel headers.

Would you like to change it? [yes]

又试了试,其他几个header,结果也还是不行:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

crifan@ubuntu:~$ uname -r

3.8.0-27-generic

crifan@ubuntu:~$ ls /usr/src/linux-headers-3.8.0-19/include

acpi         clocksource  drm     keys   math-emu  memory  net     ras   rxrpc  sound   trace  video

asm-generic  crypto       Kbuild  linux  media     misc    pcmcia  rdma  scsi   target  uapi   xen

crifan@ubuntu:~$ ls /usr/src/linux-headers-3.8.0-19-generic/include

acpi         clocksource  crypto  generated  keys   math-emu  memory  net     ras   rxrpc  sound   trace  video

asm-generic  config       drm     Kbuild     linux  media     misc    pcmcia  rdma  scsi   target  uapi   xen

crifan@ubuntu:~$ ls /usr/src/linux-headers-3.8.0-27-generic/include

acpi         clocksource  crypto  generated  keys   math-emu  memory  net     ras   rxrpc  sound   trace  video

asm-generic  config       drm     Kbuild     linux  media     misc    pcmcia  rdma  scsi   target  uapi   xen

crifan@ubuntu:~$ ls /usr/src/linux-headers-3.8.0-27/include

acpi         clocksource  drm     keys   math-emu  memory  net     ras   rxrpc  sound   trace  video

asm-generic  crypto       Kbuild  linux  media     misc    pcmcia  rdma  scsi   target  uapi   xen

crifan@ubuntu:~$

和:

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

Enter the path to the kernel header files for the 3.8.0-27-generic kernel? /usr/src/linux-headers-3.8.0-19/include      

  

The path "/usr/src/linux-headers-3.8.0-19/include" is not a valid path to the

3.8.0-27-generic kernel headers.

Would you like to change it? [yes] yes

  

Enter the path to the kernel header files for the 3.8.0-27-generic kernel? /usr/src/linux-headers-3.8.0-19-generic/include

  

The path "/usr/src/linux-headers-3.8.0-19-generic/include" is not a valid path

to the 3.8.0-27-generic kernel headers.

Would you like to change it? [yes] yes

  

Enter the path to the kernel header files for the 3.8.0-27-generic kernel? /usr/src/linux-headers-3.8.0-27-generic/include

  

The path "/usr/src/linux-headers-3.8.0-27-generic/include" is not a valid path

to the 3.8.0-27-generic kernel headers.

Would you like to change it? [yes] yes

  

Enter the path to the kernel header files for the 3.8.0-27-generic kernel? /usr/src/linux-headers-3.8.0-27/include

  

The path "/usr/src/linux-headers-3.8.0-27/include" is not a valid path to the

3.8.0-27-generic kernel headers.

Would you like to change it? [yes] yes

  

Enter the path to the kernel header files for the 3.8.0-27-generic kernel?

4.去试试:

sudo apt-get update  
sudo apt-get install kernel-headers kernel-devel gcc make

结果根本找不到:

1

2

3

4

5

6

7

crifan@ubuntu:~$ sudo apt-get install kernel-headers kernel-devel gcc make

Reading package lists... Done

Building dependency tree      

Reading state information... Done

E: Unable to locate package kernel-headers

E: Unable to locate package kernel-devel

crifan@ubuntu:~$

5.去重启Ubuntu。

然后再去安装build-essential:

sudo apt-get install build-essential

再去安装linux header:

sudo apt-get install linux-headers-$(uname -r)

然后再去安装试试:

突然看到提示说之前安装了open-vm-tools,会有冲突,

所以,手动去卸载:

sudo apt-get autoremove open-vm-tools

再重新安装,结果竟然还是检测到已经安装了open-vm-tools,然后还由于无法继续调用

/usr/bin/vmware-uninstall-tools.pl

而终于运行了。

最后的最后,还是通过,重新安装open-vm-tools,而得以正常的使用文件夹共享,但是剪贴板共享,还是不行。

6.去修改vmware-install.pl,但是,此刻,就只是之前的错误:

无法继续安装vmware-install.pl了。

因为:

始终出错,显示:

cannot execute /usr/bin/vmware-uninstall-tools.pl

而去/usr/bin下面看了看,的确没有vmware-uninstall-tools.pl

导致:

无论如何,都无法继续安装或卸载当前的vmware tools了。。。

7.后来是发现,本身vmware-tools下面有个bin目录,其下就有个vmware-uninstall-tools.pl,所以sudo cp一下到/usr/bin中后,再去执行,就可以找到此文件了。

【总结】

最后,还是通过:

先卸载之前的open-vm-tools

再安装vmware-tools.pl

再安装open-vm-tools

而解决了所有问题,使得可以:

剪贴板共享可用,文件共享可用。

没有找到其他更好的办法。

你可能感兴趣的:(vmware,ubuntu)