當前位置: 首頁>>技術教程>>正文


適用於Ubuntu 16.04 LTS Xenial的VMware Tools

, ,

問題描述

有人知道如何使VMware Tools能夠用於最新的Ubuntu 16.04 LTS Xenial嗎?

我一直在為我的Ubuntu 15.04 Vivid使用here的補丁,效果很好。但對於Ubuntu 16.04 LTS Xenial而言,此功能不再適用。錯誤附在下麵。

如果不運行VMware Tools,則無法看到主機共享的hgfs

github查找錯誤,它說

With open-vm-tools 10.0, there is no need to build vmhgfs module anymore. This is not required because HGFS implementation is FUSE based in 10.0.

因此,我刪除了VMware Tools,然後安裝了官方的open-vm-tools

$ apt-cache policy open-vm-tools
open-vm-tools:
  Installed: 2:10.0.7-3227872-2ubuntu2
  Candidate: 2:10.0.7-3227872-2ubuntu2
  Version table:
 *** 2:10.0.7-3227872-2ubuntu2 500
...

$ apt-cache search hgfs | wc 
      0       0       0

$ df
Filesystem     1K-blocks    Used Available Use% Mounted on
udev              481988       0    481988   0% /dev
tmpfs              99852    4548     95304   5% /run
/dev/sda1       31863728 1699600  28522504   6% /
tmpfs             499248       0    499248   0% /dev/shm
tmpfs               5120       0      5120   0% /run/lock
tmpfs             499248       0    499248   0% /sys/fs/cgroup

但是,我仍然看不到主機共享的hgfs

謝謝

/tmp/modconfig-VJIcMa/vmhgfs-only/link.c:59:21: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.follow_link   = HgfsFollowlink,
                 ^
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c:59:21: note: (near initialization for ‘HgfsLinkInodeOperations.follow_link’)
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c:61:21: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.put_link      = HgfsPutlink,
                 ^
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c:61:21: note: (near initialization for ‘HgfsLinkInodeOperations.put_link’)
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c: In function ‘HgfsFollowlink’:
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c:127:10: error: implicit declaration of function ‘nd_set_link’ [-Werror=implicit-function-declaration]
      nd_set_link(nd, fileName);
      ^
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c: In function ‘HgfsPutlink’:
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c:276:15: error: implicit  declaration of function ‘nd_get_link’ [-Werror=implicit-function-declaration]
fileName = nd_get_link(nd);
           ^
/tmp/modconfig-VJIcMa/vmhgfs-only/link.c:276:13: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
fileName = nd_get_link(nd);
         ^

$ uname -a 
Linux uname 4.4.0-21-generic #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

最佳方法

簽出”vmhgfs-fuse”命令。

我能夠做到以下幾點:

我創建了一個目錄來掛載hgfs共享,我們稱它為〜/vmshare。然後我做了:

vmhgfs-fuse ~/vmshare

在我的係統上,使用與您使用的相同版本的open-vm-tools,可以將共享磁盤正確安裝到〜/vmshare /中。

如果您不希望在用戶的主目錄中共享,則可能必須對vmhgfs-fuse使用sudo和其他參數。

參考資料

本文由Ubuntu問答整理, 博文地址: https://ubuntuqa.com/zh-tw/article/8567.html,未經允許,請勿轉載。