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

From ArchWiki
Jump to: navigation, search
(VMware-user wrapper)
m (Enable Unity)
(12 intermediate revisions by 2 users not shown)
Line 3: Line 3:
 
{{i18n|Installing Arch Linux in VMWare}}
 
{{i18n|Installing Arch Linux in VMWare}}
  
Installing Arch Linux inside a VM (e.g. in VMware running on Windows or using VMware Fusion on Mac OS X) works without trouble.
+
This article will explain how to install Arch Linux inside a virtual machine (e.g. in VMware Workstation on Windows or VMware Fusion on Mac OS X).
 +
 
 +
If using systemd, see: [[Installing_Arch_Linux_in_VMware_(systemd)|Installing Arch Linux in VMware (systemd)]].
  
 
You may also be interested in [[VMware|installing VMware in Arch]].
 
You may also be interested in [[VMware|installing VMware in Arch]].
Line 10: Line 12:
 
The VMware 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 VMware). They also provide a set of tools to access advanced options of the Virtual Machine, including shrinking and freeing unnecessary space in the virtual hard drives
 
The VMware 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 VMware). They also provide a set of tools to access advanced options of the Virtual Machine, including shrinking and freeing unnecessary space in the virtual hard drives
  
Install the open-vm-tools package from community
+
Install the {{ic|open-vm-tools}} package from <nowiki>[</nowiki>[[community]]<nowiki>]</nowiki>:
 
  pacman -S open-vm-tools
 
  pacman -S open-vm-tools
and start VMware tools with:
+
 
 +
and start {{ic|VMware tools}} with:
 
  /etc/rc.d/open-vm-tools start
 
  /etc/rc.d/open-vm-tools start
  
To start them automatically at boot, add the daemon to the DAEMONS array in [[rc.conf]].
+
To start them automatically at boot, add the daemon to the [[DAEMONS]] array in [[rc.conf]].
 
  DAEMONS=( ... open-vm-tools ... )
 
  DAEMONS=( ... open-vm-tools ... )
  
To start the vmware toolbox (allows you to configure time synchronization, connect or disconnect devices, shrink the hard disk freeing unnecessary space, etc), run the following command (you may have to run as root to get full functionality)
+
To start the {{ic|vmware toolbox}} (allows you to configure time synchronization, connect or disconnect devices, shrink the hard disk freeing unnecessary space, etc), run the following command:
  vmware-toolbox
+
  # vmware-toolbox
  
 
{{Note|In previous versions, starting this daemon was not strictly necessary; mouse integration, copy/paste and drag/drop under X would still work, as long as vmware-user was executed. This is no longer the case. Starting with version 2010.07.25 of open-vm-tools, vmware-user is no longer available and its functionality is implemented as a plugin managed by a new daemon (vmtoolsd).}}
 
{{Note|In previous versions, starting this daemon was not strictly necessary; mouse integration, copy/paste and drag/drop under X would still work, as long as vmware-user was executed. This is no longer the case. Starting with version 2010.07.25 of open-vm-tools, vmware-user is no longer available and its functionality is implemented as a plugin managed by a new daemon (vmtoolsd).}}
Line 25: Line 28:
 
== Installing X ==
 
== Installing X ==
  
Beyond installing Xorg (see main article [[Xorg]]), the packages needed in order to be able to use X properly can be installed with
+
The necessary [[Xorg]] packages can be installed with:
  # pacman -S xf86-input-vmmouse xf86-video-vmware
+
  # pacman -S xorg-server xf86-input-vmmouse xf86-video-vmware
and the fallback X drivers
+
 
 +
and the fallback X driver:
 
  # pacman -S xf86-video-vesa
 
  # pacman -S xf86-video-vesa
 
Modern versions of Xorg are automatically configured. If you are using a manual configuration, set the mouse driver to "vmmouse".
 
 
=== VMware-user wrapper ===
 
In order for cut/paste and drag/drop to work between VM and host, you need to start the vmware-user wrapper. First make sure it was installed as a suid binary. type the following:
 
$ ls -l /usr/bin/vmware-user-suid-wrapper
 
You should see something like this:
 
-rwsr-xr-x 1 root root 5768 Aug 20 10:13 /usr/bin/vmware-user-suid-wrapper
 
If you do not see an ''s'' bit in the fourth position, you should enable it by running the following command as root:
 
# chmod 4755 /usr/bin/vmware-user-suid-wrapper
 
 
Once you make sure vmware-user-suid-wrapper is set as a suid binary, you should run it on login by either adding the line
 
vmware-user-suid-wrapper
 
to {{Filename|~/.xinitrc}} or {{Filename|.xsession}} for startx, or by adding the following file {{Filename|$HOME/.config/autostart/vmware-user.desktop}}. You can also create the file in {{Filename|/etc/xdg/autostart/vmware-user.desktop}}. This way the file gets loaded when the xorg server gets started.
 
[Desktop Entry]
 
Type=Application
 
Name=VMWare User Agent
 
Exec=vmware-user-suid-wrapper
 
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.
 
 
''Note: If after executing '''vmware-user-suid-wrapper''' you get the following error:''
 
vmware-user: error while loading shared libraries: libgtkmm-2.4.so.1: cannot open shared object file: No such file or directory
 
''You need to install gtkmm''
 
# pacman -S gtkmm
 
  
 
== Enable Unity ==
 
== Enable Unity ==
 
Unity is installed by default, but needs a bit of work to get it running.
 
Unity is installed by default, but needs a bit of work to get it running.
First,make sure that open-vm-tools is installed and loaded on startup. If needed, add open-vm-tools to the DAEMONS list.
+
First, make sure that {{ic|open-vm-tools}} is installed and loaded on startup. If needed, add {{ic|open-vm-tools}} to the DAEMONS list.
  
Next, add vmware-user-suid-wrapper to autostart either by using your desktop environment's autostart or create a file like {{Filename|~/.config/autostart/vmware-user-agent.desktop}} with following contents:
+
Log out and restart. Unity will work. Unfortunately at the moment, menus may not display properly, so launch a terminal, switch to Unity and use the terminal to launch whatever you want. If you get an error like:
 +
error while loading shared libraries: libgtkmm-2.4.so.1: cannot open shared object file: No such file or directory
  
[Desktop Entry]
+
Install {{ic|gtkmm}}:
Type=Application
+
Name=VMWare User Agent
+
Exec=vmware-user-suid-wrapper
+
Icon=system-run
+
Comment=Enable Unity, DnD, etc.
+
 
+
Log out and restart. Unity will work. Unfortunately at the moment, menus may not display properly, so launch a terminal, switch to Unity and use the terminal to launch whatever you want. If you get an error like
+
error while loading shared libraries: libgtkmm-2.4.so.1: cannot open shared object file: No such file or directory
+
install gtkmm
+
 
  pacman -S gtkmm
 
  pacman -S gtkmm
  
 
== Shared Folders with the Host ==
 
== 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 {{Filename|C:\}}.
+
Create a new Shared Folder by selecting {{ic|VM}} -> {{ic|Settings...}} from the VMware Workstation menu. Select the {{ic|Options}} tab and then {{ic|Shared Folder}}.  Check the {{ic|Always enabled}} option and create a new share.  For Windows XP you can create a share with the Name {{ic|C}} and the Host Path {{ic|C:\}}.
  
Then add the following line to your {{Filename|/etc/fstab}} file (changing uid/gid as needed):
+
Then add the following line to your {{ic|/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
 
  .host:/ /mnt/hgfs vmhgfs defaults,user,ttl=5,uid=root,gid=root,fmask=0133,dmask=0022 0 0
Line 87: Line 57:
 
  mount /mnt/hgfs
 
  mount /mnt/hgfs
  
All of your shared folders will now be visible by name under {{Filename|/mnt/hgfs}}
+
All of your shared folders will now be visible by name under {{ic|/mnt/hgfs}}:
  
 
  /mnt/hgfs/<Shared Folder Name>
 
  /mnt/hgfs/<Shared Folder Name>
  
For the Windows XP '''C''' share example:
+
For the Windows XP {{ic|C}} share example:
  
 
  ls /mnt/hgfs/C
 
  ls /mnt/hgfs/C
Line 97: Line 67:
  
 
== Final touch ==
 
== 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 incron
 
# pacman -S incron
 
and edit the system crontab, i.e.
 
# incrontab -e
 
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 ===
 
=== Prune mlocate DB ===
  
It is also useless to add the shared directories to the locate DB. Add the shared directories to PRUNEPATHS in {{Filename|/etc/updatedb}}
+
It is useless to add the shared directories to the {{ic|locate DB}}. Add the shared directories to {{ic|PRUNEPATHS}} in {{ic|/etc/updatedb}}.
  
 
== Paravirtualization ==
 
== Paravirtualization ==
Line 140: Line 97:
 
=== VMI Installation ===
 
=== VMI Installation ===
  
{{Note|Be mindful of that VMI support will be removed from the kernel at some point and you will have to downgrade your kernel to continue working with it.}}
+
You must install the {{ic|open-vm-tools}} before enabling {{ic|VMI}}.
  
You must install the open-vm-tools before enabling VMI.
+
To enable {{ic|VMI}} click on {{ic|Settings...}} from the VM menu. Select the {{ic|Processors device}} and enable {{ic|VMWare kernel paravirtualization}}.
  
To enable VMI click on "Settings..." from the VM menu. Select the Processors device and enable 'VMWare kernel paravirtualization'
+
Once Arch is up and running you can check if you have {{ic|VMI}} enabled or not by running the following command:
 
+
Once Arch is up and running you can check if you have VMI enabled or not by running the following command:
+
 
  $ dmesg | grep vmi
 
  $ dmesg | grep vmi
  
Line 158: Line 113:
 
=== VMCI Installation ===
 
=== VMCI Installation ===
  
To verify that VMCI is up and running, run the following command:
+
To verify that {{ic|VMCI}} is up and running, run the following command:
 
  $ dmesg | grep vmci
 
  $ dmesg | grep vmci
  
If VMCI is enabled you should see an output such as:
+
If {{ic|VMCI}} is enabled you should see an output such as:
 
  Probing for vmci/PCI.
 
  Probing for vmci/PCI.
 
  vmci 0000:00:07.7: PCI INT A -> GSI (level, low) -> IRQ 16
 
  vmci 0000:00:07.7: PCI INT A -> GSI (level, low) -> IRQ 16
Line 171: Line 126:
 
=== Networking ===
 
=== Networking ===
  
If there is a problem with networking, it is possible that the module pcnet32 steals the network interface from vmware, disabling it works,
+
If there is a problem with networking, it is possible that the module {{ic|pcnet32}} steals the network interface from VMware, disabling it works:
 
  MODULES=(!pcnet32 ...)
 
  MODULES=(!pcnet32 ...)
  
=== Keyboard/Mouse ===
+
=== Keyboard/Mouse not working in X ===
 
+
If you have no keyboard or mouse in X, you might try removing the line from {{Filename|xorg.conf}} in the "ServerFlags" Section
+
 
+
Remove Option "AutoAddDevices" "False" (alternatively you can change to true to test it)
+
 
+
==== Mouse lags and "flickers" after upgrade ====
+
  
After upgrading some packages (includein Xorg) my mouse was slow and unresponsive within vmware. The reason was that the vmmouse driver was not loaded anymore.
+
If you have no keyboard or mouse in X make sure you don't have the following line in the {{ic|ServerFlags}} section of your Xorg configuration. Consult [[Xorg#InputClasses]] for further assistance:
  
To solve the issue I had to add
+
  Remove Option "AutoAddDevices" "False"
  Section "ServerFlags"
+
  Option "AllowEmptyInput" "off"
+
EndSection
+
and
+
Section "InputDevice"
+
  Identifier  "Mouse0"
+
  Driver      "vmmouse"
+
  Option      "Protocol" "auto"
+
  Option      "Device" "/dev/input/mice"
+
  Option      "ZAxisMapping" "4 5 6 7"
+
EndSection
+
to my {{Filename|xorg.conf}} (actually I created {{Filename|/etc/X11/xorg.conf.d/10-serverflags.conf}} and {{Filename|/etc/X11/xorg.conf.d/10-mouse.conf}} containing the configurations).
+

Revision as of 21:16, 28 January 2012

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

This article will explain how to install Arch Linux inside a virtual machine (e.g. in VMware Workstation on Windows or VMware Fusion on Mac OS X).

If using systemd, see: Installing Arch Linux in VMware (systemd).

You may also be interested in installing VMware in Arch.

VMware Tools

The VMware 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 VMware). They also provide a set of tools to access advanced options of the Virtual Machine, including shrinking and freeing unnecessary space in the virtual hard drives

Install the open-vm-tools package from [community]:

pacman -S open-vm-tools

and start VMware tools with:

/etc/rc.d/open-vm-tools start

To start them automatically at boot, add the daemon to the DAEMONS array in rc.conf.

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

To start the vmware toolbox (allows you to configure time synchronization, connect or disconnect devices, shrink the hard disk freeing unnecessary space, etc), run the following command:

# vmware-toolbox
Note: In previous versions, starting this daemon was not strictly necessary; mouse integration, copy/paste and drag/drop under X would still work, as long as vmware-user was executed. This is no longer the case. Starting with version 2010.07.25 of open-vm-tools, vmware-user is no longer available and its functionality is implemented as a plugin managed by a new daemon (vmtoolsd).

Installing X

The necessary Xorg packages can be installed with:

# pacman -S xorg-server xf86-input-vmmouse xf86-video-vmware

and the fallback X driver:

# pacman -S xf86-video-vesa

Enable Unity

Unity is installed by default, but needs a bit of work to get it running. First, make sure that open-vm-tools is installed and loaded on startup. If needed, add open-vm-tools to the DAEMONS list.

Log out and restart. Unity will work. Unfortunately at the moment, menus may not display properly, so launch a terminal, switch to Unity and use the terminal to launch whatever you want. If you get an error like:

error while loading shared libraries: libgtkmm-2.4.so.1: cannot open shared object file: No such file or directory

Install gtkmm:

pacman -S gtkmm

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 your /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

Prune mlocate DB

It is useless to add the shared directories to the locate DB. Add the shared directories to PRUNEPATHS in /etc/updatedb.

Paravirtualization

Description

Paravirtualization (PV) is a virtualization feature\technique that allows 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 will not.

With the to-date distributions of Arch, PV works out of the box.

On newer x86 and x86-64 CPU models (Both AMD and Intel) PV is implemented as a hardware feature and no additional configuration is required. For older CPU models, You must enable the deprecated VMI protocol that introduces modifications to the guest kernel that makes it aware of the fact that it is virtualized. (Microsoft refers to this as an Enlightened Guest OS)

VMI Retired

VMWare PV was once implemented as the VMI (Virtual Machine Interface) standard.

In 2009, VMware announced they would stop supporting VMI in 2011. The Linux kernel should remove the VMI code around version 2.6.37. VMI still remains useful since it allows for PV on older CPUs and Arch Linux is well built for a Linux VM Guest on hosts with low resources. VMI offers a tremendous impact on the VM performance under these circumstances.

In updated vmware products (Workstation 7+ and ESX 4+) VMI is retired. The functionality that was implemented in VMI and not covered by the improvements in modern CPUs is now implemented by the newer VMCI standard. Again, on to-date Arch Linux and open-vm-tools installations, VMCI works OOB and should not pose any problems. If you do encounter issues then the Vmware Community forums will offer all the aid you need.

On Vmware Workstation products VMCI is enabled by default. On Vmware ESX products VMCI is disabled by default on the basis that it COULD pose a security risk. You can enable or disable VMCI through the VM settings screen. VMCI provides extra features, as well as a generic platform, for the area of Guest-To-Host communication.

VMI Installation

You must install the open-vm-tools before enabling VMI.

To enable VMI click on Settings... from the VM menu. Select the Processors device and enable VMWare kernel paravirtualization.

Once Arch is up and running you can check if you have VMI enabled or not by running the following command:

$ dmesg | grep vmi

If VMI is enabled you should see an output such as:

Booting paravirtualized kernel on vmi [deprecated]
vmi: registering clock event vmi-timer. mult=9202214 shift=22
vmi: registering clock event vmi-timer. mult=9202214 shift=22
vmi: registering clock source khz=2193979
Switching to clocksource vmi-timer

VMCI Installation

To verify that VMCI is up and running, run the following command:

$ dmesg | grep vmci

If VMCI is enabled you should see an output such as:

Probing for vmci/PCI.
vmci 0000:00:07.7: PCI INT A -> GSI (level, low) -> IRQ 16
Found vmci/PCI at 0x1080, irq 16.
Registered vmci device.

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 not working in X

If you have no keyboard or mouse in X make sure you don't have the following line in the ServerFlags section of your Xorg configuration. Consult Xorg#InputClasses for further assistance:

Remove Option "AutoAddDevices" "False"