VMware
This article is about installing VMware in Arch, you may also be interested in Installing Arch Linux in VMware.
VMware Server Installation
Install vmware-server from the AUR.
VMware Server Console
Install vmware-server-console from the AUR. Alternatively, on Arch64, the bin32 version can also be installed.
Note
On both cases, the vmware image is not included in the AUR anymore. So you should :
- download it from VMWare website.
- Launch yaourt for installing vmware-server
- copy VMware-server-2.0.2-203138.i386.tar.gz to /tmp/yaourt-tmp-{USERNAME}/aur-vmware-server-modules/ and /tmp/yaourt-tmp-{USERNAME}/aur-vmware-server/
- Finish the installation within yaourt
VMware Workstation or VMware Player
Installation
To install Workstation or Player on a Linux host using a bundle:
1. Download Template:Filename or Template:Filename from the VMware site. (Template:Codeline you can also try the testing (Beta/RC) versions found in here: http://communities.vmware.com/community/beta/ws but please note that they indeed are beta and so there's no guarantee you will not run into issues).
2. In a terminal cd to the directory where you downloaded the file.
3. Become root and create a fake System V init style directory for VMware and start the installation (the --console
flag uses terminal instead of the GUI and the --custom
asks all the unnecessary questions that nobody cares about - but we need it to select the Template:Codeline runlevels directory):
# mkdir -p /etc/rc.d/vmware.d/{rc{0..6},init}.d # chmod +x VMware-<edition>-<version>.<release>.<architecture>.bundle # ./VMware-<edition>-<version>.<release>.<architecture>.bundle --console --custom
4. (Read &) accept the EULA to continue.
5. Accept the default settings until it prompts for Template:Codeline runlevels then set to:
/etc/rc.d/vmware.d/
6. For Template:Codeline set to:
/etc/rc.d
It might happen that you need to set the directory for Template:Codeline as Template:Codeline (the default) or else the installation would fail. If you do, you can create a symlink from Template:Codeline to Template:Codeline afterwards or the other way around (note that you can't remove the Template:Codeline after you've placed it somewhere because that's where VMware will be looking for it).
7. (Optional) Enter the directory path to the Integrated Virtual Debugger for Eclipse if Eclipse is installed.
8. Mash enter to install. Note that if nothing happens at this point and you are returned to the prompt, try re-running the installation without the --console
option.
9. At this point you would want to install the modules. First you need to either change the Template:Codeline in Template:Codeline at the lines 88 and 108 from:
/sbin/lsmod
to:
/bin/lsmod
or create a symlink from Template:Codeline to Template:Codeline with:
# ln -s /bin/lsmod /sbin/lsmod
VMware modules and patches
- For 2.6.38 kernel and VMware 7.x.x ?
- For 2.6.38 kernel and VMware player 3.1.4, there is no patch required
- For 2.6.37 kernel and VMware 7.x.x (tested with 7.1.3), there's a script to patch the VMware sources (run as root):
$ cd /tmp $ wget http://www.russo79.com/vmware7.1.3-patch-kernel-2.6.37.sh # chmod +x vmware7.1.3-patch-kernel-2.6.37.sh # ./vmware7.1.3-patch-kernel-2.6.37.sh
This script was based on the patch taken from http://communities.vmware.com/thread/293321
- For 2.6.37 kernel and VMware player 3.1.4, there is no patch required
- For 2.6.36 kernel and VMware 7.x.x, there's a script to patch the vmmon (run as root):
$ cd /tmp $ wget http://files.archlinux.org.il/vmmon_fix_2.6.36.sh # chmod +x vmmon_fix_2.6.36.sh # ./vmmon_fix_2.6.36.sh
- For 2.6.35 kernel and VMware 7.x.x, there's a script to patch the VMware sources :
$ cd /tmp $ wget http://www.sputnick-area.net/scripts/vmware7.1.1-patch-kernel-2.6.35.bash # chmod +x vmware7.1.1-patch-kernel-2.6.35.bash # ./vmware7.1.1-patch-kernel-2.6.35.bash
Installation (concluded)
Now you can install the modules. You can do this with either by launching VMware and letting it install the modules from there with the GUI or alternatively you can execute the command:
# vmware-modconfig --console --install-all
10. (Optional) Add vmware to the DAEMONS array in /etc/rc.conf so that the service is started automatically on boot.
11. Install and run HAL
#/etc/rc.d/hal start
12. Now, open your VMware Workstation (Template:Codeline in the console) to configure & use!
Uninstallation
Check the product name
# vmware-installer -l
uninstall product
# vmware-installer -u <vmware-product>
Manually included parts in /etc/rc.d have to be deleted manually. Don't forget to remove vmware from the /etc/rc.conf DAEMONS array.
Extracting the VMware BIOS
To extract the VMware BIOS, which can be manipulated and later used with your virtual machines:
$ 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
Once you've modified the BIOS in whatever way required, move it to the directory where your VM is stored, and add it to the Template:Codeline file:
bios440.filename = "bios440.rom"
Troubleshooting
Kernel upgrades and VMware modules
If when you ran
./VMware-<edition>-<version>.<release>.<architecture>.bundle
you get back to the prompt and VMware don't ask you to makes choices, then you probably have an old install, so you should rename /etc/vmware-installer/ :
# mv /etc/vmware-installer /etc/vmware-installer.old
If you get an error like this when launching up a Virtual Machine:
Could not open /dev/vmmon: No such file or directory. Please make sure that the kernel module `vmmon' is loaded.
It means that at least the one VMware service isn't started up. You can start them all up by running (as root):
# /etc/rc.d/vmware start
If, on the other hand VMware complains about kernel headers like this:
Kernel headers for version 2.6.xx-xxxx were not found. If you installed them.......
Install them with the following:
# pacman -S kernel26-headers
error: implicit declaration of function ‘iommu_unmap_range’
If the following error happens while compiling modules
... /tmp/vmware-root/modules/vmmon-only/linux/iommu.c:403:7: erreur: implicit declaration of function ‘iommu_unmap_range’ make[2]: *** [/tmp/vmware-root/modules/vmmon-only/linux/iommu.o] Erreur 1 make[1]: *** [_module_/tmp/vmware-root/modules/vmmon-only] Erreur 2 make[1]: quittant le répertoire « /usr/src/linux-2.6.35-ARCH » make: *** [vmmon.ko] Erreur 2
This error is due to a change in the kernel API, the change is merely just a change of name which removes the suffixed '_range' from the iommu functions. You can manually patch the sources by removing the _range suffix with a quick sed expression:
cd /tmp tar xvf /usr/lib/vmware/modules/source/vmmon.tar sed 's/_range//' -i vmmon-only/linux/iommu.c tar cvf /usr/lib/vmware/modules/source/vmmon.tar vmmon-only
Please note that when upgrading the kernel you will have to rebuild the vmware modules with:
$ vmware-modconfig --console --install-all
Otherwise your whole system might crash when trying to power up VMs so keep that in mind.
error: implicit declaration of function ‘kernel_locked’
If you're getting this error it means you're most likely on a 2.6.36 > kernel and require some additional attention. Attention that VMware rarely pays.
There's a patch available for this and several more compile errors over at [1]
error: ‘struct sock’ has no member named ‘sk_sleep’
This error often occures when compiling the vsock module, the error looks something like:
make[1]: Entering directory `/usr/src/linux-headers-2.6.35-7-generic-pae' CC [M] /tmp/vmware-root/modules/vsock-only/linux/af_vsock.o /tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:312: warning: initialization from incompatible pointer type /tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:359: warning: initialization from incompatible pointer type /tmp/vmware-root/modules/vsock-only/linux/af_vsock.c: In function ‘VSockVmciStreamConnect’: /tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:3224: error: ‘struct sock’ has no member named ‘sk_sleep’ /tmp/vmware-root/modules/vsock-only/linux/af_vsock.c:3247: error: ‘struct sock’ has no member named ‘sk_sleep’
...
To fix this we do a similar approach as the one mentioned above:
cd /tmp tar xvf /usr/lib/vmware/modules/source/vsock.tar sed 's/\([a-z_]*\)->compat_sk_sleep/compat_sk_sleep(\1)/g' -i vsock-only/linux/af_vsock.c tar cvf /usr/lib/vmware/modules/source/vsock.tar vsock-only
Then rerun:
$ vmware-modconfig --console --install-all
And you should be fine.
Compiling modules on kernel 2.6.32
To patch VMware modules we have to add #include "compat_sched.h" to some modules's source:
cd /tmp tar xf /usr/lib/vmware/modules/source/vmnet.tar nano vmnet-only/vnetUserListener.c (near line 37 add #include "compat_sched.h") tar cf /usr/lib/vmware/modules/source/vmnet.tar vmnet-only tar xf /usr/lib/vmware/modules/source/vmci.tar nano vmci-only/linux/vmciKernelIf.c vmci-only/include/pgtbl.h (add #include "compat_sched.h" around 30 line) tar cf /usr/lib/vmware/modules/source/vmci.tar vmci-only vmware-modconfig --console --install-all
You can also use a ready script: http://communities.vmware.com/thread/239221
Printing from the guest OS
If you've configured your guest OS to use the printers on your host, and the print jobs aren't going through, there may be a permissions problem with the ThinPrint CUPS filter (thnucups), which is used by VMware.
From Template:Codeline:
E [22/Nov/2010:14:10:11 -0800] Unable to execute /usr/lib/cups/filter/thnucups: insecure file permissions (0104755)
This should fix that:
$ sudo chmod u-sw /usr/lib/cups/filter/thnucups $ sudo /etc/rc.d/cups restart