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守護程序。