Difference between revisions of "VMware"
(→Tips and tricks) |
m (→Launching the application) |
||
(23 intermediate revisions by 6 users not shown) | |||
Line 4: | Line 4: | ||
[[uk:VMware]] | [[uk:VMware]] | ||
[[zh-CN:VMware]] | [[zh-CN:VMware]] | ||
− | {{ | + | {{Related articles start}} |
− | {{ | + | {{Related|Installing Arch Linux in VMware}} |
− | + | {{Related|VirtualBox}} | |
− | + | {{Related|KVM}} | |
− | {{ | + | {{Related|QEMU}} |
− | {{ | + | {{Related|Xen}} |
− | {{ | + | {{Related|Moving an existing install into (or out of) a virtual machine}} |
− | {{ | + | {{Related articles end}} |
− | {{ | ||
− | {{ | ||
This article is about installing VMware in Arch Linux; you may also be interested in [[Installing Arch Linux in VMware]]. | 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 | + | {{Note|This article supports '''only''' the latest major VMware versions, meaning VMware Workstation 10 and VMware Player (Plus) 6.}} |
== Installation == | == Installation == | ||
− | {{Note| VMware Workstation/Player will '''not''' be manageable with pacman as the files are not installed with it.}} | + | {{Note|VMware Workstation/Player (Plus) will '''not''' be manageable with pacman as the files are not installed with it.}} |
− | '''1.''' Download the latest [http://www.vmware.com/products/workstation | + | '''1.''' Download the latest [http://www.vmware.com/products/workstation VMware Workstation] or [https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0 VMware Player (Plus)] (you may also try the [https://communities.vmware.com/community/vmtn/beta testing (Beta/RC) versions]). |
'''2.''' Start the installation ({{Ic|--console}} uses terminal instead of the GUI): | '''2.''' Start the installation ({{Ic|--console}} uses terminal instead of the GUI): | ||
Line 28: | Line 26: | ||
# ./VMware-''edition''-''version''.''release''.''architecture''.bundle --console | # ./VMware-''edition''-''version''.''release''.''architecture''.bundle --console | ||
− | {{Note|To ignore errors | + | {{Note|To ignore fatal errors use {{ic|-I}} or {{ic|--ignore-errors}}.}} |
− | '''3.''' Read and accept the | + | '''3.''' Read and accept the main application and the [https://www.vmware.com/support/developer/ovf/ OVF Tool component] EULAs to continue. |
− | '''4.''' | + | '''4.''' (optional) Enter license key. |
− | '''5.''' | + | '''5.''' During the install you will get an error about {{ic|"No rc*.d style init script directories"}} being given to the installer. This can, however, be safely ignored since Arch now uses [[systemd]]. |
− | |||
− | |||
== Configuration == | == Configuration == | ||
Line 42: | Line 38: | ||
{{Tip|There is also a package called {{AUR|vmware-patch}} in the [[Arch User Repository|AUR]] with the intention of trying to automate this section (it also supports older VMware versions).}} | {{Tip|There is also a package called {{AUR|vmware-patch}} in the [[Arch User Repository|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 ({{Pkg|linux}} from | + | {{Note|Ensure you have installed the correct headers required for building the modules ({{Pkg|linux}} from the [[official repositories]] uses {{Pkg|linux-headers}}).}} |
=== VMware module patches and installation === | === VMware module patches and installation === | ||
− | VMware Workstation | + | VMware Workstation 10.0.1 and Player (Plus) 6.0.1 support kernels up to 3.13. |
− | ==== 3. | + | ==== 3.13 kernels - patch for Netfilter-enabled systems (optional) ==== |
− | + | Systems that have enabled the network packet filtering framework [http://cateee.net/lkddb/web-lkddb/NETFILTER.html (Netfilter] or {{ic|CONFIG_NETFILTER}}) on 3.13 kernels (found in: {{ic|Networking Support}} → {{ic|Networking Options}}) will [http://rglinuxtech.com/?p=1008 fail] to build the {{ic|vmnet}} module. | |
− | + | This isn't included in the Arch [https://projects.archlinux.org/svntogit/packages.git/tree/trunk/config.x86_64?h=packages/linux stock kernel], but for custom kernels a patch can be found [http://pastie.org/8672356 here]: | |
− | + | $ curl http://pastie.org/pastes/8672356/download -o /tmp/vmware-netfilter.patch | |
− | $ curl | ||
− | |||
$ cd /usr/lib/vmware/modules/source | $ cd /usr/lib/vmware/modules/source | ||
− | |||
# tar -xvf vmnet.tar | # tar -xvf vmnet.tar | ||
− | # patch -p0 -i /tmp/ | + | # patch -p0 -i /tmp/vmware-netfilter.patch |
− | |||
− | |||
# tar -cf vmnet.tar vmnet-only | # tar -cf vmnet.tar vmnet-only | ||
− | |||
# rm -r vmnet-only | # rm -r vmnet-only | ||
# vmware-modconfig --console --install-all | # vmware-modconfig --console --install-all | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
=== Systemd service === | === Systemd service === | ||
− | ''' | + | '''6.''' (Optional) 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| | {{hc|/etc/systemd/system/vmware.service| | ||
Line 134: | Line 81: | ||
== Launching the application == | == Launching the application == | ||
− | ''' | + | '''7.''' Now, open your VMware Workstation ({{Ic|vmware}} in the console) or VMware Player (Plus) ({{Ic|vmplayer}} in the console) to configure & use! |
− | {{Tip|To (re)build the modules, use: | + | {{Tip|To (re)build the modules from terminal, use: |
# vmware-modconfig --console --install-all | # vmware-modconfig --console --install-all | ||
+ | }} | ||
+ | |||
+ | {{Tip|As VMware Player 6.x does insist for any directory to put his rc-scripts, it will fail installing his rc-scripts at all and you end up with no rc-scripts. This will cause module compilation to fail because he can not stop his services. Just create a dummy file called "vmware" in whatevery directory you gave vmware while installation and make it executable, for example: | ||
+ | # touch /root/vmware | ||
+ | # chmod a+x /root/vmware | ||
}} | }} | ||
Line 149: | Line 101: | ||
Where {{ic|XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}} is your license key. | Where {{ic|XXXXX-XXXXX-XXXXX-XXXXX-XXXXX}} is your license key. | ||
+ | |||
+ | {{Note|The {{ic|-debug}} binary informs the user of an incorrect license.}} | ||
==== From GUI ==== | ==== From GUI ==== | ||
Line 196: | Line 150: | ||
$ cd /tmp | $ cd /tmp | ||
$ git clone git://github.com/djod4556/dkms-workstation.git | $ git clone git://github.com/djod4556/dkms-workstation.git | ||
− | # cp /tmp/dkms-workstation | + | # cp /tmp/dkms-workstation/Makefile /tmp/dkms-workstation/dkms.conf /usr/src/vmware-modules-9/ |
===== 2) Manual setup ===== | ===== 2) Manual setup ===== | ||
Line 246: | Line 200: | ||
all: $(LOCAL_MODULES) | all: $(LOCAL_MODULES) | ||
− | + | mkdir -p modules/ | |
− | + | mv *.ko modules/ | |
− | + | rm -rf $(DEST) | |
− | + | depmod | |
− | /usr/src/linux-$(KERNEL)/include/linux/version.h: | + | /usr/src/linux-$(KERNEL)/include/linux/version.h: |
− | + | 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 | %.ko: /usr/src/linux-$(KERNEL)/include/linux/version.h | ||
− | + | vmware-modconfig --console --build-mod -k $(KERNEL) $* $(GCC) $(HEADERS) vmware/ | |
− | + | cp -f $(DEST)/$*.ko . | |
clean: | clean: | ||
− | + | rm -rf modules/ | |
+ | |||
+ | |||
}} | }} | ||
Line 297: | Line 253: | ||
{{Tip|Also handled by {{AUR|vmware-patch}}.}} | {{Tip|Also handled by {{AUR|vmware-patch}}.}} | ||
− | |||
− | |||
For some reason, some installations are missing the {{ic|vmware-USBArbitrator}} script. To readd it manually see [https://bbs.archlinux.org/viewtopic.php?pid=1003117#p1003117 this forum post]. | For some reason, some installations are missing the {{ic|vmware-USBArbitrator}} script. To readd it manually see [https://bbs.archlinux.org/viewtopic.php?pid=1003117#p1003117 this forum post]. | ||
Line 306: | Line 260: | ||
# cp /tmp/vmware-bundle/vmware-usbarbitrator/etc/init.d/vmware-USBArbitrator /etc/init.d/ | # cp /tmp/vmware-bundle/vmware-usbarbitrator/etc/init.d/vmware-USBArbitrator /etc/init.d/ | ||
− | === | + | === vmci/vsock modules not loading automatically === |
− | This | + | This problem is caused by an issue in the {{ic|/etc/init.d/vmware}} script: |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | }} | ||
− | + | Starting VMware services: | |
+ | Virtual machine monitor done | ||
+ | Virtual machine communication interface failed | ||
+ | VM communication interface socket family failed | ||
+ | Blocking file system done | ||
+ | Virtual ethernet done | ||
+ | VMware Authentication Daemon done | ||
− | + | A workaround that was posted by "haagch" is that in vmwareStartVmci() you change vmwareLoadModule "$mod" to vmwareLoadModule "$vmci" and in vmwareStartVsock() vmwareLoadModule "$mod" to vmwareLoadModule "$vsock" and the same for vmwareStopVsock() and vmwareStopVmci(). | |
+ | See also [https://bbs.archlinux.org/viewtopic.php?id=169472 this]. | ||
=== The installer fails to start === | === The installer fails to start === | ||
Line 328: | Line 282: | ||
=== Incorrect login/password when trying to access VMware remotely === | === Incorrect login/password when trying to access VMware remotely === | ||
− | VMware Workstation | + | VMware Workstation 10 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| | {{hc|/etc/pam.d/vmware-authd| | ||
Line 356: | Line 310: | ||
=== Kernel-based Virtual Machine (KVM) is running === | === Kernel-based Virtual Machine (KVM) is running === | ||
To disable {{ic|KVM}} on boot, you can use something like: | To disable {{ic|KVM}} on boot, you can use something like: | ||
− | + | ||
{{hc|/etc/modprobe.d/vmware.conf| | {{hc|/etc/modprobe.d/vmware.conf| | ||
blacklist kvm | blacklist kvm | ||
Line 375: | Line 329: | ||
# rm /etc/systemd/system/vmware.service | # rm /etc/systemd/system/vmware.service | ||
− | You may also want to have a look at the | + | You may also want to have a look at the module directories in {{ic|/usr/lib/modules/''[kernel name]''/misc/}} for any leftovers. |
− | |||
− |
Revision as of 17:56, 30 January 2014
This article is about installing VMware in Arch Linux; you may also be interested in Installing Arch Linux in VMware.
Contents
- 1 Installation
- 2 Configuration
- 3 Launching the application
- 4 Tips and tricks
- 5 Troubleshooting
- 5.1 Could not open /dev/vmmon: No such file or directory.
- 5.2 Kernel headers for version 3.x-xxxx were not found. If you installed them[...]
- 5.3 USB devices not recognized
- 5.4 vmci/vsock modules not loading automatically
- 5.5 The installer fails to start
- 5.6 Incorrect login/password when trying to access VMware remotely
- 5.7 Issues with ALSA output
- 5.8 Kernel-based Virtual Machine (KVM) is running
- 6 Uninstallation
Installation
1. Download the latest VMware Workstation or VMware Player (Plus) (you may also try the testing (Beta/RC) versions).
2. 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
-I
or --ignore-errors
.3. Read and accept the main application and the OVF Tool component EULAs to continue.
4. (optional) Enter license key.
5. During the install you will get an error about "No rc*.d style init script directories"
being given to the installer. This can, however, be safely ignored since Arch now uses systemd.
Configuration
VMware module patches and installation
VMware Workstation 10.0.1 and Player (Plus) 6.0.1 support kernels up to 3.13.
3.13 kernels - patch for Netfilter-enabled systems (optional)
Systems that have enabled the network packet filtering framework (Netfilter or CONFIG_NETFILTER
) on 3.13 kernels (found in: Networking Support
→ Networking Options
) will fail to build the vmnet
module.
This isn't included in the Arch stock kernel, but for custom kernels a patch can be found here:
$ curl http://pastie.org/pastes/8672356/download -o /tmp/vmware-netfilter.patch $ cd /usr/lib/vmware/modules/source # tar -xvf vmnet.tar # patch -p0 -i /tmp/vmware-netfilter.patch # tar -cf vmnet.tar vmnet-only # rm -r vmnet-only # vmware-modconfig --console --install-all
Systemd service
6. (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):
/etc/systemd/system/vmware.service
[Unit] Description=VMware daemon [Service] ExecStart=/etc/init.d/vmware start ExecStop=/etc/init.d/vmware stop PIDFile=/var/lock/subsys/vmware TimeoutSec=0 RemainAfterExit=yes [Install] WantedBy=multi-user.target
To start the daemon on boot, enable the systemd service vmware
.
Launching the application
7. Now, open your VMware Workstation (vmware
in the console) or VMware Player (Plus) (vmplayer
in the console) to configure & use!
# vmware-modconfig --console --install-all
# touch /root/vmware # chmod a+x /root/vmware
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.
-debug
binary informs the user of an incorrect license.From GUI
If the above doesn't work, you can try:
# /usr/lib/vmware/bin/vmware-enter-serial
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
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.
Preparation
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/Makefile /tmp/dkms-workstation/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:
/usr/src/vmware-modules-9/dkms.conf
PACKAGE_NAME="vmware-modules" PACKAGE_VERSION="9" MAKE[0]="make all" CLEAN="make clean" BUILT_MODULE_NAME[0]="vmmon" BUILT_MODULE_LOCATION[0]="modules" BUILT_MODULE_NAME[1]="vmnet" BUILT_MODULE_LOCATION[1]="modules" BUILT_MODULE_NAME[2]="vmblock" BUILT_MODULE_LOCATION[2]="modules" BUILT_MODULE_NAME[3]="vmci" BUILT_MODULE_LOCATION[3]="modules" BUILT_MODULE_NAME[4]="vsock" BUILT_MODULE_LOCATION[4]="modules" DEST_MODULE_LOCATION[0]="/extra/vmware" 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"
and now the Makefile
:
/usr/src/vmware-modules-9/Makefile
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 LOCAL_MODULES := $(addsuffix .ko, $(TARGETS)) all: $(LOCAL_MODULES) mkdir -p modules/ mv *.ko modules/ rm -rf $(DEST) depmod /usr/src/linux-$(KERNEL)/include/linux/version.h: 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 . clean: rm -rf modules/
Installation
The modules can then be registered:
# dkms -m vmware-modules -v 9 -k $(uname -r) add
built:
# 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.
Troubleshooting
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).
USB devices not recognized
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/
vmci/vsock modules not loading automatically
This problem is caused by an issue in the /etc/init.d/vmware
script:
Starting VMware services: Virtual machine monitor done Virtual machine communication interface failed VM communication interface socket family failed Blocking file system done Virtual ethernet done VMware Authentication Daemon done
A workaround that was posted by "haagch" is that in vmwareStartVmci() you change vmwareLoadModule "$mod" to vmwareLoadModule "$vmci" and in vmwareStartVsock() vmwareLoadModule "$mod" to vmwareLoadModule "$vsock" and the same for vmwareStopVsock() and vmwareStopVmci().
See also this.
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 10 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:
/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 restart the vmware
systemd service.
Now you can connect to the server with the credentials provided during the installation.
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:
- Suspend/Power off the VM.
- Run
aplay -L
- 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. - Open the
Virtual machine name.vmx
config file of the VM in a text editor, located under~/vmware/Virtual machine name/
, and edit thesound.fileName
field, e.g.:sound.fileName="surround51:CARD=Live,DEV=0"
. Ensure that it also readssound.autodetect="FALSE"
. - Resume/Power on the VM.
Kernel-based Virtual Machine (KVM) is running
To disable KVM
on boot, you can use something like:
/etc/modprobe.d/vmware.conf
blacklist kvm blacklist kvm-amd # For AMD CPUs blacklist kvm-intel # For Intel CPUs
Uninstallation
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 module directories in /usr/lib/modules/[kernel name]/misc/
for any leftovers.