问题解决:虚拟机无法复制粘贴文件

2022-06-27 10:19:32 浏览数 (1)

首先,vmware的增强工具是:open-vm-tools和open-vm-tools-desktop。复制字符没问题,就是复制文件和拖拽文件有问题。

拖拽和复制、粘贴文件,需要挂载一个特殊的文件系统:vmblock-fuse,先查看这个文件系统挂载服务的情况:

代码语言:javascript复制
[root@k8s-master wlf]#  systemctl status run-vmblock\x2dfuse.mount
● run-vmblockx2dfuse.mount - VMware vmblock Fuse Mount
   Loaded: loaded (/usr/lib/systemd/system/run-vmblockx2dfuse.mount; disabled; vendor preset: disabled)
   Active: inactive (dead)
    Where: /run/vmblock-fuse
     What: vmware-vmblock-fuse
     Docs: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vmblock-fuse/design.txt

死的,是吧。现在让它活一下:

代码语言:javascript复制
1. 开机自启
systemctl enable run-vmblock\x2dfuse.mount   

2. 启动服务
systemctl start run-vmblock\x2dfuse.mount

再看:

代码语言:javascript复制
[root@k8s-master wlf]#  systemctl status run-vmblock\x2dfuse.mount
● run-vmblockx2dfuse.mount - VMware vmblock Fuse Mount
   Loaded: loaded (/usr/lib/systemd/system/run-vmblockx2dfuse.mount; disabled; vendor preset: disabled)
   Active: inactive (dead)
    Where: /run/vmblock-fuse
     What: vmware-vmblock-fuse
     Docs: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vmblock-fuse/design.txt
[root@k8s-master wlf]# systemctl enable run-vmblock\x2dfuse.mount 
Created symlink from /etc/systemd/system/multi-user.target.wants/run-vmblockx2dfuse.mount to /usr/lib/systemd/system/run-vmblockx2dfuse.mount.
[root@k8s-master wlf]# systemctl start run-vmblock\x2dfuse.mount
[root@k8s-master wlf]# systemctl status run-vmblock\x2dfuse.mount
● run-vmblockx2dfuse.mount - VMware vmblock Fuse Mount
   Loaded: loaded (/usr/lib/systemd/system/run-vmblockx2dfuse.mount; enabled; vendor preset: disabled)
   Active: active (mounted) since Sat 2022-06-25 23:04:53 PDT; 14s ago
    Where: /run/vmblock-fuse
     What: vmware-vmblock
     Docs: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/vmblock-fuse/design.txt
  Process: 9874 ExecMount=/bin/mount vmware-vmblock-fuse /run/vmblock-fuse -t fuse -o subtype=vmware-vmblock,default_permissions,allow_other (code=exited, status=0/SUCCESS)
    Tasks: 3
   Memory: 2.5M
   CGroup: /system.slice/run-vmblockx2dfuse.mount
           └─9880 vmware-vmblock-fuse /run/vmblock-fuse -o rw,subtype=vmware-vmblock...

活的,是吧。 接下来重启 vm-tools 服务:

代码语言:javascript复制
[root@k8s-master wlf]# systemctl restart vmware-tools
Failed to restart vmware-tools.service: Unit not found.

没这个服务,是吧。

搜一下:

代码语言:javascript复制
[root@k8s-master wlf]# ls /usr/lib/systemd/system

找到了吧,重启它。

不要说找不到,除非你的屏幕就是小框。


有没有一种感觉,网上搜这个解决方案的,几乎都是让你重装 vm-tools 的,重装了还是不行。而且重装之后,连文本复制粘贴都不行了,查状态确是 active。。。

0 人点赞