Installing Arch Linux in VMWare
From ArchWiki
i18n |
---|
English |
简体中文 |
Español |
Contents |
Installing Arch
Installing Arch Linux inside a VM (e.g. in VMWare running on Windows XP or using VMWare fusion on MacOS) works without trouble.
Removing the pata and sata hooks from /etc/mkinitcpio.conf does not cause problems. VMWare emulates an scsi drive (an ancestor of sata).
VM Tools
The VM Tools improve networking capability, cut and paste between the host and the guest under X, or access of the directories on host from the guest (called shared folders by vm ware)
Install the open-vm-tools package from community
pacman -Sy open-vm-tools
and start VMware tools with:
/etc/rc.d/open-vm-tools start
To start them automatically at boot, add the deamon to your /etc/rc.conf deamon array
DAEMONS=(.... ... .... open-vm-tools ...)
Installing X
For avoid problems with mouse and keyboard in X, you must install hal
# pacman -S hal
then, demonize it.
Beyond installing Xorg (see main article Xorg), the packages needed in order to be able to use X properly can be installed with
# pacman -S xf86-input-vmmouse xf86-video-vmware
and the fallback X drivers
# pacman -S xf86-input-mouse xf86-video-vesa
Modern versions of Xorg are automatically configured. If you are using a manual configuration, set the mouse driver to "vmmouse".
Start X (see main article on X).
A client software needs to run in order for cut and paste to work, start vmware-user (it should not run as root) on login by either adding the line
vmware-user&
to .xinitrc or .xsession for startx or by adding the following file $HOME/.config/autostart/vmware-user.desktop
[Desktop Entry] Type=Application Name=VMWare User Agent Exec=vmware-user Icon=system-run Comment=Enable Unity, DnD, etc.
for e.g. gdm. Note as well that you need to install gtkmm and libnotify for vmware-user to run.
Enable Unity
Unity is not install by default because the package uriparser is not maintained, although it is in aur. However, it works very well. To enable support for unity, you need to use the Arch Building System (see main article ABS).
Retrieve and compile uriparser
# abs $ mkdir -p ~/arch.abs/ $ cd ~/arch.abd $ mkdir -p aur/uriparser $ cd aur/uriparser $ wget aur.archlinux.org/packages/uriparser/uriparser/PKGBUILD $ makepkg -s $ sudo pacman -U --asdeps uriparser-*.pkg.tar.gz
Then modify the two packages modules/open-vm-tools-modules and system/open-vm-tools available from community and remove --disable-unity from the configure line. Then recompile them, starting with the modules, install with
$ makepkg -s $ sudo pacman -U --asdeps open-vm-modules-*.pkg.tar.gz
and finally the tools, install with
$ makepkg -s $ sudo pacman -U open-vm-tools-*.pkg.tar.gz
no --asdeps here.
Reboot, Unity should be enabled once vmware-user is running.
Shared Folders with the Host
Create a new Shared Folder by selecting VM -> Settings... from the VMware Workstation menu. Select the Options tab and then Shared Folder. Check the Always enabled option and create a new share. For Windows XP you can create a share with the Name C and the Host Path C:\.
Then add the following line to you /etc/fstab file (changing uid/gid as needed):
.host:/ /mnt/hgfs vmhgfs defaults,user,ttl=5,uid=root,gid=root,fmask=0133,dmask=0022 0 0
Make the mount directory and mount the Shared Folders:
mkdir /mnt/hgfs mount /mnt/hgfs
All of your shared folders will now be visible by name under /mnt/hgfs
/mnt/hgfs/<Shared Folder Name>
For the Windows XP C share example:
ls /mnt/hgfs/C ... all your Windows files under C:\ ...
Final touch
A more suitable cron
The arch guest is most likely neither running the whole time nor rebooted often. The default crond is therefore inappropriate. Change crond for fcron
# pacman -S fcron
and edit the system crontab so that it looks like
!mail(no) @ 1h /usr/sbin/run-cron /etc/cron.hourly @ 1d /usr/sbin/run-cron /etc/cron.daily @ 1w /usr/sbin/run-cron /etc/cron.weekly @ 1m /usr/sbin/run-cron /etc/cron.monthly
Prune mlocate DB
It is also useless to add the shared directories to the locate DB. Add the shared directories to PRUNEPATHS in /etc/updatedb
Paravirtualization
Paravirtualization (PV) is a modern virtualization feature\technique which is quickly (if not already) becoming an industry standard. PV works by allowing some of the processing which in an ideal virtualized environment happens inside the virtualization to be done outside of the virtualized context. This will, in most cases, greatly improve the base line performance of a virtual machine. Although in some cases, depending on many variables, it won't.
With the to-date distributions of Arch and the Open VM Tools, PV works out of the box. Mainly since Arch is natively compiled for i686 unlike other Linux distributions which are usually i386.
Installation
Note that for the initial installation of a VM, PV must be turned off, as it requires the specialized drivers found in the Open VM Tools package.
Once Arch is up and running with Open VM Tools installed, you can turn off the VM, enable PV, and then turn it back on. Everything should work smoothly.
Verifying
To verify that PV works properly on your Arch VM run the following command:
lspci | grep Mem
If PV is working you should see a line similar to this:
02:03.0 Memory controller: VMware Virtual Machine Interface (rev 01)
Also
lsmod | grep -i vm
Should output a line similar to this:
vmmemctl 11111 0
64 bit
I have not tested PV on the x86_64 Arch due to a lack in technical supplies such as a 64 bit machine. This needs to be checked.
Kernel Support
I've found claims that since version 2.6.21, support for the VMI PV protocol is embedded in the Linux kernel. This is odd to me since any attempt I've made to run any Linux with PV enabled and without some version of VMI enabled VM Tools results in the kernel not panicing but simply dieing, With sometimes an error from VMware about unsupported op-code execution. So as far as I see it that's a no on kernel support for now.
Troubleshooting
Networking
If there is a problem with networking, it is possible that the module pcnet32 steals the network interface from vmware, disabling it works,
MODULES=(!pcnet32 ...)
Keyboard/Mouse
If you have no keyboard or mouse in X, you might try removing the line from xorg.conf in the "ServerFlags" Section
Remove Option "AutoAddDevices" "False" (alternatively you can change to true to test it)
See Also
- Installing VMware
- VMWare on Slackware Linux
- Installing vmware player -- the opposite of this ;)
- To get vmxnet working with the current (as of mid DEC06) stuff, review this: vmware tools 5.5.3, linux 2.6.19, vmxnet compile fix