Difference between revisions of "Installing Arch Linux in VMware (systemd)"

From ArchWiki
Jump to: navigation, search
(Add merge request.)
(Drivers)
Line 11: Line 11:
 
{{Hc|head=/etc/mkinitcpio.conf|output=
 
{{Hc|head=/etc/mkinitcpio.conf|output=
 
...
 
...
MODULES="vmsync vmblock vmxnet3 vmwgfx vmw_balloon vmci autofs4 vmhgfs"
+
MODULES="vmblock vmxnet3 vmwgfx vmw_balloon vmci autofs4 vmhgfs"
 
...}}
 
...}}
  
Line 17: Line 17:
 
  # depmod
 
  # depmod
 
  # mkinitcpio -p linux
 
  # mkinitcpio -p linux
 +
 +
The modules are responsible for:
 +
*'''vmblock''': Support for drag and drop operations between guest and host system
 +
*'''vmxnet3''': Driver for the virtual network adapter
 +
*'''vmwgfx''': Graphics driver
 +
*'''vmw_balloon''': From the source code of the driver: ''This is VMware physical memory management driver for Linux. The driver acts like a "balloon" that can be inflated to reclaim physical pages by reserving them in the guest and invalidating them in the monitor, freeing up the underlying machine pages so they can be allocated to other guests.  The balloon can also be deflated to allow the guest to use more physical memory. Higher level policies can control the sizes of balloons in VMs in order to manage physical memory resources.''
 +
*'''vmci''': ''The Virtual Machine Communication Interface (VMCI) is an infrastructure that provides fast and efficient communication between a virtual machine and the host operating system and between two or more virtual machines on the same host. The VMCI SDK facilitates development of applications that use the VMCI infrastructure. Without VMCI, virtual machines communicate with the host using the network layer. Using the network layer adds overhead to the communication. With VMCI communication overhead is minimal and different tasks that require that communication can be optimized. An internal network can transmit an average of slightly over 2Gbit/s using vmxnet3, VMCI can go up to nearly 10Gbit/s with 128k sized Queue pairs.'' ([http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1010806 Configuring a Virtual Machine Communication Interface (VMCI) on a vSphere ESX host])
 +
*'''vmhgfs''': Driver for sharing files between guest and host.
 +
*'''autofs4''':
 +
 +
These drivers are optional:
 +
*'''vmsync''': This seems to be a driver which offers a functionality similar to VSS on windows. This is used to create consistent backups of a virtual machine ([http://www.virten.net/2012/05/filesystem-consistent-linux-backups-with-vmware/ Filesystem consistent Linux Backups with VMware]). I'm not quite sure if this explanation is correct. Please update if you can explain it better. --[[User:BertiBoeller|BertiBoeller]] ([[User talk:BertiBoeller|talk]]) 12:44, 2 October 2012 (UTC)
  
 
== Systemd scripts ==
 
== Systemd scripts ==

Revision as of 12:44, 2 October 2012

Merge-arrows-2.pngThis article or section is a candidate for merging with Installing Arch Linux in VMware.Merge-arrows-2.png

Notes: Only Systemd scripts part is systemd centric. (Discuss in Talk:Installing Arch Linux in VMware (systemd)#)

This article describes how to get Archlinux running in a VMWare virtual machine when you're using systemd as SysV replacement.

Prerequisites

Please install the open-vm-tools-modules from the Community repository.

Drivers

Add the VMWare drivers to your mkinitcpio.conf:

/etc/mkinitcpio.conf
...
MODULES="vmblock vmxnet3 vmwgfx vmw_balloon vmci autofs4 vmhgfs"
...

Now you have to rebuild your kernel:

# depmod
# mkinitcpio -p linux

The modules are responsible for:

  • vmblock: Support for drag and drop operations between guest and host system
  • vmxnet3: Driver for the virtual network adapter
  • vmwgfx: Graphics driver
  • vmw_balloon: From the source code of the driver: This is VMware physical memory management driver for Linux. The driver acts like a "balloon" that can be inflated to reclaim physical pages by reserving them in the guest and invalidating them in the monitor, freeing up the underlying machine pages so they can be allocated to other guests. The balloon can also be deflated to allow the guest to use more physical memory. Higher level policies can control the sizes of balloons in VMs in order to manage physical memory resources.
  • vmci: The Virtual Machine Communication Interface (VMCI) is an infrastructure that provides fast and efficient communication between a virtual machine and the host operating system and between two or more virtual machines on the same host. The VMCI SDK facilitates development of applications that use the VMCI infrastructure. Without VMCI, virtual machines communicate with the host using the network layer. Using the network layer adds overhead to the communication. With VMCI communication overhead is minimal and different tasks that require that communication can be optimized. An internal network can transmit an average of slightly over 2Gbit/s using vmxnet3, VMCI can go up to nearly 10Gbit/s with 128k sized Queue pairs. (Configuring a Virtual Machine Communication Interface (VMCI) on a vSphere ESX host)
  • vmhgfs: Driver for sharing files between guest and host.
  • autofs4:

These drivers are optional:

  • vmsync: This seems to be a driver which offers a functionality similar to VSS on windows. This is used to create consistent backups of a virtual machine (Filesystem consistent Linux Backups with VMware). I'm not quite sure if this explanation is correct. Please update if you can explain it better. --BertiBoeller (talk) 12:44, 2 October 2012 (UTC)

Systemd scripts

In the following steps you have to create some systemd scripts so that the vmblock driver can be used successfully.

Create the following files:

/etc/tmpfiles.d/vmblock.conf
# creates the directory which is used by the vmblock driver
d /tmp/VMwareDnD 1777 root root
/etc/systemd/system/proc-fs-vmblock-mountPoint.mount
[Unit]
Description=Mount the vmblock device
ConditionPathExists=/proc/fs/vmblock/
After=vmblock.conf
Requires=vmblock.conf

[Mount]
What=none
Where=/proc/fs/vmblock/mountPoint/
Type=vmblock
/etc/systemd/system/proc-fs-vmblock-mountPoint.automount
[Unit]
Description=Mount the vmblock device
ConditionPathExists=/proc/fs/vmblock/
After=vmblock.conf
Requires=vmblock.conf

[Automount]
Where=/proc/fs/vmblock/mountPoint/

[Install]
WantedBy=multi-user.target

Then you have to enable the mount point in systemd:

 # systemctl enable proc-fs-vmblock-mountPoint.automount

VMware user suid wrapper

The following script is responsible that you can resize the window of your virtual machine:

/etc/xdg/autostart/vmware-user.desktop
[Desktop Entry]
Type=Application
Name=VMWare User Agent
Exec=/usr/bin/vmware-user-suid-wrapper
Icon=system-run
Comment=Enable Unity, DnD, etc.

Disable unneeded drivers

The open-vm-tools-modules package installs a configuration file for the vmxnet driver. Either delete the following file or comment the contents:

 /etc/modprobe.d/open-vm-tools-modules.conf

To make sure the vmxnet driver doesn't get loaded create the following file:

/etc/modprobe.d/vmxnet.conf
blacklist vmxnet

Enable shared folders

For shared folders to be working you need to have loaded the vmhgfs driver. Simply create the following systemd file:

/etc/systemd/system/mnt-hgfs.mount
[Unit]
Description=Load VMware shared folders
ConditionPathExists=.host:/

[Mount]
What=.host:/
Where=/mnt/hgfs
Type=vmhgfs
Options=defaults,noatime

[Install]
WantedBy=multi-user.target

Make sure that the folder /mnt/hgfs exists:

 # mkdir -p /mnt/hgfs

Enable the mount target with:

 # systemctl enable mnt-hgfs.mount

Enable 3d accleration

To enable 3d acceleration go to Edit virtual machine settings -> Hardware -> Display and enable the checkbox for Accelerate 3D graphics

Fix for problems

Mouse not working as expected

If you have the problem that mouse clicks are not registered in some programs you can try the following: edit /etc/X11/xorg.conf.d/10-evdev.conf and comment out the section with the identifier evdev pointer catchall [xf86-input-vmmouse does not work expected]

Network connection not working

Add the following line to your .vmx file:

 ethernet0.virtualDev = "vmxnet3"

More informations about the network adpater types can be found on the following page: Choosing a network adapter for your virtual machine