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

From ArchWiki
Jump to: navigation, search
m (Drivers)
Line 5: Line 5:
  
 
== Prerequisites ==
 
== Prerequisites ==
Please install the ''open-vm-tools-modules'' from the ''Community'' repository.
+
Please install the ''open-vm-tools'' and ''open-vm-tools-modules'' from the ''Community'' repository.
  
== Drivers ==
+
If you're booting into a graphical target you're almost done. ''/etc/xdg/autostart/vmware-user.desktop'' will get started which will setup most of the things needed to work with the virtual machine.
Add the VMWare drivers to your ''mkinitcpio.conf'':
 
{{Hc|head=/etc/mkinitcpio.conf|output=
 
...
 
MODULES="vmblock vmxnet3 vmwgfx vmw_balloon vmci autofs4 vmhgfs"
 
...}}
 
  
Now you have to rebuild your kernel:
+
If you're booting into ''multi-user.target'' then you need to enable the ''vmtoolsd.service'':
# depmod
+
  # systemctl enable vmtoolsd.service
# mkinitcpio -p linux
 
  
The modules are responsible for:
+
== Enable shared folders ==
*'''vmblock''': Support for drag and drop operations between guest and host system
+
For shared folders to be working you need to have loaded the ''vmhgfs'' driver.
*'''vmxnet3''': Driver for the virtual network adapter
+
Simply create the following systemd files:
*'''vmwgfx''': Graphics driver
+
{{Hc|head=/etc/systemd/system/mnt-hgfs.mount|output=
*'''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 ==
 
In the following steps you have to create some systemd scripts so that the ''vmblock'' driver can be used successfully.
 
 
 
Create the following files:
 
{{Hc|head=/etc/tmpfiles.d/vmblock.conf|output=
 
# creates the directory which is used by the vmblock driver
 
d /tmp/VMwareDnD 1777 root root
 
}}
 
 
 
{{Hc|head=/etc/systemd/system/proc-fs-vmblock-mountPoint.mount|output=
 
 
[Unit]
 
[Unit]
Description=Mount the vmblock device
+
Description=Load VMware shared folders
ConditionPathExists=/proc/fs/vmblock/
+
ConditionPathExists=.host:/
After=vmblock.conf
 
Requires=vmblock.conf
 
  
 
[Mount]
 
[Mount]
What=none
+
What=.host:/
Where=/proc/fs/vmblock/mountPoint/
+
Where=/mnt/hgfs
Type=vmblock
+
Type=vmhgfs
}}
+
Options=defaults,noatime
 
 
{{Hc|head=/etc/systemd/system/proc-fs-vmblock-mountPoint.automount|output=
 
[Unit]
 
Description=Mount the vmblock device
 
ConditionPathExists=/proc/fs/vmblock/
 
After=vmblock.conf
 
Requires=vmblock.conf
 
 
 
[Automount]
 
Where=/proc/fs/vmblock/mountPoint/
 
  
 
[Install]
 
[Install]
Line 66: Line 30:
 
}}
 
}}
  
Then you have to enable the mount point in systemd:
+
{{Hc|head=/etc/systemd/system/mnt-hgfs.automount|output=
  # 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:
 
{{Hc|head=/etc/xdg/autostart/vmware-user.desktop|output=
 
[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:
 
{{Hc|head=/etc/modprobe.d/vmxnet.conf|output=
 
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:
 
{{Hc|head=/etc/systemd/system/mnt-hgfs.mount|output=
 
 
[Unit]
 
[Unit]
 
Description=Load VMware shared folders
 
Description=Load VMware shared folders
 
ConditionPathExists=.host:/
 
ConditionPathExists=.host:/
  
[Mount]
+
[Automount]
What=.host:/
 
 
Where=/mnt/hgfs
 
Where=/mnt/hgfs
Type=vmhgfs
 
Options=defaults,noatime
 
  
 
[Install]
 
[Install]
WantedBy=multi-user.target
 
 
}}
 
}}
 +
 
Make sure that the folder ''/mnt/hgfs'' exists:
 
Make sure that the folder ''/mnt/hgfs'' exists:
 
   # mkdir -p /mnt/hgfs
 
   # mkdir -p /mnt/hgfs
 
Enable the mount target with:
 
Enable the mount target with:
   # systemctl enable mnt-hgfs.mount
+
   # systemctl enable mnt-hgfs.automount
  
 
== Enable 3d accleration ==
 
== Enable 3d accleration ==

Revision as of 14:19, 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 and open-vm-tools-modules from the Community repository.

If you're booting into a graphical target you're almost done. /etc/xdg/autostart/vmware-user.desktop will get started which will setup most of the things needed to work with the virtual machine.

If you're booting into multi-user.target then you need to enable the vmtoolsd.service:

 # systemctl enable vmtoolsd.service

Enable shared folders

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

/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
/etc/systemd/system/mnt-hgfs.automount
[Unit]
Description=Load VMware shared folders
ConditionPathExists=.host:/

[Automount]
Where=/mnt/hgfs

[Install]

Make sure that the folder /mnt/hgfs exists:

 # mkdir -p /mnt/hgfs

Enable the mount target with:

 # systemctl enable mnt-hgfs.automount

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