天天看點

Ubuntu:vmware與windows共享檔案

參考:https://my.oschina.net/u/1158620/blog/712253

目标:vmware中可以通路windows的檔案

環境:vmware:12.5.5,ubuntu:ubuntu-gnome-16.04.5-desktop-amd64

工具:open-vm-tools

1. 安裝open-vm-tools。這裡沒有使用vmware-tools,因為在安裝vmware-tools的時候提示安裝open-vm-tools

sudo apt install open-vm*
           

2. 在/etc/systemd/system目錄下建立一個檔案:windows.ubuntu.share.service(名字自取)

cd /etc/systemd/system/
touch windows.ubuntu.share.service
           

3. 在上述檔案中輸入以下内容

[Unit] 
Description=Load VMware shared folders 
Requires=vmware-vmblock-fuse.service 
After=vmware-vmblock-fuse.service 
ConditionPathExists=.host:/ 
ConditionVirtualization=vmware 

[Service] 
Type=oneshot 
RemainAfterExit=yes 
ExecStart= 
ExecStart=/usr/bin/vmhgfs-fuse -o allow_other -o auto_unmount .host:/ /mnt/hgfs 

[Install] 

WantedBy=multi-user.target
           

4. 使用systemctl指令使能這個service

systemctl enable mnt.hgfs.service
           

5. 重新開機,然後檢視/mnt/hgfs/目錄下是否已經挂載windows檔案。如果不存在hgfs目錄,需要建立。