by adminOctober 2, 2019
VMware Tools incorporates many features that enhance the operation of VMware Workstation. For example, you can activate copy and pasting from documents on the host to the guest computer, or vice versa. Or you can create a shared folder to make files accessible from either the guest or the host machine. It is therefore prudent, if not necessary, to install VMware Tools in Arch Linux right after installing VMware Workstation.
In Arch Linux, VMware Tools does not install as easily as it does on Windows and other Linux distributions. One of the problem is the absence of “init directory” that the installer needs for it’s proper installation. A google search will point you the official Arch Linux website and a github vmware-tools-patches. Both articles are about making patches to make VMware Tools.
The procedure outlined below does not make any patches and only entails creating the systemd service file to start the VMware Tools service daemon.
Step 1 – Dowload VMware Tools
Download the VMware Tools package by clicking the “Install Tools” button at the bottom of the VMware Workstation’s window. You may also start the download process by using the menu at the top of the window by selecting VM/Install VMware Tools.
Step 2 – Unpack VMware Tools
If the VMware Tools download in Step 1 was successful, the installer ISO image would be automatically mounted on the file system, as shown in the screenshot below. The installer is mounted at /run/media/root/’VMware Tools’.
Let us unpack the compressed installer file to our home directory. Note that I am logged in as the user “root” and my home folder is “/root”.
# tar xf /run/media/root/'VMware Tools'/VMwareTools*.tar.gz -C /root
The uncompressed installer is now at my home directory as shown by the image below.
Step 3 – Create a Fake Init Directory
Before we run the installer, we need to create a fake init directory. The init directory is used by Linux distributions that use System V Init for initialization. Arch Linux does not use the System V Init but instead uses the new systemd initialization.
# for x in {0..6}; do mkdir -p /etc/init.d/rc${x}.d; done
Step 4 – Run the VMware Installer
Now, we can run the installer.
# ./vmware-tools-distrib/vmware-install.pl
On my install, I accepted all the defaults by pressing the enter key for all the prompts. The screenshot of the resulting message after the installation process is shown below. Take note that it says that it was unable to start the vmware-tools service.
Step 5 – Create a VMware Tools Service File
Create the service file /etc/systemd/system/vmwaretools.service by starting a text editor.
# nano /etc/systemd/system/vmwaretools.service
Type in the following text and save the file.
[Unit]
Description=VMWare Tools Daemon
[Service]
ExecStart=/etc/init.d/vmware-tools start
ExecStop=/etc/init.d/vmware-tools stop
PIDFile=/var/lock/subsys/vmware
TimeoutSec=0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Step 6 – Start and Enable VMware Tools Service
To start the VMware Tools service, you can use the command:
# systemctl start vmwaretools.service
To make the service start at boot time, we use the command:
# systemctl enable vmwaretools.service
Step 7 – Reboot and Check
To see if VMware Tools successfully starts after after a reboot, type the command:
# systemctl status vmwaretools.service
That’s it, and we have now a working VMware Tools Daemon.
VMware Tools包含许多增强VMware Workstation操作的功能。例如,您可以激活从主机上的文档到来宾计算机的复制和粘贴,反之亦然。或者,您可以创建一个共享文件夹,以使文件可从客户机或主机访问。因此,如果不需要,在安装VMware Workstation之后立即在Arch Linux中安装VMware Tools是明智的。
在Arch Linux中,VMware Tools的安装不像Windows和其他Linux发行版那样容易。问题之一是安装程序没有正确安装所需的“初始目录”。谷歌搜索将为您指出Arch Linux官方网站和github vmware-tools-patches。这两篇文章都是关于制作修补程序以制作VMware Tools的。
以下概述的过程不会进行任何修补,仅需要创建systemd服务文件来启动VMware Tools服务守护程序。
步骤1 –下载VMware Tools
单击VMware Workstation窗口底部的“安装工具”按钮,下载VMware Tools软件包。您也可以通过使用窗口顶部的菜单,选择VM / Install VMware Tools,开始下载过程。
步骤2 –解压缩VMware Tools
如果步骤1中的VMware Tools下载成功,则安装程序ISO映像将自动安装在文件系统上,如下面的屏幕快照所示。安装程序安装在/ run / media / root /“ VMware Tools”中。
让我们将压缩的安装程序文件解压缩到我们的主目录中。请注意,我以“ root”用户身份登录,主目录为“ / root”。
#tar xf / run / media / root /'VMware Tools'/ VMwareTools * .tar.gz -C / root
现在,未压缩的安装程序位于我的主目录中,如下图所示。
第3步–创建伪初始化目录
在运行安装程序之前,我们需要创建一个伪造的init目录。使用System V Init进行初始化的Linux发行版使用init目录。 Arch Linux不使用System V Init,而是使用新的systemd初始化。
#用于{0..6}中的x;做mkdir -p /etc/init.d/rc${x}.d;完成
步骤4 –运行VMware Installer
现在,我们可以运行安装程序了。
#./vmware-tools-distrib/vmware-install.pl
在安装过程中,我通过按所有提示的Enter键来接受所有默认设置。安装过程后生成的消息的屏幕截图如下所示。请注意,它说它无法启动vmware-tools服务。
步骤5 –创建VMware Tools服务文件
通过启动文本编辑器来创建服务文件/etc/systemd/system/vmwaretools.service。
#nano /etc/systemd/system/vmwaretools.service
输入以下文本并保存文件。
[Unit]
Description=VMWare Tools Daemon
[Service]
ExecStart=/etc/init.d/vmware-tools start
ExecStop=/etc/init.d/vmware-tools stop
PIDFile=/var/lock/subsys/vmware
TimeoutSec=0
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
步骤6 –启动并启用VMware Tools服务
要启动VMware Tools服务,可以使用以下命令:
#systemctl启动vmwaretools.service
为了使服务在启动时启动,我们使用以下命令:
#systemctl启用vmwaretools.service
步骤7 –重新启动并检查
要查看重新启动后VMware Tools是否成功启动,请键入以下命令:
#systemctl status vmwaretools.service
就是这样,我们现在有一个正在运行的VMware Tools守护程序。