Ubuntu 24.04安装和open-vm-tools以及共享文件夹

vmware虚拟机安装ubuntu 24 卡安装界面解决方法,将内存至少设置为4GB(4096MB)即可,安装完后再调为2GB

sudo -su

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

可以执行如下命令查看共享的文件夹
vmware-hgfsclient

mkdir /mnt/hgfs

挂载

sudo mount -t fuse.vmhgfs-fuse .host:/ /mnt/hgfs -o allow_other

/mnt/hgfs/ 是挂载点,我们也可以修改为其它挂载点
-o allow_other 表示普通用户也能访问共享目录。
然后,输入如下命令再次进入 /mnt/hgfs 查看 (注意:挂载后必须要再次进入/mnt/hgfs才能查看到共享的文件夹)

cd /mnt/hgfs

ll

如果出现只能复制粘贴文字无法粘贴文件,可能是wayland的问题,需要禁用

sudo vi /etc/gdm3/custom.conf 在其中加入 WaylandEnable=false
sudo systemctl restart gdm3

导出系统文件
在虚拟机右键复制,到物理机右键粘贴就可

 

设置启动时自动挂载

a.编辑开机启动脚本: 打开一个终端窗口,使用文本编辑器(如 nano 或 vim)编辑 /etc/rc.local 文件,添加以下内容来自动挂载共享文件夹: sudo vim /etc/rc.local

b.在文件的末尾添加以下行,确保替换为你的共享文件夹路径和名称:

#!/bin/sh -e

/usr/bin/vmhgfs-fuse .host:/data /mnt/hgfs -o subtype=vmhgfs-fuse,allow_other

c.然后保存并关闭文件。为脚本添加执行权限: sudo chmod +x /etc/rc.local

d.查看权限 ls -ld /etc/rc.local

参考:https://www.bilibili.com/opus/838256944805314582

原文链接:https://www.hertzdance.com/blog/ubuntu-24-04-install-open-vm-tools,转载请注明出处。

0

评论0

请先
欢迎光临频率跳动资源网
显示验证码
没有账号?注册  忘记密码?