Difference between revisions of "VMware/Installing Arch as a guest"

From ArchWiki
Jump to: navigation, search
m (COPY AND PASTE)
Line 117: Line 117:
  
 
==COPY AND PASTE==
 
==COPY AND PASTE==
 +
 +
Install the following package (it is required for copy/paste but not listed as a dependency as reported [https://bbs.archlinux.org/viewtopic.php?id=141607 here])
 +
 +
pacman -S gtkmm
  
 
Run the following command after starting X (or add it to your {{ic|~/.xinitrc}} file) to automatically synchronize your X clipboard with the host's.  This allows you to copy text from your virtual machine and paste it in the host, and vice versa.
 
Run the following command after starting X (or add it to your {{ic|~/.xinitrc}} file) to automatically synchronize your X clipboard with the host's.  This allows you to copy text from your virtual machine and paste it in the host, and vice versa.
  
 
  vmware-user-suid-wrapper
 
  vmware-user-suid-wrapper
 +
 +
If you get the following error,
 +
 +
vmware-user: could not open /proc/fs/vmblock/dev
 +
 +
you need to first insert the vmblock module into your kernel.
 +
 +
  # sudo modprobe vmblock
 +
 +
To have the module loaded at boot, add "vmblock" to the modules section of your /etc/rc.conf file.
  
 
== Shared Folders with the Host ==
 
== Shared Folders with the Host ==

Revision as of 19:44, 11 July 2012

Summary help replacing me
Installing Archlinux in VMware: open-vm-tools and configuring Xorg
Related
VMware
Installing VMWare vCLI
Installing Arch Linux in VMware (systemd)

This article handles installing Archlinux in a VMware-based virtual environment such as VMware ESX, VMware Workstation/Fusion and VMware Player.

VMware Tools versus Open-VM-Tools

VMware Tools for linux exists in 2 forms: the official VMware Tools and Open-VM-Tools. VMware Tools is based on a stable snapshot of Open-VM-Tools. Open-VM-Tools contains more experimental code and features. The official VMware Tools are not available for Archlinux.

Originally, VMware Tools provided the best drivers for network and storage, combined with the functionality for other features such as time synchronization. However, for quite a while now the drivers for the network adapter en scsi adapter are part of the linux kernel, and VMware Tools is only needed for extra features and support for the "old" vmxnet adapter.

Open-VM-Tools modules

The open-vm-tools package contains the following modules:

  • vmblock: kernel filesystem module, enables drag&drop functionality between the host system and the virtual machine in VMware Workstation/Fusion.
  • vmhgfs: kernel filesystem module, enables file/directory sharing between the host system and the virtual machine in VMware Workstation/Fusion.
  • vmsync: experimental filesystem sync driver, enables filesystem quiescing when creating backups and snapshots.
  • vmci: virtual machine communication interface, high performance interface between virtual machines on the same host and between virtual machines and the host itself.
  • vsocket: part of vmci.
  • vmxnet: driver for the old vmxnet netwerk-adapter.

Open-VM-Tools utilities

The open-vm-tools package comes with the following utilities:

  • vmtoolsd: service responsible for the virtual machine status report.
  • vmware-check-vm: tool to check whether a utility has been started on a physical or virtual machine.
  • vmware-xferlogs: Dumps logging/debugging information to the virtual machine logfile.
  • vmware-toolbox-cmd: tool to obtain virtual machine information of the host such as statistics,...
  • vmware-user-suid-wrapper: tool to enable clipboard sharing (copy/paste) between host and virtual machine.

Installating Open-VM-Tools

Install the open-vm-tools package in the [community] repository:

pacman -S open-vm-tools

and start the service by running:

rc.d start open-vm-tools

To start the service during boot, add it to the DAEMONS area in the /etc/rc.conf file.

DAEMONS=(...open-vm-tools...)


The open-vm-tools reads the file /etc/arch-release which is empty:

cat /proc/version > /etc/arch-release

Time synchronization

Configuring time synchronization in a virtual machine is important: fluctuations are bound to occur more easily in a virtual machine compared to a physical host. This is mostly due to the fact that the cpu is shared by more than 1 virtual machine.

There are 2 options to set up time synchronization: the host machine as source or an external NTP server as source.

When you choose to use the host as source (for example in an ESX server), this can be done by issuing the command:

vmware-toolbox-cmd timesync enable

Xorg configuration

Note: To use Xorg in a virtual machine, a minimum of 32MB VGA memory is needed, and the VMware hardware version has to be > 8, version 7 is no longer functioning correctly.

Install the following dependencies:

pacman -S xf86-input-vmmouse xf86-video-vmware xf86-video-vesa svga-dri

Add the vmwgfx module to the MODULES array in rc.conf.

MODULES=(...vmwgfx...)

Create the following file:

/etc/X11/xorg.conf.d/20-gpudriver.conf
 Section "Device"
        Identifier "Card0"
        Driver     "vmware"
 EndSection

Afterwards, a reboot is required.

Paravirtual SCSI-Adapter

Due to less overhead the paravirtual scsi-adapter can give a substantial performance boost in ESX.

This can be used as follows: open the /etc/mkinitcpio.conf file and add the following to the MODULES array:

MODULES=(...vmw_pvscsi...)

Afterwards, run the command:

mkinitcpio -p linux

Shutdown the virtual machine and change the scsi-adapter type to: VMware Paravirtual. It's safe to ignore the warning that'll pop up.

VMCI

The VMCI interface is enabled by default in VMware Workstation and Fusion. In VMware ESX the interface is restricted, which means that communication is only possible between ESX and the virtual machine, not between virtual machines themselves. This can be changed in the Virtual Machine settings, traffic between ESX and the Virtual Machine can not be disabled.

DRAG AND DROP

Drag and Drop from files, from VMware Workstation/Fusion into the Virtual Machines, can be disabled by editing /etc/conf.d/open-vm-tools:

VM_DRAG_AND_DROP="no"

COPY AND PASTE

Install the following package (it is required for copy/paste but not listed as a dependency as reported here)

pacman -S gtkmm

Run the following command after starting X (or add it to your ~/.xinitrc file) to automatically synchronize your X clipboard with the host's. This allows you to copy text from your virtual machine and paste it in the host, and vice versa.

vmware-user-suid-wrapper

If you get the following error,

vmware-user: could not open /proc/fs/vmblock/dev

you need to first insert the vmblock module into your kernel.

 # sudo modprobe vmblock

To have the module loaded at boot, add "vmblock" to the modules section of your /etc/rc.conf file.

Shared Folders with the Host

Note: This functionality is only available in VMware Workstation and Fusion

Create a new Shared Folder by selecting VM -> Settings... in the VMware Workstation menu. Select the Options tab and then Shared Folder. Enable the Always enabled option and create a new share. For Windows XP, you can create a share named C with the Host Path C:\.

Add the following rule to /etc/fstab (adjust the uid/gid where needed) for each shared folder:

.host:/shared_folder /mnt/shared vmhgfs defaults,user,ttl=5,uid=root,gid=root,fmask=0133,dmask=0022 0 0

Create the mount directories and Shared Folders:

mkdir /mnt/shared
mount /mnt/shared

Temporary mounts are also possible:

mount -t -v -o rw .host:/shared_folder /mnt/shared
Note: an alternative way, tested on VMware player
.host:/ /mnt/shared vmhgfs defaults 0 0
mount -t vmhgfs .host:/ /mnt/shared

Prune mlocate DB

When using mlocate, it's useless to index the shared directories in the locate DB. Therefore, add the directories to PRUNEPATHS in /etc/updatedb.