vmware虚拟机配置共享

环境:

  • OS:CentOS-7-x86_64-Minimal-2009.iso
  • 内核版本:kernel-ml-5.18.15-1.el7.elrepo.x86_64 或 kernel-ml-6.1.12-1.el7.elrepo.x86_64
  • 虚拟机平台:VMware® Workstation 16 Pro
  • 虚拟机平台版本:16.2.3 build-19376536

第一步,升级系统内核,目前最新内核:kernel-ml-6.1.12-1.el7.elrepo.x86_64.rpm

# 从网站:https://elrepo.org/linux/kernel/el7/x86_64/RPMS/ 下载内核
wget https://elrepo.org/linux/kernel/el7/x86_64/RPMS/kernel-ml-6.1.12-1.el7.elrepo.x86_64.rpm

# 安装
rpm -ivh kernel-ml-6.1.12-1.el7.elrepo.x86_64.rpm

# 设置默认
grub2-set-default 0
# yum search vm-tools
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * elrepo: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
elrepo                                                                                                            | 3.0 kB  00:00:00     
elrepo/primary_db                                                                                                 | 396 kB  00:00:00     
========================================================= N/S matched: vm-tools =========================================================
open-vm-tools.x86_64 : Open Virtual Machine Tools for virtual machines hosted on VMware
open-vm-tools-desktop.x86_64 : User experience components for Open Virtual Machine Tools
open-vm-tools-devel.x86_64 : Development libraries for Open Virtual Machine Tools
open-vm-tools-test.x86_64 : Test utilities for Open Virtual Machine Tools
qemu-kvm-tools.x86_64 : KVM debugging and diagnostics tools

  名称和简介匹配 only,使用“search all”试试。

# yum install open-vm-tools
# vmware-hgfsclient
sharedir
# mkdir /mnt/hgfs/
# vmhgfs-fuse .host:/sharedir /mnt/hgfs
# cp /etc/fstab /etc/fstab.bak
##### /etc/fstab 中添加一行
.host:/sharedir /mnt/hgfs fuse.vmhgfs-fuse allow_other,defaults 0 0

# reboot

注意:不需要安装vmware-tools,vmware-tools不兼容kernel,无法配置目录共享

This entry was posted in 小技巧. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.