In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
File sharing between physical and virtual machines through VMware Tools. However, CentOS 7 may encounter some problems installing (or updating) VMware Tools, requiring manual modification of the source files and packaging, and reinstalling.
environment briefing
Environment Version Physical machine Windows 10 VMware Workstation 12 Pro, version 12.5.2 build-4638234CentOS 7kernel-3.10.0-514.21.1.el7.x86_64
Check VMware Tools
Check if VMware Tools is installed, and if so, skip to step 4 to configure shared folders.
Click Menu Virtual Machine
If updated VMware Tools appears in the drop-down list as shown below, it means that it has been installed (but this does not mean that the shared folder can be configured successfully. If the VMware default shared directory/mnt/hgfs/does not exist at this time, it basically means that it needs to be reinstalled). You can skip the installation step temporarily.
If Install VMware Tools appears, click Install
Install VMware Tools
After clicking Install VMware Tools or Update VMware Tools, CentOS will automatically mount VMware Tools, double-click Open, copy VMwareTools-X.tar.gz to desktop
Open Terminal on desktop and extract tar.gz package
The copy code is as follows:
[hadoop@centos7-2 Desktop]$ tar -xzvf VMwareTools-10.0.10-4301679.tar.gz
Enter the extracted vmware-tools-distrib directory and start the installation (you need to be root). If you encounter information that needs to be entered during the process, enter all the way down and use the default settings.
[hadoop@centos7-2 vmware-tools-distrib]$ sudo ./ vmware-install.pl
The installation process may not go smoothly, such as the following errors
Using kernel build system.make: Entering directory `/tmp/modconfig-yqRMXf/vmhgfs-only'/bin/make -C /lib/modules/3.10.0-514.21.1.el7.x86_64/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. \MODULEBUILDDIR= modulesmake[1]: Entering directory `/usr/src/kernels/3.10.0-514.21.1.el7.x86_64'CC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/message.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/dir.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/rpcout.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/filesystem.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/cpName.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/link.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/request.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/hgfsUtil.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/file.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/bdhandler.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/transport.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/module.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/super.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/stubs.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/fsutil.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/cpNameLinux.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/hgfsBd.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/backdoorGcc64.o/tmp/modconfig-yqRMXf/vmhgfs-only/backdoorGcc64.o: warning: objtool: BackdoorHbIn()+0xd: duplicate frame pointer save/tmp/modconfig-yqRMXf/vmhgfs-only/backdoorGcc64.o: warning: objtool: BackdoorHbOut()+0xd: duplicate frame pointer saveCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/page.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/backdoor.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/hgfsEscape.oCC [M] /tmp/modconfig-yqRMXf/vmhgfs-only/inode.o/tmp/modconfig-yqRMXf/vmhgfs-only/page.c: In function 'HgfsWbRequestWait':/tmp/modconfig-yqRMXf/vmhgfs-only/page.c:1649:23: warning: passing argument 3 of 'wait_on_bit' makes integer from pointer without a cast [enabled by default] TASK_UNINTERRUPTIBLE); ^In file included from include/linux/mmzone.h:9:0, from include/linux/gfp.h:5, from include/linux/mm.h:9, from include/linux/pagemap.h:7, from /tmp/modconfig-yqRMXf/vmhgfs-only/page.c:28:include/linux/wait.h:1044:1: note: expected 'unsigned int' but argument is of type 'int (*)(void *)'wait_on_bit(void *word, int bit, unsigned mode)^/tmp/modconfig-yqRMXf/vmhgfs-only/page.c:1649:23: error: too many arguments to function 'wait_on_bit' TASK_UNINTERRUPTIBLE); ^In file included from include/linux/mmzone.h:9:0, from include/linux/gfp.h:5, from include/linux/mm.h:9, from include/linux/pagemap.h:7, from /tmp/modconfig-yqRMXf/vmhgfs-only/page.c:28:include/linux/wait.h:1044:1: note: declared herewait_on_bit(void *word, int bit, unsigned mode)^make[2]: *** [/tmp/modconfig-yqRMXf/vmhgfs-only/page.o] Error 1make[2]: *** Waiting for unfinished jobs.... make[1]: *** [_module_/tmp/modconfig-yqRMXf/vmhgfs-only] Error 2make[1]: Leaving directory `/usr/src/kernels/3.10.0-514.21.1.el7.x86_64'make: *** [vmhgfs.ko] Error 2make: Leaving directory `/tmp/modconfig-yqRMXf/vmhgfs-only'
After checking online, you need to modify vmware-tools-distrib/lib/modules/source/vmhgfs-only/page.c
[hadoop@centos7-2 vmware-tools-distrib]$ cd lib/modules/source/[hadoop@centos7 -2 source]$ tar -xvf vmhgfs.tar [hadoop@centos7 -2 source]$ cd vmhgfs-only/[hadoop@centos7-2 vmhgfs-only]$ chmod 777 page.c #This file is read-only, change permissions here, just make it writable [hadoop@centos7-2 vmhgfs-only]$ vi page.c #Enter file editing mode:set number #Display line number: 1639 #Jump to line 1639, this line needs to be modified
In line 1639:
if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) changed to if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 10, 0)
Note: CentOS 7 kernel version is 3.10.0
After modification and preservation, re-archive
[hadoop@centos7-2 source]$ mv vmhgfs.tar vmhgfs.tar.bak[hadoop@centos7-2 source]$ tar -cvf vmhgfs.tar vmhgfs-only[hadoop@centos7-2 source]$ cd ../../.. [hadoop@centos7-2 vmware-tools-distrib]$ sudo ./ vmware-install.pl
After that, all the way to enter, and finally see the following message, indicating that the installation is successful
Creating a new initrd boot image for the kernel. Starting Virtual Printing daemon: doneStarting vmware-tools (via systemctl): [ OK ]The configuration of VMware Tools 10.0.10 build-4301679 for Linux for this running kernel completed successfully.Enjoy,--the VMware team
Restart CentOS
3. Configure shared folders
Open Virtual Machine Settings
Enter virtual machine settings
Enable shared folders and add directories that need to be shared on the physical machine
VMware default share path is/mnt/hgfs, which is written in VMware Tools script, we can find in/etc/init.d/vmware-tools:
vmhgfs_mnt="/mnt/hgfs"#Mount all hgfs filesystems" vmware_mount_vmhgfs() { if [ "`is_vmhgfs_mounted`" = "no" ]; then if [ "`vmware_vmhgfs_use_fuse`" = "yes" ]; then mkdir -p $vmhgfs_mnt vmware_exec_selinux "$vmdb_answer_BINDIR/vmhgfs-fuse \ -o subtype=vmhgfs-fuse,allow_other $vmhgfs_mnt" else vmware_exec_selinux "mount -t vmhgfs .host:/ $vmhgfs_mnt" fi fi }
At this point in CentOS 7, you can see the shared folders on the physical machine:
[hadoop@centos7-2 ~]$ ll /mnt/hgfs/dr-xr-xr-x. 1 root root 0 Jun 15 00:17 pc-share
The folder sharing setup between the physical machine and the virtual machine CentOS 7 is successful.
The above is all the content of this article, I hope to help everyone's study, but also hope that everyone a lot of support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.