解决虚拟机ubuntu 18.04 安装VMwareTools不生效

就是按照一般步骤,结果不生效:

  1. 直接把WMwareTools拷贝出来到桌面吧
  2. 然后打开终端解压 命令:tar -xzvf VMwareTools-10.0.6-3595377.tar.gz
  3. 进入解压后的目录,执行:sudo ./wmware-install.pl 然后就一直回车了。
  4. 到最后提示成功,reboot就可以了。

但是安装时出现:
在安装vmware-tools时,出现

“The path "" is not valid path to the gcc binary”

确认安装gcc, 输入路径之后/usr/bin/gcc

“The path "/usr/bin/gcc" is not valid path to the gcc binary”

然后直接干脆直接no,
结果不生效。

查找原因,找到vmware-tools-distrib/bin/vmware-config-tools.pl 文件:
找到:

#
# Will either return a valid path to the GCC bin or will return
# nothing.
#
sub getValidGccPath {
  my $gcc_path = shift;
  my $modconfig = shift;
  my $appLoaderArgs = shift;
  my $answer;
  my $query;
  my $default;

  while (1) {
    if (system("$modconfig --validate-gcc \"$gcc_path\" $appLoaderArgs " .
           ">/dev/null 2>&1") == 0) {
      $query = "The path \"$gcc_path\" appears to be a valid path to the " .
           "gcc binary.";
      $default = 'no';
    } else {
      $query = "The path \"$gcc_path\" is not valid path to the gcc binary.";
      $default = 'yes';
      $gcc_path = '';
    }

    $answer = get_answer($query . "\n Would you like to change it?",
             'yesno', $default);
    if ($answer eq 'yes') {
      # Get new path.
      $gcc_path = query('What is the location of the gcc program ' .
            'on your machine?', $gcc_path, 0);
    } else {
      last;
    }
  }
  return $gcc_path;
}

加入输入路径,直接返回gcc_path的值return $gcc_path;

$gcc_path = query('What is the location of the gcc program ' .
        'on your machine?', $gcc_path, 0);
return $gcc_path;

安装完成,解决

你可能感兴趣的:(解决虚拟机ubuntu 18.04 安装VMwareTools不生效)