您是否应该以 root 身份运行 vmware,或者有其他解决方法?

您是否应该以 root 身份运行 vmware,或者有其他解决方法?

我刚刚在 Arch Linux 上安装了 VMware Workstation Player 17。让它运行的唯一方法是在终端中使用 sudo 运行它。否则它会转到“欢迎使用 VMware Player”屏幕,要求您输入许可证密钥或免费使用它。我选择免费使用它,但是当我点击完成时它什么也没做。如果我在终端中以非 root 身份运行它,则按下完成并输入密码后的输出是第五行及以后的内容:

[user@computer ~]$ vmplayer
[AppLoader] Use shipped PC/SC Lite smart card framework.
An up-to-date "pcsc-lite-libs" or "libpcsclite1" package from your system is preferred.
I/O warning : failed to load external entity "/etc/vmware/hostd/proxy.xml"
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/lib/vmware/bin/vmware-setup-helper' as the super user
Authenticating as: user
Password: 
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.

如果我使用 sudo,则输出如下:

[user@computer ~]$ sudo vmplayer
[sudo] password for user: 
[AppLoader] Use shipped PC/SC Lite smart card framework.
An up-to-date "pcsc-lite-libs" or "libpcsclite1" package from your system is preferred.
I/O warning : failed to load external entity "/etc/vmware/hostd/proxy.xml"

我应该这样运行它吗,还是这是一个错误?以 root 身份运行它感觉很危险,所以我宁愿不这样做,但我必须运行它。如果这是一个错误/缺陷,我该如何修复该问题并在没有权限的情况下运行?谢谢

答案1

polkit-agent-helper-1:对 PolicyKit 守护进程的错误响应:GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed:没有 cookie 会话

显然,该错误是由于 polkit 中的一个错误造成的。不知何故,注册的身份验证代理pkexec无法按预期进行身份验证。

一个解决方法是必须pkexec在例如中有一个包装器(也称为)/usr/local/bin(假设它在PATH并且具有比实际的位置更高的优先级pkexec):

$ type pkexec
pkexec is /usr/local/bin/pkexec

$ cat /usr/local/bin/pkexec 
#!/bin/sh
pkttyagent & pid=$!
/usr/bin/pkexec "$@"
kill "$pid"

$ pkexec true
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/true' as the super user
Authenticating as: tom
Password: 
==== AUTHENTICATION COMPLETE ====

$ /usr/bin/pkexec true
==== AUTHENTICATING FOR org.freedesktop.policykit.exec ====
Authentication is needed to run `/usr/bin/true' as the super user
Authenticating as: tom
Password: 
polkit-agent-helper-1: error response to PolicyKit daemon: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: No session for cookie
==== AUTHENTICATION FAILED ====
Error executing command as another user: Not authorized

This incident has been reported.

请注意,pkttyagent只有当pkexec(或其调用者)从终端运行时,它才有效。为了使事情变得简单,您可能应该运行具有 GUI 支持的 polkit 代理。您没有运行该代理这一事实表明您可能正在使用 WM 而startx不是 DE。在这种情况下,您需要安装一个并在 中启动它~/.xinitrc。例如:

...
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
exec i3

相关内容