解决open-vm-tools安装时Failed to get unit file state for run-vmblockx2dfuse.mount
不知道什么原因,在kali rolling安装open-vm-tools时报以下错误:
Failed to get unit file state for run-vmblockx2dfuse.mount: No such file or directory
run-vmblock\x2dfuse.mount is a disabled or a static unit, not starting it.
我之后搜到这早被国外列为bug:
https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/1513531
无奈的是我看得云里雾里的,好像是Mounting shared Folder not working.
之后里面有人回复推荐了另一个网页上的解决法子
https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/1551558/comments/4
正如里面所说的“Not sure all of it is necessary, but at least it works. Also I think it should be mentioned in Ubuntu FAQ somewhere.”,不一定有用,但至少可以运行。反正我是试了试:)
0x01 先卸载所有跟open-vm-tools有关的
apt-get autoremove open-vm-tools open-vm-tools-desktop open-vm-tools-dkms --purge
reboot
0x02 修改/etc/fstab,使其自动加载hgfs
vi /etc/fstab
# 在最下面加入以下这句
.host:/ /mnt/hgfs fuse.vmhgfs-fuse allow_other,uid=1000,gid=1000,auto_unmount,users,defaults 0 0
记得这时候不要reboot重启,因为还没安装open-vm-tools(如果这时候就重启电脑,重启后因挂载不了而进入emergency mode
,那时候就需要再编辑/etc/fstab
把上面新加入的那句话注释掉重启后才能进入机子)
0x03 安装open-vm-tools
apt-get install open-vm-tools-desktop fuse
reboot
(如果你重启后进入里面,发现跟物理机的复制粘贴功能不好,多试着重启几下,会好的吧。)