Difference between revisions of "VMware (简体中文)"

From ArchWiki
Jump to navigation Jump to search
m
(update interlanguage links)
Tag: wiki-scripts
 
(65 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
[[Category:Virtualization (简体中文)|AZVMWARE]]
 
[[Category:Virtualization (简体中文)|AZVMWARE]]
[[Category:简体中文|AZVMWARE]]
 
 
[[en:VMware]]
 
[[en:VMware]]
 
[[it:VMware]]
 
[[it:VMware]]
[[ru:VMware]]
+
[[ja:VMware]]
[[uk:VMware]]
+
{{Related articles start (简体中文)}}
{{Article summary start|概要}}
+
{{Related|:Category:Hypervisors}}
{{Article summary text|本文解释如何在 Arch 中安装和配置 VMware Workstation/Player。}}
+
{{Related2|Installing Arch Linux in VMware (简体中文)|在 VMware 中安装 Arch}}
{{Article summary heading|相关}}
+
{{Related2|VirtualBox (简体中文)|VirtualBox}}
{{Article summary wiki|Installing Arch Linux in VMware (简体中文)}}
+
{{Related2|KVM (简体中文)|KVM}}
{{Article summary wiki|VirtualBox (简体中文)}}
+
{{Related2|QEMU (简体中文)|QEMU}}
{{Article summary wiki|KVM (简体中文)}}
+
{{Related|Xen}}
{{Article summary wiki|QEMU (简体中文)}}
+
{{Related|Moving an existing install into (or out of) a virtual machine}}
{{Article summary wiki|Xen}}
+
{{Related articles end}}
{{Article summary wiki|Moving an existing install into (or out of) a virtual machine}}
+
{{TranslationStatus (简体中文)|VMware|2017-08-18|485222}}
{{Article summary end}}
+
 
{{translateme (简体中文)}}
+
本文是关于在 Arch 中安装 VMware,你也许想寻找的是 [[Installing Arch Linux in VMware (简体中文)|在 VMware 中安装 Arch Linux]]
本文是关于在 Arch 中安装 VMware,你也许想寻找的是 [[Installing Arch Linux in VMware (简体中文)|在 VMware 中安装 Arch Linux]]
+
{{注意|
 +
*这篇文章适用于最新的 VMware 正式版,即 VMware Workstation Pro / Player 12.5.
 +
*对于旧版本的 VMware,建议安装本体后追加安装 {{AUR|vmware-patch}} 包
 +
}}
  
 
== 安装 ==
 
== 安装 ==
  
{{注意| VMware Workstation/Player '''不会''' 被 pacman 管理,因为这些文件不是用它安装的。}}
+
[[Pacman|安装]] 依赖项:
 +
*{{pkg|fuse2}} - 提供 ''vmware-vmblock-fuse''
 +
*{{AUR|gksu}} - 支持需要 root 权限的操作(比如内存分配、注册许可证等等)
 +
*{{pkg|gtkmm}} - 支持 GUI
 +
*{{pkg|linux-headers}} - 模块编译所需
 +
*{{AUR|ncurses5-compat-libs}} - 支持安装程序的 {{ic|--console}} 选项
 +
*{{pkg|libcanberra}} - 支持事件提示音
  
'''1.''' 下载最新版的  [http://www.vmware.com/products/workstation/overview.html VMware Workstation] 或是 [http://www.vmware.com/products/player/overview.html VMware Player] (你也可以尝试 [http://communities.vmware.com/community/vmtn/beta testing (Beta/RC) versions])。
+
下载最新的 [https://www.vmware.com/go/tryworkstation VMware Workstation Pro] [https://www.vmware.com/go/downloadplayer Player] (或者[https://communities.vmware.com/community/vmtn/beta beta]版,如果有的话)。
  
'''2.''' 开始安装 ({{Ic|--console}} 使用终端代替 GUI):
+
开始安装:
$ chmod +x VMware-<edition>-<version>.<release>.<architecture>.bundle
+
  # sh VMware-''edition''-''version''.''release''.''architecture''.bundle
  # ./VMware-<edition>-<version>.<release>.<architecture>.bundle --console
 
  
'''3.''' 阅读并接受最终用户许可协议。
+
{{提示|一些常用的选项:
 +
*{{ic|--eulas-agreed}} - 跳过各种许可协议
 +
*{{ic|--console}} - 使用命令行界面,而非 GUI
 +
*{{ic|--custom}} - 允许自定义安装目录,比如{{ic|/usr/local}}(记得修改[[#Systemd 服务]]一节下,{{ic|vmware-usbarbitrator.service}}中的路径)
 +
*{{ic|-I}}, {{ic|--ignore-errors}} - 忽略致命错误
 +
*{{ic|1=--set-setting=vmware-workstation serialNumber XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}} - 设置安装时使用的序列号(有利于脚本化安装)
 +
*{{ic|--required}} - 只询问必要的问题(当结合{{ic|--eulas-agreed}}和{{ic|--console}}时可以实现静默安装)
 +
}}
  
'''4.''' 设置 {{Ic|System service scripts directory}} {{ic|/etc/init.d}}
+
当安装程序询问 {{ic|System service scripts directory}} 的设置时,输入 {{ic|/etc/init.d}} 即可。
  
'''5.''' (可选) 如果安装了 Eclipse ,在集成虚拟调试器中输入目录路径。
+
{{注意|安装过程中会收到{{ic|"No rc*.d style init script directories"}}错误。这可以安全忽略,因为Arch使用的是[[systemd]].}}
  
'''6.''' 你会得到一个关于 {{ic|"rc*.d style init script directories"}} 没有设置的错误。这个可以放心地忽略掉。
+
{{提示|如需重新编译模块,用这条命令:
 +
# vmware-modconfig --console --install-all
 +
}}
  
 
== 配置 ==
 
== 配置 ==
  
{{Tip|为了自动化本章节的内容,[[Arch User Repository|AUR]] 中也包含了一个叫做 {{AUR|vmware-patch}} 的软件包(它同时支持旧版本的 VMware )。}}
+
=== 内核模块 ===
  
{{Note|Ensure you have installed the correct headers required for building the modules ({{pkg|linux}} from {{ic|[core]}} uses {{pkg|linux-headers}}).}}
+
VMware Workstation 12.5 最高支持内核 4.8.
  
=== 模块工具路径 ===
+
=== Systemd 服务 ===
'''7.''' The {{ic|module tool paths}} of certain Workstation scripts now need to be pointed to {{ic|/usr/bin/}} instead of {{ic|/sbin/}}. These include the service script in {{ic|/etc/init.d/}} and some other ones in {{ic|/usr/bin/}}.
 
  
==== 1) 短期的解决方案 ====
+
''(可选)'' 你也可以创建一个 {{ic|.service}} 文件 (也可以用[[AUR]]中的{{AUR|vmware-systemd-services}}包),而不是直接使用 {{ic|/etc/init.d/vmware}} ({{ic|<nowiki>start|stop|status|restart</nowiki>}}) 和 {{ic|/usr/bin/vmware-usbarbitrator}} 来管理服务:
短期的解决方案是直接编辑这些文件。因此每次更新你都需要重复做一遍。
 
  
* 对于 Workstation:
+
{{hc|/etc/systemd/system/vmware.service|
# perl -p -i -e 's|/sbin/(?!modprobe)|/usr/bin/|g' /etc/init.d/vmware /usr/bin/vm-support /usr/bin/vmplayer /usr/bin/vmware /usr/bin/vmware-hostd /usr/bin/vmware-wssc-adminTool
+
2=[Unit]
 +
Description=VMware daemon
 +
Requires=vmware-usbarbitrator.service
 +
Before=vmware-usbarbitrator.service
 +
After=network.target
  
* 对于 Player:
+
[Service]
# perl -p -i -e 's|/sbin/(?!modprobe)|/usr/bin/|g' /etc/init.d/vmware /usr/bin/vm-support /usr/bin/vmplayer
+
ExecStart=/etc/init.d/vmware start
 +
ExecStop=/etc/init.d/vmware stop
 +
PIDFile=/var/lock/subsys/vmware
 +
RemainAfterExit=yes
  
==== 2) 长期的解决方案 ====
+
[Install]
你可能需要创建符号链接:
+
WantedBy=multi-user.target
# ln -s /usr/bin/insmod /usr/bin/lsmod /usr/bin/modinfo /usr/bin/rmmod /sbin/
+
}}
  
=== VMware 模块补丁及安装 ===
+
{{hc|/etc/systemd/system/vmware-usbarbitrator.service|
VMware Workstation 9 和 Player 5 都支持到 3.9 的内核。
+
2=[Unit]
{{Note|相对的,本章节目前仅适用于低于 9.0.2 版本的 VMware Workstation 和低于 5.0.2 版本的 Player 。}}
+
Description=VMware USB Arbitrator
{{Note|Due to different VMware versions, you may need to set the {{ic|vmreqver}} or {{ic|plreqver}} variable for VMware Workstation or Player respectively in the {{ic|patch-modules_3.X.0.sh}} script.}}
+
Requires=vmware.service
 +
After=vmware.service
  
The following patches will also install the modules afterwards by executing {{ic|# vmware-modconfig --console --install-all}}.
+
[Service]
 +
ExecStart=/usr/bin/vmware-usbarbitrator
 +
ExecStop=/usr/bin/vmware-usbarbitrator --kill
 +
RemainAfterExit=yes
  
==== 3.7 kernels and up ====
+
[Install]
With the arrival of 3.7 the directory structure of the uapi sources (and thus the headers) has [http://lkml.org/lkml/2012/10/14/281 changed]. The missing kernel header {{ic|version.h}} can be [http://rglinuxtech.com/?p=562 symlinked] with:
+
WantedBy=multi-user.target
# ln -s /usr/src/linux-'''$(uname -r)'''/include/generated/uapi/linux/version.h /usr/src/linux-'''$(uname -r)'''/include/linux/
+
}}
You can replace "'''{{ic|$(uname -r)}}'''" with any kernel not currently running.
 
{{Note|You will need to redo this upon every kernel update.}}
 
 
 
==== 3.8 / 3.9 内核 ====
 
In addition to the header symlink outlined above 3.8/3.9 kernels also need [http://communities.vmware.com/thread/432897 this] (packaged together with the script in [https://github.com/willysr/SlackHacks/tree/master/vmware/vmware-3.8 here]):
 
 
 
$ cd /tmp
 
$ curl -O https://raw.github.com/willysr/SlackHacks/master/vmware/vmware-3.8/vmware9.0.1_kernel3.8.zip
 
$ bsdtar -xvf vmware9.0.1_kernel3.8.zip
 
# ./patch-modules_3.8.0.sh
 
  
==== 3.5 / 3.6 / 3.7 内核 ====
+
如果你想在另一个Workstation服务器控制台上连接此次安装的VMware Workstation,请添加下面的服务
A change in the format of the kernel exception table introduced back in [http://repo.or.cz/w/linux-2.6.git/commit/706276543b699d80f546e45f8b12574e7b18d952 April] affecting the {{ic|vmmon}} module is known to cause crashes in [http://communities.vmware.com/thread/400616 Fedora guests]. The patch [http://communities.vmware.com/message/2092356#2092356 here] creates a portable exception table (packaged together with the script [http://communities.vmware.com/message/2103172#2103172 in here], which will also reload the {{ic|vmmon}} module):
 
  
$ cd /tmp
+
{{hc|/etc/systemd/system/vmware-workstation-server.service|
$ curl -O http://communities.vmware.com/servlet/JiveServlet/download/2103172-94260/vmware9_kernel35_patch.tar.bz2
 
$ tar -xvf --strip-components=1 vmware9_kernel35_patch.tar.bz2  # The "--strip-components=1" flag extracts the files only
 
# ./patch-modules_3.5.0.sh
 
 
 
=== Systemd 服务 ===
 
'''8.''' (可选) Instead of using {{ic|<nowiki># /etc/init.d/vmware {start|stop|status|restart}</nowiki>}} directly to manage the services you may also create a {{ic|.service}} file (or [http://communities.vmware.com/docs/DOC-20855 files]):
 
 
 
{{hc|/etc/systemd/system/vmware.service|
 
 
2=[Unit]
 
2=[Unit]
Description=VMware daemon
+
Description=VMware Workstation Server
 +
Requires=vmware.service
 +
After=vmware.service
  
 
[Service]
 
[Service]
ExecStart=/etc/init.d/vmware start
+
ExecStart=/etc/init.d/vmware-workstation-server start
ExecStop=/etc/init.d/vmware stop
+
ExecStop=/etc/init.d/vmware-workstation-server stop
PIDFile=/var/lock/subsys/vmware
+
PIDFile=/var/lock/subsys/vmware-workstation-server
TimeoutSec=0
 
 
RemainAfterExit=yes
 
RemainAfterExit=yes
  
Line 105: Line 112:
 
}}
 
}}
  
开机启动 {{ic|.service}}
+
之后您就可以在启动时[[enable]]它们.
  # systemctl enable vmware
+
 
 +
==== Workstation Server服务 ====
 +
 
 +
服务{{ic|vmware-workstation-server.service}}将调用{{ic|wssc-adminTool}},即使后者已经被重命名作{{ic|vmware-wssc-adminTool}}.
 +
 
 +
这将阻止该服务启动。创建一个文件链接可以修复这个问题:
 +
 
 +
  # ln -s wssc-adminTool /usr/lib/vmware/bin/vmware-wssc-adminTool
  
 
== 启动程序 ==
 
== 启动程序 ==
  
'''9.''' 现在,打开你的 VMware Workstation (终端中,{{Ic|vmware}}) 或是 VMware Player (终端中,{{Ic|vmplayer}}) 使用吧!
+
启动VMware Workstation Pro:
 +
$ vmware
  
{{Tip|使用以下命令(重)编译模块:
+
或Player:
  # vmware-modconfig --console --install-all
+
  $ vmplayer
}}
+
 
 +
== 提示和技巧 ==
  
== Tips & Tricks ==
+
=== 输入Workstation Pro许可密钥===
  
=== 从终端中输入 Workstation 许可密钥 ===
+
==== 从终端 ====
 
  # /usr/lib/vmware/bin/vmware-vmx-debug --new-sn XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
 
  # /usr/lib/vmware/bin/vmware-vmx-debug --new-sn XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
  
 
{{ic|XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}} 处是你的许可密钥。
 
{{ic|XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}} 处是你的许可密钥。
 +
 +
{{Note|The {{ic|-debug}} binary informs the user of an incorrect license.}}
 +
 +
==== 从 GUI ====
 +
 +
如果以上方法无效,你可以试试:
 +
 +
# /usr/lib/vmware/bin/vmware-enter-serial
  
 
=== 解压缩 VMware BIOS ===
 
=== 解压缩 VMware BIOS ===
 +
 
  $ objcopy /usr/lib/vmware/bin/vmware-vmx -O binary -j bios440 --set-section-flags bios440=a bios440.rom.Z
 
  $ objcopy /usr/lib/vmware/bin/vmware-vmx -O binary -j bios440 --set-section-flags bios440=a bios440.rom.Z
 
  $ perl -e 'use Compress::Zlib; my $v; read STDIN, $v, '$(stat -c%s "./bios440.rom.Z")'; $v = uncompress($v); print $v;' < bios440.rom.Z > bios440.rom
 
  $ perl -e 'use Compress::Zlib; my $v; read STDIN, $v, '$(stat -c%s "./bios440.rom.Z")'; $v = uncompress($v); print $v;' < bios440.rom.Z > bios440.rom
 +
 +
=== 解压缩安装程序 ===
 +
 +
查看安装程序{{ic|.bundle}}的内容:
 +
 +
$ sh VMware-''edition''-''version''.''release''.''architecture''.bundle --extract ''/tmp/vmware-bundle/''
  
 
==== 使用修改过的 BIOS ====
 
==== 使用修改过的 BIOS ====
If and when you decide to modify the extracted BIOS you can make your virtual machine use it by moving it to {{ic|~/vmware/<Virtual machine name>}}:
 
$ mv bios440.rom ~/vmware/<Virtual machine name>/
 
  
then adding the name to the {{Ic|<Virtual machine name>.vmx}} file:
+
如果你决定修改解压出的BIOS,你可以通过将其移动至{{ic|~/vmware/<Virtual machine name>}}来让虚拟机使用它:
{{hc|~/vmware/<Virtual machine name>/<Virtual machine name>.vmx|2=bios440.filename = "bios440.rom"}}
+
 
 +
$ mv bios440.rom ~/vmware/''Virtual_machine_name''/
 +
 
 +
然后在 {{Ic|<Virtual machine name>.vmx}} 文件中加入它的名称:
 +
 
 +
{{hc|~/vmware/''Virtual_machine_name''/''Virtual_machine_name''.vmx|2=bios440.filename = "bios440.rom"}}
 +
 
 +
=== 在Intel和Optimus上启用3D图形 ===
  
=== 写时复制 (CoW) ===
+
由于不理想和(或)不稳定的3D加速,某些图形驱动是默认被阻止的。当启用''Accelerate 3D graphics''后,log中应该会出现:
CoW comes with some advantages, but can negatively affect performance with large files that have small random writes (例如数据库文件和虚拟机镜像):
 
  
  $ chattr +C ~/vmware/<Virtual machine name>/<Virtual machine name>.vmx
+
  Disabling 3D on this host due to presence of Mesa DRI driver.  Set mks.gl.allowBlacklistedDrivers = TRUE to override.
  
{{Note|1=From the [http://www.linuxhowtos.org/manpages/1/chattr.htm?print=-51 chattr man page]: ''"For btrfs, the {{ic|C}} flag should be set only on new or empty files. If set on a file which already has data blocks, it is undefined when the blocks assigned to the file will be fully stable. If set on a directory, only new files will be affected."''}}
+
这表示:
  
=== 使用 DKMS 管理模块 ===
+
{{hc|~/.vmware/preferences|2=
The Dynamic Kernel Module Support (DKMS) can be used to manage Workstation modules and to void from re-running {{ic|vmware-modconfig}} each time the kernel changes. The following example uses a custom {{ic|Makefile}} to compile and install the modules through {{ic|vmware-modconfig}}. Afterwards they are removed from the current kernel tree.
+
mks.gl.allowBlacklistedDrivers = TRUE
 +
}}
  
==== 准备 ====
+
== 疑难解答 ==
First install {{pkg|dkms}} from the [[Community repository]]:
 
# pacman -S dkms
 
  
then create a source directory for the {{ic|Makefile}} and the {{ic|dkms.conf}}:
+
=== 错误:Kernel headers for version 4.x-xxxx were not found. If you installed them[...] ===
# mkdir /usr/src/vmware-modules-9/
 
  
==== Build configuration ====
+
安装 {{Pkg|linux-headers}}。
Fetch the files from Git or use the ones below.
 
  
===== 1) 使用 Git =====
+
{{Note|更新内核和头文件会需要你启动新的内核以匹配头文件的版本。这是一个相对常见的错误。}}
$ cd /tmp
 
$ git clone git://github.com/djod4556/dkms-workstation.git
 
# cp /tmp/dkms-workstation.git/Makefile /tmp/dkms-workstation.git/dkms.conf /usr/src/vmware-modules-9/
 
  
===== 2) 手动安装 =====
+
=== 无法识别 USB 设备 ===
The {{ic|dkms.conf}} describes the module names and the compilation/installation procedure. {{ic|1=AUTOINSTALL="yes"}} tells the modules to be recompiled/installed automatically each time:
 
  
{{hc|/usr/src/vmware-modules-9/dkms.conf|
+
{{提示|可以通过 {{AUR|vmware-patch}} 解决。}}
2=PACKAGE_NAME="vmware-modules"
 
PACKAGE_VERSION="9"
 
  
MAKE[0]="make all"
+
如果不使用[[#Systemd 服务]]来处理服务,你每次都需要以root身份手动启动{{ic|vmware-usbarbitrator}}.
CLEAN="make clean"
 
  
BUILT_MODULE_NAME[0]="vmmon"
+
启动:
BUILT_MODULE_LOCATION[0]="modules"
 
  
BUILT_MODULE_NAME[1]="vmnet"
+
# vmware-usbarbitrator
BUILT_MODULE_LOCATION[1]="modules"
 
  
BUILT_MODULE_NAME[2]="vmblock"
+
停止:
BUILT_MODULE_LOCATION[2]="modules"
 
  
BUILT_MODULE_NAME[3]="vmci"
+
# vmware-usbarbitrator --kill
BUILT_MODULE_LOCATION[3]="modules"
 
  
BUILT_MODULE_NAME[4]="vsock"
+
=== 当远程访问VMware时,遇到不正确的用户名/密码错误 ===
BUILT_MODULE_LOCATION[4]="modules"
 
  
DEST_MODULE_LOCATION[0]="/extra/vmware"
+
VMware Workstation通过{{ic|vmware-workstation-server}}服务来提供远程管理共享的虚拟机的功能。然而,这将以错误{{ic|"incorrect username/password"}}而告终,因为{{ic|vmware-authd}}服务中,[[PAM]]的相关配置出错了。通过编辑{{ic|/etc/pam.d/vmware-authd}}来解决问题:
DEST_MODULE_LOCATION[1]="/extra/vmware"
 
DEST_MODULE_LOCATION[2]="/extra/vmware"
 
DEST_MODULE_LOCATION[3]="/extra/vmware"
 
DEST_MODULE_LOCATION[4]="/extra/vmware"
 
  
AUTOINSTALL="yes"
+
{{hc|/etc/pam.d/vmware-authd|
 +
#%PAM-1.0
 +
auth    ''required      pam_unix.so''
 +
account  ''required      pam_unix.so''
 +
password ''required      pam_permit.so''
 +
session  ''required      pam_unix.so''
 
}}
 
}}
  
and now the {{ic|Makefile}}:
+
然后重新启动{{ic|vmware}}[[systemd]]服务。
  
{{hc|/usr/src/vmware-modules-9/Makefile|
+
现在你能通过安装时提供的身份信息来登录这个服务器了。
2=KERNEL := $(KERNELRELEASE)
 
HEADERS := /usr/src/linux-$(KERNEL)/include
 
GCC := $(shell vmware-modconfig --console --get-gcc)
 
DEST := /lib/modules/$(KERNEL)/vmware
 
  
TARGETS := vmmon vmnet vmblock vmci vsock
+
{{Note|也许会需要{{Pkg|libxslt}}来启动虚拟机}}
  
LOCAL_MODULES := $(addsuffix .ko, $(TARGETS))
+
=== ALSA输出的问题 ===
  
all: $(LOCAL_MODULES)
+
[http://bankimbhavsar.blogspot.co.nz/2011/09/hd-audio-in-vmware-fusion-4-and-vmware.html 修复]音质问题或正确启用高清音频输出。首先执行:
        mkdir -p modules/
 
        mv *.ko modules/
 
        rm -rf $(DEST)
 
        depmod
 
  
/usr/src/linux-$(KERNEL)/include/linux/version.h:
+
$ aplay -L
        ln -s /usr/src/linux-$(KERNEL)/include/generated/uapi/linux/version.h /usr/src/linux-$(KERNEL)/include/linux/
 
  
%.ko: /usr/src/linux-$(KERNEL)/include/linux/version.h
+
如果希望在客户机中播放5.1 ''立体声'',寻找{{ic|1=surround51:CARD=''vendor_name'',DEV=''num''}};如果存在音质问题,寻找{{ic|1=front:CARD=''vendor_name'',DEV=''num''}}。最后将名称加入到{{ic|.vmx}}文件中:
        vmware-modconfig --console --build-mod -k $(KERNEL) $* $(GCC) $(HEADERS) vmware/
 
        cp -f $(DEST)/$*.ko .
 
  
clean:
+
{{hc|~/vmware/''Virtual_machine_name''/''Virtual_machine_name''.vmx|2=
        rm -rf modules/
+
sound.fileName=''"surround51:CARD=Live,DEV=0"''
 +
sound.autodetect=''"FALSE"''
 
}}
 
}}
  
==== 安装 ====
+
[[Advanced_Linux_Sound_Architecture#OSS_compatibility|OSS模拟]]也应该被禁用.
The modules can then be registered:
 
  
# dkms -m vmware-modules -v 9 -k $(uname -r) add
+
=== 错误:Kernel-based Virtual Machine (KVM) is running ===
  
编译:
+
禁止{{ic|KVM}}自动启动,你可以:
  
# dkms -m vmware-modules -v 9 -k $(uname -r) build
+
{{hc|/etc/modprobe.d/vmware.conf|
 +
blacklist kvm
 +
blacklist kvm-amd  # For AMD CPUs
 +
blacklist kvm-intel # For Intel CPUs
 +
}}
  
安装:
+
===组件问题===
  
# dkms -m vmware-modules -v 9 -k $(uname -r) install
+
==== 错误:/dev/vmmon not found ====
  
If everything went well, the modules will now be recompiled automatically the next time the kernel changes.
+
完整的错误是:
  
== Troubleshooting ==
 
 
=== Could not open /dev/vmmon: No such file or directory. ===
 
完整的错误是:
 
 
  Could not open /dev/vmmon: No such file or directory.
 
  Could not open /dev/vmmon: No such file or directory.
 
  Please make sure that the kernel module `vmmon' is loaded.
 
  Please make sure that the kernel module `vmmon' is loaded.
  
这意味这至少 {{Ic|vmmon}} VMware 服务没有运行。如果使用步骤 8 中的 {{ic|.service}} 文件,可以这样启动 VMware 服务:
+
这意味着未加载{{ic|vmmon}}模块.参见[[#Systemd 服务]]章节
  # systemctl start vmware
+
 
 +
==== 错误:/dev/vmci not found ====
 +
 
 +
完整的错误是:
 +
 
 +
Failed to open device "/dev/vmci": No such file or directory
 +
Please make sure that the kernel module 'vmci' is loaded.
 +
 
 +
尝试重新编译VMware内核模块:
 +
 
 +
  # vmware-modconfig --console --install-all
 +
 
 +
==== 在Linux 4.9后内核模块无法编译 ====
  
或者输入:
+
对于VMware Workstation Pro 12.5.2,模块的源码必须作出修改,以便于在Linux 4.9上编译 [http://rglinuxtech.com/?p=1847]。
# /etc/init.d/vmware start
 
  
=== Kernel headers for version 3.x-xxxx were not found. If you installed them[...] ===
+
# cd /usr/lib/vmware/modules/source
安装这些软件包:
+
# tar xf vmmon.tar
  # pacman -S linux-headers
+
# mv vmmon.tar vmmon.old.tar
 +
# sed -i 's/uvAddr, numPages, 0, 0/uvAddr, numPages, 0/g' vmmon-only/linux/hostif.c
 +
# tar cf vmmon.tar vmmon-only
 +
  # rm -r vmmon-only
  
{{Note|更新内核和头文件会需要你启动新的内核以匹配头文件的版本。这是一个相对常见的错误。}}
+
# tar xf vmnet.tar
 +
# mv vmnet.tar vmnet.old.tar
 +
# sed -i 's/addr, 1, 1, 0/addr, 1, 0/g' vmnet-only/userif.c
 +
# tar cf vmnet.tar vmnet-only
 +
# rm -r vmnet-only
 +
 
 +
==== VMware模块在Linux内核4.11+上(在GCC7下)编译失败 ====
  
=== 无法识别 USB 设备 ===
+
运行vmware-modconfig时返回:
{{Tip|可以通过 {{AUR|vmware-patch}} 解决。}}
+
Failed to get gcc information.
  
==== 1) 缺少 {{ic|vmware-USBArbitrator}} 脚本 ====
+
详细的错误信息能在日志中被找到:
由于种种原因,一些安装会缺少 {{ic|vmware-USBArbitrator}} 脚本。手动重新添加这个文件,查看 [https://bbs.archlinux.org/viewtopic.php?pid=1003117#p1003117 this forum post].
+
modconfig| I125: Got gcc version "6.3.1".
 +
modconfig| I125: GCC major version 6 does not match Kernel GCC major version 7.
 +
modconfig| I125: The GCC compiler "/sbin/gcc" cannot be used for the target kernel.
  
You may also manually extract the VMware bundle and copy the {{ic|vmware-USBArbitrator}} script from {{ic|<destination folder>/vmware-usbarbitrator/etc/init.d/}} to {{ic|/etc/init.d/}}:
+
为跳过检查,使用下面的解决方案:
  $ ./VMware-<edition>-<version>.<release>.<architecture>.bundle --extract /tmp/vmware-bundle
+
# sed 's/gcc version 7/gcc version 6/' /proc/version > /tmp/version
  # cp /tmp/vmware-bundle/vmware-usbarbitrator/etc/init.d/vmware-USBArbitrator /etc/init.d/
+
  # mount --bind /tmp/version /proc/version
 +
  # vmware-modconfig --console --install-all
 +
# umount /proc/version && rm /tmp/version
  
==== 2) The {{ic|vmware-usbarbitrator}} binary is segfaulting ====
+
==== VMware 模块在 Linux 4.13 版内核上编译失败 ====
This could also mean that the {{ic|vmware-usbarbitrator}} binary called in the script is [https://bbs.archlinux.org/viewtopic.php?pid=1156789 segfaulting]:
 
{{hc|# vmware-usbarbitrator|
 
Pipe unexpectedly closed.
 
}}
 
{{hc|# vmware-usbarbitrator --info -f|
 
VTHREAD initialize main thread 2 "usbArb" pid 6426
 
Segmentation fault
 
}}
 
  
This is caused by an empty {{ic|/etc/arch-release}} (owned by {{pkg|filesystem}}). It is used by the service to alter its behavior based on the distribution's release version.
+
VMware Workstation Pro 12.5.7 版本的内核模块代码需要做出一定修改,才能够成功地为 4.13 版 Linux 内核编译。出处:[https://communities.vmware.com/thread/568089]。
  
To fix it, add a version string in the form of {{ic|<year>.<month>(.<day>)}} (e.g. {{ic|[https://www.archlinux.org/download/ 2013.04.01]}}).
+
# cd /usr/lib/vmware/modules/source
 +
# tar xf vmnet.tar
 +
# mv vmnet.tar vmnet.old.tar
 +
# sed -i 's/atomic_inc(&clone->users);/clone = skb_get(clone);/g' vmnet-only/bridge.c
 +
# tar cf vmnet.tar vmnet-only
 +
# rm -r vmnet-only
  
=== process XXXX: Attempt to remove filter function [...] ===
+
=== 安装程序启动失败 ===
The full error is, for example:
 
process 6094: Attempt to remove filter function 0xadcc96f0 user data 0xb795aba0, but no such filter has been added
 
  D-Bus not built with -rdynamic so unable to print a backtrace
 
Aborted
 
  
This means that the hal daemon is not running. Install {{AUR|hal}} from the [[AUR]] and start the daemon with:
+
如果你回到了执行{{ic|.bundle}}时的终端提示,则这个版本的VMware Installer也许坏掉了或者不完整,你应该删掉它(你也许也应该参照[[#卸载]]一节中的内容):
# hald
 
  
=== The installer fails to start ===
 
If you just get back to the prompt when opening the {{ic|.bundle}}, then you probably have a deprecated or broken version of the VMware installer and you should remove it (you may also refer to the [[#Uninstallation|uninstallation]] section of this article):
 
 
  # rm -r /etc/vmware-installer
 
  # rm -r /etc/vmware-installer
  
=== Incorrect login/password when trying to access VMware remotely ===
+
==== 用户界面初始化失败 ====
VMware Workstation 9 provides the possibility to remotely manage Shared VMs through the {{ic|vmware-workstation-server}} service. However, this will fail with the error {{ic|"incorrect username/password"}} due to incorrect PAM configuration of the {{ic|vmware-authd}} service. To fix it, edit {{ic|/etc/pam.d/vmware-authd}} like this:
 
  
{{hc|/etc/pam.d/vmware-authd|
+
你也许会看到这样的错误:
#%PAM-1.0
+
 
auth    required      pam_unix.so
+
Extracting VMware Installer...done.
account required      pam_unix.so
+
No protocol specified
password required      pam_permit.so
+
No protocol specified
session required      pam_unix.so
+
User interface initialization failed.  Exiting.  Check the log for details.
}}
+
 
 +
这可以通过安装{{AUR|ncurses5-compat-libs}}或者临时允许X拥有root权限来解决:
 +
 
 +
$ xhost +
 +
$ sudo ./<vmware filename>.bundle
 +
$ xhost -
 +
 
 +
=== VMware启动失败 ===
 +
 
 +
==== 旧的Intel微指令在启动时产生段错误 ====
 +
 
 +
旧的Intel微指令可能会在启动时产生这样的段错误:
 +
 
 +
/usr/bin/vmware: line 31: 4941 Segmentation fault "$BINDIR"/vmware-modconfig --appname="VMware Workstation" --icon="vmware-workstation"
 +
 
 +
参阅[[Microcode]]了解如何更新微指令
 +
 
 +
==== 版本号为12.5.4的vmplayer/vmware无法启动 ====
 +
 
 +
如[https://bbs.archlinux.org/viewtopic.php?id=224667]中所述,临时的解决方案是将包{{ic|libpng}}降级至1.6.28-1版本,并将其加入{{ic|IgnorePkg}}参数以忽略升级(参见[[Pacman#Skip_package_from_being_upgraded|/etc/pacman.conf]])。
 +
 
 +
更方便的解决方案是令VMware使用系统的zlib而不是它自己的:
 +
 
 +
# cd /usr/lib/vmware/lib/libz.so.1
 +
# mv libz.so.1 libz.so.1.old
 +
# ln -s /usr/lib/libz.so.1 .
 +
 
 +
==== 版本号为12.5.3-12.5.5的vmplayer/vmware无法启动 ====
 +
 
 +
这貌似是文件{{ic|/usr/lib/vmware/lib/libstdc++.so.6/libstdc++.so.6}}中的问题,{{ic|CXXABI_1.3.8}}缺失。
 +
 
 +
如果系统安装了{{pkg|gcc-libs}}或者{{pkg|gcc-libs-multilib}}{{Broken package link|replaced by {{Pkg|gcc-libs}}}},那个库就已经被安装了。因此,直接移除那个出错的文件将使vmplayer使用gcc-libs提供的版本。使用root执行:
 +
 
 +
# mv /usr/lib/vmware/lib/libstdc++.so.6/libstdc++.so.6 /usr/lib/vmware/lib/libstdc++.so.6/libstdc++.so.6.bak
 +
 
 +
同时有另一个解决方案:
 +
 
 +
# export VMWARE_USE_SHIPPED_LIBS='yes'
 +
 
 +
==== vmware 12的进程在启动之后立即终止,没有显示GUI ====
 +
 
 +
这是[https://bugs.mageia.org/show_bug.cgi?id=9739 Mageia]中已知的Bug,但是对于Arch,终端里似乎并没有任何错误信息输出。检阅位于{{ic|/tmp/vmware-<id>}}里的日志文件,会发现启动vmware或vmplaer后,产生了{{ic|VMWARE_SHIPPED_LIBS_LIST is not set}}, {{ic|VMWARE_SYSTEM_LIBS_LIST is not set}}, {{ic|VMWARE_USE_SHIPPED_LIBS is not set}}, {{ic|VMWARE_USE_SYSTEM_LIBS is not set}}问题。进程在{{ic|Unable to execute /usr/lib/vmware/bin/vmware-modconfig.}}后结束。解决方案是,以root身份执行:
 +
 
 +
# mv /etc/vmware/icu/icudt44l.dat /etc/vmware/icu/icudt44l.dat.bak
 +
 
 +
同时有另一个解决方案:
 +
 
 +
# export VMWARE_USE_SHIPPED_LIBS='yes'
 +
 
 +
如果在版本'''12.5.7'''上出现问题,并且移动{{ic|icudt44l.dat}}或者设置{{ic|VMWARE_USE_SHIPPED_LIBS}}为{{ic|yes}}不起作用,或者在终端内执行{{ic|vmplayer}}无输出,尝试以root权限执行:
 +
 
 +
# cd /usr/lib/vmware/lib/libz.so.1
 +
  # mv libz.so.1 libz.so.1.old
 +
# ln -s /usr/lib/libz.so.1 .
 +
 
 +
尽管设置了VMWARE_USE_SHIPPED_LIBS变量,VMware仍有可能找不到某些库文件,比如libfontconfig.so.1。查看VMware位于tmp目录中的日志来检查哪些库文件未被找到,并将对应的系统库文件拷贝至合适的路径:
 +
 
 +
  # cp /usr/lib/libfontconfig.so.1 /usr/lib/vmware/lib/libfontconfig.so.1/
 +
 
 +
=== 客户机问题 ===
 +
 
 +
==== 无法为客户机下载VMware Tools ====
 +
 
 +
访问[http://softwareupdate.vmware.com/cds/vmw-desktop/ VMware repository]来手动下载这些工具。
 +
 
 +
导航至:"''application name'' / ''version'' / ''build ID'' / linux / packages/"来下载合适的工具。
 +
 
 +
解压:
 +
 
 +
$ tar -xvf vmware-tools-''name''-''version''-''buildID''.x86_64.component.tar
 +
 
 +
并通过VMware安装程序安装:
 +
 
 +
# vmware-installer --install-component=''/path/''vmware-tools-''name''-''version''-''buildID''.x86_64.component
 +
 
 +
如果上述步骤不管用,尝试安装{{AUR|ncurses5-compat-libs}}
 +
 
 +
==== 错误:Guests have incorrect system clocks or are unable to boot: "[...]timeTracker_user.c:234 bugNr=148722" ====
 +
 
 +
这是由于在VMware Linux中[http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&externalId=1591 不完整的]对电源管理功能的支持导致的CPU频率的变化([[Wikipedia:Intel speedstep|Intel SpeedStep]]和[[Wikipedia:AMD powernow|AMD PowerNow!]]/[[Wikipedia:Cool'n'Quiet|Cool'n'Quiet]])。2012年,随着[https://projects.archlinux.org/svntogit/packages.git/commit/trunk/config.x86_64?h=packages/linux&id=9abe018d91a5d8c3af7523d30b8aa73f86b680be linux 3.3-1]的发布,最大CPU频率[[CPU frequency governors|Performance]]的管理者被动态的''Ondemand''替代。当宿主的CPU频率变化时,客户机的时钟会运行过快或过慢,同时也可能会导致客户机无法启动。
  
and restart VMware services with:
+
为规避该问题,宿主CPU的最高频率可以被指定,并禁用[[Wikipedia:Time Stamp Counter|时间戳计数器]](TSC)。在整体设置中:
# systemctl restart vmware
 
  
Now you can connect to the server with the credentials provided during the installation.
+
{{hc|/etc/vmware/config|2=
 +
host.cpukHz = "X"  # The maximum speed in KHz, e.g. 3GHz is "3000000".
 +
host.noTSC = "TRUE" # Keep the Guest system clock accurate even when
 +
ptsc.noTSC = "TRUE" # the time stamp counter (TSC) is slow.
 +
}}
  
{{Note|{{Pkg|libxslt}} may be required for starting virtual machines.}}
+
{{提示|若要每隔一分钟修正一次时钟,在VMware Tools下的''Options''选项卡中,启用: ''"Time synchronization between the virtual machine and the host operating system"''.}}
  
=== Issues with ALSA output ===
+
==== Guests系统启动后网络不可用 ====
The following instructions from [http://bankimbhavsar.blogspot.co.nz/2011/09/hd-audio-in-vmware-fusion-4-and-vmware.html Bankim Bhavsar's wiki] show how to manually adjust the [[ALSA]] output device in a VMware {{ic|.vmx}} file. This might help with quality issues or with enabling proper HD audio output:
 
  
# Suspend/Power off the VM.
+
这可能是 {{ic|vmnet}} 模块没有加载 [http://www.linuxquestions.org/questions/slackware-14/could-not-connect-ethernet0-to-virtual-network-dev-vmnet8-796095/]。又见[[#Systemd 服务]]自动加载。
# Run {{ic|aplay -L}}
 
# If you are interested in playing 5.1 surround sound from the guest, look for {{ic|1=surround51:CARD=vendor-name,DEV=num}}. If you are experiencing quality issues, look out for a line starting with front.  
 
# Open the {{ic|<Virtual machine name>.vmx}} config file of the VM in a text editor, located under {{ic|~/vmware/<Virtual machine name>/}}, and edit the {{ic|sound.fileName}} field, e.g.: {{ic|1=sound.fileName="surround51:CARD=Live,DEV=0"}}. Ensure that it also reads {{ic|1=sound.autodetect="FALSE"}}.
 
# Resume/Power on the VM.
 
  
 
== 卸载 ==
 
== 卸载 ==
  
To uninstall VMware you need the product name ({{ic|vmware-workstation}} 或是 {{ic|vmware-player}})。列出所有的产品:
+
为卸载VMware你首先需要知道产品名称({{ic|vmware-workstation}} 或是 {{ic|vmware-player}})。列出所有的产品:
 
  # vmware-installer -l
 
  # vmware-installer -l
  
卸载:
+
然后通过下面的指令卸载(使用{{ic|--required}}跳过所有的确认):
  # vmware-installer -u <vmware-product>
+
  # vmware-installer -u ''product'' --required
  
Manually included symlinks have to be removed manually in {{ic|/sbin/}}:
+
{{提示|加上{{ic|--console}}来使用终端UI}}
# rm /sbin/insmod /sbin/lsmod /sbin/modinfo /sbin/rmmod
 
  
记得也要删除 {{ic|.service}} 文件:
+
记得要[[disable]]和删除{{ic|.service}}文件:
# systemctl disable vmware
 
 
  # rm /etc/systemd/system/vmware.service
 
  # rm /etc/systemd/system/vmware.service
 +
# rm /etc/systemd/system/vmware-usbarbitrator.service
  
You may also want to have a look at the kernel directories in {{ic|/usr}} for any leftovers. The now unnecessary [[#3.7 kernels and up]] patching step leaves header directories in {{ic|/usr/src/}} (full path: {{ic|/usr/src/linux-''[kernel name]''/include/linux/version.h}}).
+
你可能还需要清理在{{ic|/usr/lib/modules/''kernel_name''/misc/}}下的冗余文件,并且如果目录{{ic|/etc/init.d/}}是空的话,删除它。
 
 
模块目录位于 {{ic|/usr/lib/modules/''[kernel name]''/misc/}}
 

Latest revision as of 07:11, 15 October 2019

翻译状态: 本文是英文页面 VMware翻译,最后翻译时间:2017-08-18,点击这里可以查看翻译后英文页面的改动。

本文是关于在 Arch 中安装 VMware,你也许想寻找的是 在 VMware 中安装 Arch Linux

注意:
  • 这篇文章适用于最新的 VMware 正式版,即 VMware Workstation Pro / Player 12.5.
  • 对于旧版本的 VMware,建议安装本体后追加安装 vmware-patchAUR

安装

安装 依赖项:

下载最新的 VMware Workstation ProPlayer (或者beta版,如果有的话)。

开始安装:

# sh VMware-edition-version.release.architecture.bundle
提示: 一些常用的选项:
  • --eulas-agreed - 跳过各种许可协议
  • --console - 使用命令行界面,而非 GUI
  • --custom - 允许自定义安装目录,比如/usr/local(记得修改#Systemd 服务一节下,vmware-usbarbitrator.service中的路径)
  • -I, --ignore-errors - 忽略致命错误
  • --set-setting=vmware-workstation serialNumber XXXXX-XXXXX-XXXXX-XXXXX-XXXXX - 设置安装时使用的序列号(有利于脚本化安装)
  • --required - 只询问必要的问题(当结合--eulas-agreed--console时可以实现静默安装)

当安装程序询问 System service scripts directory 的设置时,输入 /etc/init.d 即可。

注意: 安装过程中会收到"No rc*.d style init script directories"错误。这可以安全忽略,因为Arch使用的是systemd.
提示: 如需重新编译模块,用这条命令:
# vmware-modconfig --console --install-all

配置

内核模块

VMware Workstation 12.5 最高支持内核 4.8.

Systemd 服务

(可选) 你也可以创建一个 .service 文件 (也可以用AUR中的vmware-systemd-servicesAUR包),而不是直接使用 /etc/init.d/vmware (start|stop|status|restart) 和 /usr/bin/vmware-usbarbitrator 来管理服务:

/etc/systemd/system/vmware.service
[Unit]
Description=VMware daemon
Requires=vmware-usbarbitrator.service
Before=vmware-usbarbitrator.service
After=network.target

[Service]
ExecStart=/etc/init.d/vmware start
ExecStop=/etc/init.d/vmware stop
PIDFile=/var/lock/subsys/vmware
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
/etc/systemd/system/vmware-usbarbitrator.service
[Unit]
Description=VMware USB Arbitrator
Requires=vmware.service
After=vmware.service

[Service]
ExecStart=/usr/bin/vmware-usbarbitrator
ExecStop=/usr/bin/vmware-usbarbitrator --kill
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

如果你想在另一个Workstation服务器控制台上连接此次安装的VMware Workstation,请添加下面的服务

/etc/systemd/system/vmware-workstation-server.service
[Unit]
Description=VMware Workstation Server
Requires=vmware.service
After=vmware.service

[Service]
ExecStart=/etc/init.d/vmware-workstation-server start
ExecStop=/etc/init.d/vmware-workstation-server stop
PIDFile=/var/lock/subsys/vmware-workstation-server
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

之后您就可以在启动时enable它们.

Workstation Server服务

服务vmware-workstation-server.service将调用wssc-adminTool,即使后者已经被重命名作vmware-wssc-adminTool.

这将阻止该服务启动。创建一个文件链接可以修复这个问题:

# ln -s wssc-adminTool /usr/lib/vmware/bin/vmware-wssc-adminTool

启动程序

启动VMware Workstation Pro:

$ vmware

或Player:

$ vmplayer

提示和技巧

输入Workstation Pro许可密钥

从终端

# /usr/lib/vmware/bin/vmware-vmx-debug --new-sn XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

XXXXX-XXXXX-XXXXX-XXXXX-XXXXX 处是你的许可密钥。

Note: The -debug binary informs the user of an incorrect license.

从 GUI

如果以上方法无效,你可以试试:

# /usr/lib/vmware/bin/vmware-enter-serial

解压缩 VMware BIOS

$ objcopy /usr/lib/vmware/bin/vmware-vmx -O binary -j bios440 --set-section-flags bios440=a bios440.rom.Z
$ perl -e 'use Compress::Zlib; my $v; read STDIN, $v, '$(stat -c%s "./bios440.rom.Z")'; $v = uncompress($v); print $v;' < bios440.rom.Z > bios440.rom

解压缩安装程序

查看安装程序.bundle的内容:

$ sh VMware-edition-version.release.architecture.bundle --extract /tmp/vmware-bundle/

使用修改过的 BIOS

如果你决定修改解压出的BIOS,你可以通过将其移动至~/vmware/<Virtual machine name>来让虚拟机使用它:

$ mv bios440.rom ~/vmware/Virtual_machine_name/

然后在 <Virtual machine name>.vmx 文件中加入它的名称:

~/vmware/Virtual_machine_name/Virtual_machine_name.vmx
bios440.filename = "bios440.rom"

在Intel和Optimus上启用3D图形

由于不理想和(或)不稳定的3D加速,某些图形驱动是默认被阻止的。当启用Accelerate 3D graphics后,log中应该会出现:

Disabling 3D on this host due to presence of Mesa DRI driver.  Set mks.gl.allowBlacklistedDrivers = TRUE to override.

这表示:

~/.vmware/preferences
mks.gl.allowBlacklistedDrivers = TRUE

疑难解答

错误:Kernel headers for version 4.x-xxxx were not found. If you installed them[...]

安装 linux-headers

Note: 更新内核和头文件会需要你启动新的内核以匹配头文件的版本。这是一个相对常见的错误。

无法识别 USB 设备

提示: 可以通过 vmware-patchAUR 解决。

如果不使用#Systemd 服务来处理服务,你每次都需要以root身份手动启动vmware-usbarbitrator.

启动:

# vmware-usbarbitrator

停止:

# vmware-usbarbitrator --kill

当远程访问VMware时,遇到不正确的用户名/密码错误

VMware Workstation通过vmware-workstation-server服务来提供远程管理共享的虚拟机的功能。然而,这将以错误"incorrect username/password"而告终,因为vmware-authd服务中,PAM的相关配置出错了。通过编辑/etc/pam.d/vmware-authd来解决问题:

/etc/pam.d/vmware-authd
#%PAM-1.0
auth     required       pam_unix.so
account  required       pam_unix.so
password required       pam_permit.so
session  required       pam_unix.so

然后重新启动vmwaresystemd服务。

现在你能通过安装时提供的身份信息来登录这个服务器了。

Note: 也许会需要libxslt来启动虚拟机

ALSA输出的问题

修复音质问题或正确启用高清音频输出。首先执行:

$ aplay -L

如果希望在客户机中播放5.1 立体声,寻找surround51:CARD=vendor_name,DEV=num;如果存在音质问题,寻找front:CARD=vendor_name,DEV=num。最后将名称加入到.vmx文件中:

~/vmware/Virtual_machine_name/Virtual_machine_name.vmx
sound.fileName="surround51:CARD=Live,DEV=0"
sound.autodetect="FALSE"

OSS模拟也应该被禁用.

错误:Kernel-based Virtual Machine (KVM) is running

禁止KVM自动启动,你可以:

/etc/modprobe.d/vmware.conf
blacklist kvm
blacklist kvm-amd   # For AMD CPUs
blacklist kvm-intel # For Intel CPUs

组件问题

错误:/dev/vmmon not found

完整的错误是:

Could not open /dev/vmmon: No such file or directory.
Please make sure that the kernel module `vmmon' is loaded.

这意味着未加载vmmon模块.参见#Systemd 服务章节

错误:/dev/vmci not found

完整的错误是:

Failed to open device "/dev/vmci": No such file or directory
Please make sure that the kernel module 'vmci' is loaded.

尝试重新编译VMware内核模块:

# vmware-modconfig --console --install-all

在Linux 4.9后内核模块无法编译

对于VMware Workstation Pro 12.5.2,模块的源码必须作出修改,以便于在Linux 4.9上编译 [1]

# cd /usr/lib/vmware/modules/source
# tar xf vmmon.tar
# mv vmmon.tar vmmon.old.tar
# sed -i 's/uvAddr, numPages, 0, 0/uvAddr, numPages, 0/g' vmmon-only/linux/hostif.c
# tar cf vmmon.tar vmmon-only
# rm -r vmmon-only
# tar xf vmnet.tar
# mv vmnet.tar vmnet.old.tar
# sed -i 's/addr, 1, 1, 0/addr, 1, 0/g' vmnet-only/userif.c
# tar cf vmnet.tar vmnet-only
# rm -r vmnet-only

VMware模块在Linux内核4.11+上(在GCC7下)编译失败

运行vmware-modconfig时返回:

Failed to get gcc information.

详细的错误信息能在日志中被找到:

modconfig| I125: Got gcc version "6.3.1".
modconfig| I125: GCC major version 6 does not match Kernel GCC major version 7.
modconfig| I125: The GCC compiler "/sbin/gcc" cannot be used for the target kernel.

为跳过检查,使用下面的解决方案:

# sed 's/gcc version 7/gcc version 6/' /proc/version > /tmp/version
# mount --bind /tmp/version /proc/version
# vmware-modconfig --console --install-all
# umount /proc/version && rm /tmp/version

VMware 模块在 Linux 4.13 版内核上编译失败

VMware Workstation Pro 12.5.7 版本的内核模块代码需要做出一定修改,才能够成功地为 4.13 版 Linux 内核编译。出处:[2]

# cd /usr/lib/vmware/modules/source
# tar xf vmnet.tar
# mv vmnet.tar vmnet.old.tar
# sed -i 's/atomic_inc(&clone->users);/clone = skb_get(clone);/g' vmnet-only/bridge.c
# tar cf vmnet.tar vmnet-only
# rm -r vmnet-only

安装程序启动失败

如果你回到了执行.bundle时的终端提示,则这个版本的VMware Installer也许坏掉了或者不完整,你应该删掉它(你也许也应该参照#卸载一节中的内容):

# rm -r /etc/vmware-installer

用户界面初始化失败

你也许会看到这样的错误:

Extracting VMware Installer...done.
No protocol specified
No protocol specified
User interface initialization failed.  Exiting.  Check the log for details.

这可以通过安装ncurses5-compat-libsAUR或者临时允许X拥有root权限来解决:

$ xhost +
$ sudo ./<vmware filename>.bundle
$ xhost -

VMware启动失败

旧的Intel微指令在启动时产生段错误

旧的Intel微指令可能会在启动时产生这样的段错误:

/usr/bin/vmware: line 31: 4941 Segmentation fault "$BINDIR"/vmware-modconfig --appname="VMware Workstation" --icon="vmware-workstation"

参阅Microcode了解如何更新微指令

版本号为12.5.4的vmplayer/vmware无法启动

[3]中所述,临时的解决方案是将包libpng降级至1.6.28-1版本,并将其加入IgnorePkg参数以忽略升级(参见/etc/pacman.conf)。

更方便的解决方案是令VMware使用系统的zlib而不是它自己的:

# cd /usr/lib/vmware/lib/libz.so.1
# mv libz.so.1 libz.so.1.old
# ln -s /usr/lib/libz.so.1 .

版本号为12.5.3-12.5.5的vmplayer/vmware无法启动

这貌似是文件/usr/lib/vmware/lib/libstdc++.so.6/libstdc++.so.6中的问题,CXXABI_1.3.8缺失。

如果系统安装了gcc-libs或者gcc-libs-multilib[broken link: replaced by gcc-libs],那个库就已经被安装了。因此,直接移除那个出错的文件将使vmplayer使用gcc-libs提供的版本。使用root执行:

# mv /usr/lib/vmware/lib/libstdc++.so.6/libstdc++.so.6 /usr/lib/vmware/lib/libstdc++.so.6/libstdc++.so.6.bak

同时有另一个解决方案:

# export VMWARE_USE_SHIPPED_LIBS='yes'

vmware 12的进程在启动之后立即终止,没有显示GUI

这是Mageia中已知的Bug,但是对于Arch,终端里似乎并没有任何错误信息输出。检阅位于/tmp/vmware-<id>里的日志文件,会发现启动vmware或vmplaer后,产生了VMWARE_SHIPPED_LIBS_LIST is not set, VMWARE_SYSTEM_LIBS_LIST is not set, VMWARE_USE_SHIPPED_LIBS is not set, VMWARE_USE_SYSTEM_LIBS is not set问题。进程在Unable to execute /usr/lib/vmware/bin/vmware-modconfig.后结束。解决方案是,以root身份执行:

# mv /etc/vmware/icu/icudt44l.dat /etc/vmware/icu/icudt44l.dat.bak

同时有另一个解决方案:

# export VMWARE_USE_SHIPPED_LIBS='yes'

如果在版本12.5.7上出现问题,并且移动icudt44l.dat或者设置VMWARE_USE_SHIPPED_LIBSyes不起作用,或者在终端内执行vmplayer无输出,尝试以root权限执行:

# cd /usr/lib/vmware/lib/libz.so.1
# mv libz.so.1 libz.so.1.old
# ln -s /usr/lib/libz.so.1 .

尽管设置了VMWARE_USE_SHIPPED_LIBS变量,VMware仍有可能找不到某些库文件,比如libfontconfig.so.1。查看VMware位于tmp目录中的日志来检查哪些库文件未被找到,并将对应的系统库文件拷贝至合适的路径:

# cp /usr/lib/libfontconfig.so.1 /usr/lib/vmware/lib/libfontconfig.so.1/

客户机问题

无法为客户机下载VMware Tools

访问VMware repository来手动下载这些工具。

导航至:"application name / version / build ID / linux / packages/"来下载合适的工具。

解压:

$ tar -xvf vmware-tools-name-version-buildID.x86_64.component.tar

并通过VMware安装程序安装:

# vmware-installer --install-component=/path/vmware-tools-name-version-buildID.x86_64.component

如果上述步骤不管用,尝试安装ncurses5-compat-libsAUR

错误:Guests have incorrect system clocks or are unable to boot: "[...]timeTracker_user.c:234 bugNr=148722"

这是由于在VMware Linux中不完整的对电源管理功能的支持导致的CPU频率的变化(Intel SpeedStepAMD PowerNow!/Cool'n'Quiet)。2012年,随着linux 3.3-1的发布,最大CPU频率Performance的管理者被动态的Ondemand替代。当宿主的CPU频率变化时,客户机的时钟会运行过快或过慢,同时也可能会导致客户机无法启动。

为规避该问题,宿主CPU的最高频率可以被指定,并禁用时间戳计数器(TSC)。在整体设置中:

/etc/vmware/config
host.cpukHz = "X"  # The maximum speed in KHz, e.g. 3GHz is "3000000".
host.noTSC = "TRUE" # Keep the Guest system clock accurate even when
ptsc.noTSC = "TRUE" # the time stamp counter (TSC) is slow.
提示: 若要每隔一分钟修正一次时钟,在VMware Tools下的Options选项卡中,启用: "Time synchronization between the virtual machine and the host operating system".

Guests系统启动后网络不可用

这可能是 vmnet 模块没有加载 [4]。又见#Systemd 服务自动加载。

卸载

为卸载VMware你首先需要知道产品名称(vmware-workstation 或是 vmware-player)。列出所有的产品:

# vmware-installer -l

然后通过下面的指令卸载(使用--required跳过所有的确认):

# vmware-installer -u product --required
提示: 加上--console来使用终端UI

记得要disable和删除.service文件:

# rm /etc/systemd/system/vmware.service
# rm /etc/systemd/system/vmware-usbarbitrator.service

你可能还需要清理在/usr/lib/modules/kernel_name/misc/下的冗余文件,并且如果目录/etc/init.d/是空的话,删除它。