[英]Windows 8 VMWare guest under Ubuntu 16.04 host doesn't have access to the internet
[英]vmhgfs-fuse at boot with VMware Windows 8.1 host and Ubuntu 16.04 guest
我正在將 VMware Player 與 Windows 8.1 主機和 Ubuntu 16.04 來賓一起使用,我有一個共享文件夾shared_folder
,我想在啟動時掛載到特定位置: /shared_folder
。 我可以使用命令手動執行此操作
vmhgfs-fuse .host:/shared_folder /shared_folder
現在我想在啟動期間自動執行此操作。 由於我是 Ubuntu 的初學者,也許有人可以指出我的問題的解決方案。 謝謝
因此,經過半天的谷歌搜索、嘗試和錯誤,在我發布這個問題后 5 分鍾,我找到了一個可行的解決方案。 我將以下行添加到/etc/fstab
:
.host:/shared_folder /shared_folder fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,defaults 0 0
我正在運行 CentOS 7,但是這個方便的ArchLinux 文檔救了我。 我在共享文件夾中遇到了大量的 Apache 權限問題,經過數小時的挖掘,我能夠將掛載啟用為 systemd 服務。 重啟后一切正常。
為要掛載的目錄創建一個服務:
$ sudo touch /etc/systemd/system/<shared folders root directory>-<shared_folder>.service
使用文本編輯器,將服務的內容設置為以下內容,替換每個<...>
。
[Unit]
Description=Load VMware shared folders
Requires=vmware-vmblock-fuse.service
After=vmware-vmblock-fuse.service
ConditionPathExists=.host:/<shared_folder>
ConditionVirtualization=vmware
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/vmhgfs-fuse -o allow_other -o auto_unmount .host:/<shared_folder> <shared folders root directory>
[Install]
WantedBy=multi-user.target
注意:在 openSUSE 上,
vmware-vmblock-fuse
服務被稱為vmblock-fuse.service
。
確保<shared folders root directory>
存在,因為 systemd 服務依賴於它。
$ mkdir -p <shared folders root directory>
最后,啟用服務。
$ sudo systemctl enable <shared folders root directory>-<shared_folder>.service
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.