vmware workstation 12 使用open-vm-tools配置ubuntu共享文件夾

分類:IT技術 時間:2016-10-10

vmware 12下安裝ubuntu 16.04後,按往常的慣例安裝vmware-tools,安裝時提示建議使用open-vm-tools,於是放棄vmware-tools的安裝,嘗試使用open-vm-tools

首先安裝open-vm-tools

sudo apt-get install open-vm-tools

安裝時,apt提示建議安裝open-vm-tools-desktop,一不做二不休,一起裝了吧

sudo apt-get install open-vm-tools-desktop

之前在虛擬機上已經設置了共享文件夾,現在通過下面的命令就可以看到已經設置好的共享文件夾名

vmware-hgfsclient

然後根據wiki.archlinux.org上找到的教程配置共享文件夾

進入/etc/systemd/system目錄

cd /etc/systemd/system

創建一個文件,我這裏命名為mnt.hgfs.service

sudo gedit ./mnt.hgfs.service

填入下面的內容,為了方便,就不單獨配置各個共享文件夾了,直接將所有共享文件夾mount到一個目錄下

[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

保存後,用systemctl命令使能這個service

sudo systemctl enable mnt.hgfs.service

如果沒有創建/mnt/hgfs文件夾,需要創建

sudo mkdir -p /mnt/hgfs

重啟後檢查共享目錄是否已經掛載到/mnt/hgfs目錄下了

 


Tags: service ubuntu system enable shared

文章來源:


ads
ads

相關文章
ads

相關文章

ad