正在搜寻有效的内核头路径...?

正在搜寻有效的内核头路径...?

我正在尝试在 Linux 客户机上安装 vmware-tools,但是当我输入 /usr/src/linux 时,它给出了无效路径错误。

 The path "" is not a valid path to the 3.3.0-2-desktop kernel headers.
 Would you like to change it? [yes]

 Enter the path to the kernel header files for the 3.3.0-2-desktop
 kernel? /usr/src/linux

 The path "/usr/src/linux" is not a valid path to the 3.3.0-2-desktop kernel
 headers.
 Would you like to change it? [yes] yes

 Enter the path to the kernel header files for the 3.3.0-2-desktop
 kernel? /usr/src/linux/

 The path "/usr/src/linux/" is not a valid path to the 3.3.0-2-desktop kernel
 headers.
 Would you like to change it? [yes] yes

但是我的 Linux 源代码始终位于 /usr/src/linux 中?我已经安装了 kernel-devel 和 kernel-source。我的发行版是 SUSE 12.2。文件夹 /usr/src/linux 中充满了 Linux 源代码。这是我的选择:

 S | Name                           | Zusammenfassung                | Typ       
 --+--------------------------------+--------------------------------+-----------
   | devel_kernel                   | Linux-Kernel-Entwicklung       | Schema    
   | kernel-coverage                | Kernel Coverage Imageing, Ga-> | Paket     
   | kernel-debug                   | A Debug Version of the Kernel  | Paket     
   | kernel-debug                   | A Debug Version of the Kernel  | Quellpaket
   | kernel-debug-base              | A Debug Version of the Kerne-> | Paket     
   | kernel-debug-devel             | Development files necessary -> | Paket     
   | kernel-default                 | The Standard Kernel            | Paket     
   | kernel-default                 | The Standard Kernel            | Quellpaket
   | kernel-default-base            | The Standard Kernel - base m-> | Paket     
   | kernel-default-devel           | Development files necessary -> | Paket     
 i | kernel-desktop                 | Kernel optimized for the des-> | Paket     
   | kernel-desktop                 | Kernel optimized for the des-> | Quellpaket
   | kernel-desktop-base            | Kernel optimized for the des-> | Paket     
 i | kernel-desktop-devel           | Development files necessary -> | Paket     
 i | kernel-devel                   | Development files needed for-> | Paket     
   | kernel-docs                    | Kernel Documentation           | Paket     
   | kernel-docs                    | Kernel Documentation           | Quellpaket
   | kernel-ec2                     | The Amazon EC2 Xen Kernel      | Paket     
   | kernel-ec2                     | The Amazon EC2 Xen Kernel      | Quellpaket
   | kernel-ec2-base                | The Amazon EC2 Xen Kernel - -> | Paket     
   | kernel-ec2-devel               | Development files necessary -> | Paket          
   | kernel-ec2-extra               | The Amazon EC2 Xen Kernel - -> |                 
   | kernel-firmware                | Linux kernel firmware files    | 
   | kernel-pae                     | Kernel with PAE S                                
   | kernel-pae                     | Kernel with PAE                                  
   | kernel-pae-base                | Kernel with PAE Support - ba-> | Paket     
   | kernel-pae-devel               | Development files necessary -> | Paket     
 i | kernel-source                  | The Linux Kernel Sources       | Paket     
   | kernel-source                  | The Linux Kernel Sources       | Quellpaket
   | kernel-source-vanilla          | Vanilla Linux kernel sources-> | Paket     
   | kernel-syms                    | Kernel Symbol Versions (modv-> | Paket     
   | kernel-syms                    | Kernel Symbol Versions (modv-> | Quellpaket
   | kernel-trace                   | The Standard Kernel with Tra-> | Paket     
   | kernel-trace                   | The Standard Kernel with Tra-> | Quellpaket
   | kernel-trace-base              | The Standard Kernel with Tra-> | Paket     
   | kernel-trace-devel             | Development files necessary -> | Paket     
   | kernel-vanilla                 | The Standard Kernel - withou-> | Paket     
   | kernel-vanilla                 | The Standard Kernel - withou-> | Quellpaket
   | kernel-vanilla-base            | The Standard Kernel - withou-> | Paket     
   | kernel-vanilla-devel           | Development files necessary -> | Paket     
   | kernel-xen                     | The Xen Kernel                 | Paket     
   | kernel-xen                     | The Xen Kernel                 | Quellpaket
   | kernel-xen-base                | The Xen Kernel - base modules  | Paket     
   | kernel-xen-devel               | Development files necessary -> | Paket     
   | kerneloops                     | Tool to collect kernel oopse-> | Paket     
   | kerneloops-applet              | Tool to collect kernel oopse-> | Paket     
   | nfs-kernel-server              | Support Utilities for Kernel-> | Paket     
   | patterns-openSUSE-devel_kernel | Meta package for pattern dev-> | Paket   

zypper se -si 'kernel*' 打印以下内容:

 S | Name                 | Typ   | Version   | Arch   | Repository      
 --+----------------------+-------+-----------+--------+-----------------
 i | kernel-desktop       | Paket | 3.3.0-2.1 | x86_64 | 12.2 milestone 2
 i | kernel-desktop-devel | Paket | 3.3.0-2.1 | x86_64 | 12.2 milestone 2
 i | kernel-devel         | Paket | 3.3.0-2.1 | noarch | 12.2 milestone 2
 i | kernel-source        | Paket | 3.3.0-2.1 | noarch | 12.2 milestone 2

答案1

您没有提到您的 Linux 客户机运行的是哪个发行版。更多信息将有助于给出更具描述性的答案。

您应该安装其中一个(或两个)kernel-devel软件包kernel-headers。您可能还需要安装开发工具包或开发工具包组,以便 vmware-tools 可以进行编译。

答案2

关于如何在 OpenSUSE 12.2 上安装 VMware Workstation 9 的快速参考应该适用于此问题。它还修复了我的内核头错误。

如何在 Opensuse 12.2 上安装 vmware Workstation 9

  1. 下载适用于 Linux 的 VMware Workstation 9.0 二进制文件

  2. 下载后,您应该有一个类似于 VMware-Workstation-Full-9.0.0-812388.x86_64.bundle 的文件

  3. 现在打开终端并输入以下命令。实际上,您也可以使用 GUI 执行此步骤,但我更喜欢命令行:

    chmod +x VMware-Workstation-Full-9.0.0-812388.x86_64.bundle
    

现在使用命令安装

sh VMware-Workstation-Full-9.0.0-812388.x86_64.bundle

然后,VMware 安装程序将打开。按照向导操作,直到完成。

答案3

给定的错误是由于 VMware 配置脚本存在问题。

定位vmware-config-tools.pl(可能位于/usr/bin/vmware-config-tools.pl):

找到以下行vmware-config-tools.pl

$header_version_uts =~ s/^$pattern \"([^\"]*)\".*$/$1/;

将上面的行改为

$header_version_uts=$gSystem{'uts_release'};

有关 VMWare 知识库的更多信息,请单击这里

相关内容