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 > Development >
Share
Shulou(Shulou.com)05/31 Report--
Today, I would like to share with you the relevant knowledge points about how to set up folder sharing in CentOS 7 in VMware. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
The file sharing between physical machine and virtual machine is realized through vmware tools. However, centos 7 may encounter some problems when installing (or updating) vmware tools, which requires manual modification of the source file, packaging and reinstallation.
Environment description
Environment version physical machine windows 10vmwarevmware workstation 12 pro, version 12.5.2 build-4638234centos 7kernel-3.10.0-514.21.1.el7.x86_64
1. Check vmware tools
Check to see if vmware tools is installed, and if so, skip to step 4 to configure the shared folder.
Click menu virtual machine
If the updated vmware tools shown in the following figure appears in the drop-down list, it is installed (but this does not mean that the shared folder can be successfully configured, and if the vmware default shared directory / mnt/hgfs/ does not exist at this time, it basically means that it needs to be reinstalled), and you can skip the installation step temporarily.
If the installation vmware tools appears, click install directly
2. Install vmware tools
After clicking to install vmwaretools or update vmwaretools, centos will automatically mount vmwaretools, double-click to open it, and copy the vmwaretools-x.tar.gz inside to the desktop.
Open the terminal on the desktop and extract the 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 have a root identity). If you need to enter information in the process, enter all the way and use the default setting.
[hadoop@centos7-2 vmware-tools-distrib] $sudo. / vmware-install.pl
The installation process may not go smoothly, such as the following error
Using kernel build system.make: entering directory `/ tmp/modconfig-yqrmxf/vmhgfs-only'/bin/make-c / lib/modules/3.10.0-514.21.1.el7.x86twin 64max buildbank. 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'
Checked on the Internet, vmware-tools-distrib/lib/modules/source/vmhgfs-only/page.c needs to be modified at this time.
[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, and the permissions are changed here Just make it writable [hadoop@centos7-2 vmhgfs-only] $vi page.c # enter file editing mode: set number # shows line number: 1639 # skip to line 1639, which needs to be modified
Put line 1639:
Change if linux_version_code > = kernel_version (3,19,0) to if linux_version_code > = kernel_version (3,10,0)
Description: because the kernel version of centos 7 is 3.10.0
After modifying and saving, 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, I went all the way back to the car and finally saw the following message, indicating that the installation was 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
The default share path of vmware is in / mnt/hgfs, which is written in the script of vmware tools, which can be found in / etc/init.d/vmware-tools:
Vmhgfs_mnt= "/ mnt/hgfs" # mount all hgfs filesystems "vmware_mount_vmhgfs () {if [" `vmware_vmhgfs_use_ 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 "mount-t vmhgfs .host: / $vmhgfs_mnt" fi fi}
At this point, you can see the folder shared on the physical machine in centos 7:
[hadoop@centos7-2] $ll / mnt/hgfs/dr-xr-xr-x. 1 root root 0 jun 15 00:17 pc-share is all the contents of this article "how to set up folder sharing in CentOS 7 in VMware". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
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.