Difference between revisions of "VMware"

From ArchWiki
Jump to: navigation, search
(3.10 kernels)
Line 22: Line 22:
{{Note| VMware Workstation/Player will '''not''' be manageable with pacman as the files are not installed with it.}}
{{Note| VMware Workstation/Player will '''not''' be manageable with pacman as the files are not installed with it.}}
'''1.''' Download the latest  [http://www.vmware.com/products/workstation/overview.html VMware Workstation] or [http://www.vmware.com/products/player/overview.html VMware Player] (you may also try the [http://communities.vmware.com/community/vmtn/beta testing (Beta/RC) versions]).
# a sysv init directory is needed to install
#:<code>mkdir -p /etc/init.d/{rc0.d,rc1.d,rc2.d,rc3.d,rc4.d,rc5.d,rc6.d}</code>
'''2.''' Start the installation ({{Ic|--console}} uses terminal instead of the GUI):
# KVM cannot be active. Edit <code>/etc/modprobe.d/vmware.conf</code>
$ chmod +x VMware-''edition''-''version''.''release''.''architecture''.bundle
#:<code>blacklist kvm</code>
# ./VMware-''edition''-''version''.''release''.''architecture''.bundle --console
#: and <code>blacklist kvm-intel</code> or <code>kvm-amd</code>
# Download the latest  [http://www.vmware.com/products/workstation/overview.html VMware Workstation] or [http://www.vmware.com/products/player/overview.html VMware Player] (you may also try the [http://communities.vmware.com/community/vmtn/beta testing (Beta/RC) versions]).
'''3.''' Read and accept the EULA to continue.
# Start the installation ({{Ic|--console}} uses terminal instead of the GUI):
#:<code> $ chmod +x VMware-''edition''-''version''.''release''.''architecture''.bundle</code>
'''4.''' Set {{ic|System service scripts directory}} to {{ic|/etc/init.d}}.
#:<code># ./VMware-''edition''-''version''.''release''.''architecture''.bundle --console</code>
# Read and accept the EULA to continue.
'''5.''' (Optional) If Eclipse is installed, enter the directory path to the Integrated Virtual Debugger.
# Set {{ic|System service scripts directory}} to {{ic|/etc/init.d}}.
# (Optional) If Eclipse is installed, enter the directory path to the Integrated Virtual Debugger.
'''6.''' You will now get an error about the {{ic|"rc*.d style init script directories"}} not being set. This can, however, be safely ignored.
== Configuration ==
== Configuration ==

Revision as of 17:33, 7 July 2013

zh-CN:VMware Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

This article is about installing VMware in Arch Linux; you may also be interested in Installing Arch Linux in VMware.

Note: This article supports only the latest major VMware versions, meaning VMware Workstation 9 and VMware Player 5.


Note: VMware Workstation/Player will not be manageable with pacman as the files are not installed with it.
  1. a sysv init directory is needed to install
    mkdir -p /etc/init.d/{rc0.d,rc1.d,rc2.d,rc3.d,rc4.d,rc5.d,rc6.d}
  2. KVM cannot be active. Edit /etc/modprobe.d/vmware.conf
    blacklist kvm
    and blacklist kvm-intel or kvm-amd
  3. Download the latest VMware Workstation or VMware Player (you may also try the testing (Beta/RC) versions).
  4. Start the installation (--console uses terminal instead of the GUI):
    $ chmod +x VMware-edition-version.release.architecture.bundle
    # ./VMware-edition-version.release.architecture.bundle --console
  5. Read and accept the EULA to continue.
  6. Set System service scripts directory to /etc/init.d.
  7. (Optional) If Eclipse is installed, enter the directory path to the Integrated Virtual Debugger.


Tip: There is also a package called vmware-patchAUR in the AUR with the intention of trying to automate this section (it also supports older VMware versions).
Note: Ensure you have installed the correct headers required for building the modules (linux from [core] uses linux-headers).

VMware module patches and installation

VMware Workstation 9 and Player 5 both support kernels up to 3.9. Any later requires patching of the VMware modules.

3.10 kernels

The call create_proc_entry() has been dropped from 3.10 in favor of proc_create(). This requires patching the vmblock and vmnet modules that use them.

The patches (including the optional fuse patch) can be found here and here:

$ cd /tmp
$ curl -O http://pkgbuild.com/git/aur-mirror.git/plain/vmware-patch/vmblock-9.0.2-5.0.2-3.10.patch
$ curl -O http://pkgbuild.com/git/aur-mirror.git/plain/vmware-patch/vmnet-9.0.2-5.0.2-3.10.patch
$ cd /usr/lib/vmware/modules/source
# tar -xvf vmblock.tar
# tar -xvf vmnet.tar
# patch -p0 -i /tmp/vmblock-9.0.2-5.0.2-3.10.patch
# patch -p0 -i /tmp/vmnet-9.0.2-5.0.2-3.10.patch
# tar -cf vmblock.tar vmblock-only
# tar -cf vmnet.tar vmnet-only
# rm -r vmblock-only
# rm -r vmnet-only
# vmware-modconfig --console --install-all

3.9 kernels - patch for fuseless systems (optional)

Systems that don't have fuse will not be able to use the /usr/lib/vmware/bin/vmware-vmblock-fuse client. These systems will fall back to the original vmblock.ko module, which won't load due to the symbol putname being replaced by __putname:

# modprobe vmblock
modprobe: ERROR: could not insert 'vmblock': Unknown symbol in module, or unknown parameter (see dmesg)
$ dmesg | tail -1
[ 8896.222258] vmblock: Unknown symbol putname (err 0)

The patch can be found here:

$ cd /tmp
$ curl -O http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-emulation/vmware-modules/files/264-putname.patch
$ cd /usr/lib/vmware/modules/source
# tar -xvf vmblock.tar
# patch -p1 -i /tmp/264-putname.patch
# tar -cf vmblock.tar vmblock-only
# rm -r vmblock-only
# vmware-modconfig --console --install-all
  • The following is useful only for VMware Workstation and Player lower than 9.0.2 and 5.0.2, respectively.
  • Due to different VMware versions, you may need to set the vmreqver or plreqver variable for VMware Workstation or Player respectively in the patch-modules_3.X.0.sh script.

The following patches will also install the modules afterwards by executing # vmware-modconfig --console --install-all.

3.7 kernels and up

With the arrival of 3.7 the directory structure of the uapi sources (and thus the headers) has changed. The missing kernel header version.h can be symlinked with:

# ln -s /usr/src/linux-$(uname -r)/include/generated/uapi/linux/version.h /usr/src/linux-$(uname -r)/include/linux/

You can replace "$(uname -r)" with any kernel not currently running.

Note: You will need to redo this upon every kernel update.

3.8 / 3.9 kernels

In addition to the header symlink outlined above 3.8/3.9 kernels also need this (packaged together with the script in 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

Systemd service

8. (Optional) Instead of using # /etc/init.d/vmware {start|stop|status|restart} directly to manage the services you may also create a .service file (or files):

Description=VMware daemon

ExecStart=/etc/init.d/vmware start
ExecStop=/etc/init.d/vmware stop


To start the daemon on boot, enable the systemd service vmware.

Launching the application

9. Now, open your VMware Workstation (vmware in the console) or VMware Player (vmplayer in the console) to configure & use!

Tip: To (re)build the modules, use:
# vmware-modconfig --console --install-all

Tips and tricks

Entering the Workstation License Key from terminal

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

Where XXXXX-XXXXX-XXXXX-XXXXX-XXXXX is your license key.

Extracting the 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

Using the modified BIOS

If and when you decide to modify the extracted BIOS you can make your virtual machine use it by moving it to ~/vmware/Virtual machine name:

$ mv bios440.rom ~/vmware/Virtual machine name/

then adding the name to the Virtual machine name.vmx file:

~/vmware/Virtual machine name/Virtual machine name.vmx
bios440.filename = "bios440.rom"

Copy-On-Write (CoW)

CoW comes with some advantages, but can negatively affect performance with large files that have small random writes (e.g. database files and virtual machine images):

$ chattr +C ~/vmware/Virtual machine name/Virtual machine name.vmx
Note: From the chattr man page: "For btrfs, the 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."

Using DKMS to manage the modules

The Dynamic Kernel Module Support (DKMS) can be used to manage Workstation modules and to void from re-running vmware-modconfig each time the kernel changes. The following example uses a custom Makefile to compile and install the modules through vmware-modconfig. Afterwards they are removed from the current kernel tree.


First install dkms from the official repositories.

Then create a source directory for the Makefile and the dkms.conf:

# mkdir /usr/src/vmware-modules-9/

Build configuration

Fetch the files from Git or use the ones below.

1) Using Git
$ 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) Manual setup

The dkms.conf describes the module names and the compilation/installation procedure. AUTOINSTALL="yes" tells the modules to be recompiled/installed automatically each time:


MAKE[0]="make all"
CLEAN="make clean"








and now the Makefile:

HEADERS := /usr/src/linux-$(KERNEL)/include
GCC := $(shell vmware-modconfig --console --get-gcc)
DEST := /lib/modules/$(KERNEL)/vmware

TARGETS := vmmon vmnet vmblock vmci vsock

LOCAL_MODULES := $(addsuffix .ko, $(TARGETS))

        mkdir -p modules/
        mv *.ko modules/
        rm -rf $(DEST)

        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
        vmware-modconfig --console --build-mod -k $(KERNEL) $* $(GCC) $(HEADERS) vmware/
        cp -f $(DEST)/$*.ko .

        rm -rf modules/


The modules can then be registered:

# dkms -m vmware-modules -v 9 -k $(uname -r) add


# dkms -m vmware-modules -v 9 -k $(uname -r) build

and installed:

# dkms -m vmware-modules -v 9 -k $(uname -r) install

If everything went well, the modules will now be recompiled automatically the next time the kernel changes.


Could not open /dev/vmmon: No such file or directory.

The full error is:

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

This means that at least the vmmon VMware service is not running. If using the systemd service from step 8. it should be restarted.

Kernel headers for version 3.x-xxxx were not found. If you installed them[...]

Install the headers (linux-headers).

Note: Upgrading the kernel and the headers will require you to boot to the new kernel to match the version of the headers. This is a relatively common error.

USB devices not recognized

Tip: Also handled by vmware-patchAUR.

1) The vmware-USBArbitrator script is missing

For some reason, some installations are missing the vmware-USBArbitrator script. To readd it manually see this forum post.

You may also manually extract the VMware bundle and copy the vmware-USBArbitrator script from destination folder/vmware-usbarbitrator/etc/init.d/ to /etc/init.d/:

$ ./VMware-edition-version.release.architecture.bundle --extract /tmp/vmware-bundle
# cp /tmp/vmware-bundle/vmware-usbarbitrator/etc/init.d/vmware-USBArbitrator /etc/init.d/

2) The vmware-usbarbitrator binary is segfaulting

This could also mean that the vmware-usbarbitrator binary called in the script is segfaulting:

# vmware-usbarbitrator
Pipe unexpectedly closed.	
# vmware-usbarbitrator --info -f
VTHREAD initialize main thread 2 "usbArb" pid 6426
Segmentation fault

This is caused by an empty /etc/arch-release (owned by filesystem). It is used by the service to alter its behavior based on the distribution's release version.

To fix it, add a version string in the form of year.month(.day) (e.g. 2013.06.01).

The installer fails to start

If you just get back to the prompt when opening the .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 section of this article):

# 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 vmware-workstation-server service. However, this will fail with the error "incorrect username/password" due to incorrect PAM configuration of the vmware-authd service. To fix it, edit /etc/pam.d/vmware-authd like this:

auth     required       pam_unix.so
account  required       pam_unix.so
password required       pam_permit.so
session  required       pam_unix.so

and restart the vmware systemd service.

Now you can connect to the server with the credentials provided during the installation.

Note: libxslt may be required for starting virtual machines.

Issues with ALSA output

The following instructions from Bankim Bhavsar's wiki show how to manually adjust the ALSA output device in a VMware .vmx file. This might help with quality issues or with enabling proper HD audio output:

  1. Suspend/Power off the VM.
  2. Run aplay -L
  3. If you are interested in playing 5.1 surround sound from the guest, look for surround51:CARD=vendor-name,DEV=num. If you are experiencing quality issues, look out for a line starting with front.
  4. Open the Virtual machine name.vmx config file of the VM in a text editor, located under ~/vmware/Virtual machine name/, and edit the sound.fileName field, e.g.: sound.fileName="surround51:CARD=Live,DEV=0". Ensure that it also reads sound.autodetect="FALSE".
  5. Resume/Power on the VM.


To uninstall VMware you need the product name (either vmware-workstation or vmware-player). To list all the installed products:

$ vmware-installer -l

and uninstall with:

# vmware-installer -u vmware-product

Remember to also disable and remove the vmware service:

# systemctl disable vmware
# rm /etc/systemd/system/vmware.service

You may also want to have a look at the kernel directories in /usr for any leftovers. The now unnecessary #3.7 kernels and up step leaves header directories in /usr/src/ (full path: /usr/src/linux-[kernel name]/include/linux/version.h).

The module directories can be found in /usr/lib/modules/[kernel name]/misc/.