取得資源內容

一旦在 ESXi 主機上設定了 GuestStore 存放庫之後,即可使用 VMware Tools 命令列公用程式輕鬆存取 GuestStore 存放庫中的資源。
您可以使用 VMware Tools Toolbox 命令列公用程式,從 GuestStore 存放庫擷取資源內容。
"C:\Program Files\VMware\VMwareTools\VMwareToolboxCmd.exe" gueststore getcontent <resource path> <output file>
/usr/bin/vmware-toolbox-cmd gueststore getcontent <resource path> <output file>
其中,
<resource path>
是 GuestStore 存放庫資料存放區根 URL 下方的路徑。
例如:
"C:\Program Files\VMware\VMware Tools\VMwareToolboxCmd.exe" gueststore getcontent /vmware/apps/vmtools/windows64/metadata.json C:\Temp\metadata.json
"C:\Program Files\VMware\VMware Tools\VMwareToolboxCmd.exe" gueststore getcontent /vmware/configurations/vmtools/windows/tools.conf C:\Temp\tools.conf
客體管理員可以使用下列
tools.conf
設定來控制對 GuestStore 存放庫的存取權。
[guestStore]
disabled = false
(依預設,在 ESXi 主機端上進行設定時,系統會啟用 GuestStore 存放庫的存取權)
adminOnly = false
(依預設,不需要系統管理員權限就可存取 GuestStore 存放庫)
若是
disabled = true
,系統會停用 GuestStore 存放庫的所有客體存取權,包括 VMware Tools GuestStore 型升級以及 GlobalConf 功能。
啟用 GuestStore 存取權 (
disabled = false
) 時,設定
adminOnly = true
會限制只有系統管理員或根使用者才能執行下列命令以從 GuestStore 存放庫取得內容:
  • Windows
    "C:\Program Files\VMware\VMwareTools\VMwareToolboxCmd.exe" gueststore getcontent <resource path> <output file>
  • Linux
    /usr/bin/vmware-toolbox-cmd gueststore getcontent <resource path> <output file>