功夫不负有心人啊,经过长久的摸索,终于为fedora系统安装vmware tools找到了一条最佳途径。
曾经,我找遍网络,找到了最专业最实际也曾经是最简单的办法为fedora(fedora 6以前版本叫fedora corelinux,7.0后就叫fedora linux)系统安装vmwaretools,具体如下:(如果大家已经了解这个方法或不想了解这个老方法可以跳过这节)
————————————————————————————————————————————————————————————————————
1,安装GCC开发工具
# Install software called by by VMware Tools
yum install gcc
2,安装内核文件
# Install kernel header files
yum install kernel-devel
3.检查内核文件的版本是否匹配,如果不匹配需要进行升级
# Check it matches the running kernel
uname -r # running kernel
rpm -q kernel-devel # installed kernel headers
4,第3不中如果不匹配,则需要升级内核文件,升级完后,重新启动系统
# It the two versions do not match, run
yum -y upgrade kernel kernel-devel
# then reboot (but only if they did not match).
5,查找内核文件的位置,安装VMware-tool工具时候需要(我装的时候,会自动查找到,不需要手工指定)
# Find out where the kernel headers are
ls -d /usr/src/kernels/$(uname -r)*/include
# You may need this later.
6,下载虚拟机工具安装包,即:VMware-tool安装包,并解压(具体就是在虚拟机工具栏上,点击"VM"->"Install VMware Tools",会出现安装包,选择*.gz的文件,解压到一个目录下就可以)
以下是命令行中具体实现方法,我是在图形界面下实现的
# If you already have VMwareTools-5.5.2-29772.tar.gz
on disk, SKIP THIS STEP!
# Download VMware-workstation-5.5.2-29772.tar.gz from vmware.com
# Extract the VMware Tools iso from it
tar --strip-components=3 -zxvf VMware-workstation-5.5.2-29772.tar.gz \
vmware-distrib/lib/isoimages/linux.iso
# Create a temporary mount point
mkdir /mnt/vmtools-temp
# Mount the image
mount -o loop linux.iso /mnt/vmtools-temp
# Copy VMware Tools from the mount
cp /mnt/vmtools-temp/VMwareTools-5.5.2-29772.tar.gz /tmp/
# Unmount the image and tidy up
umount /mnt/vmtools-temp
rmdir /mnt/vmtools-temp
rm linux.iso
# Unpack VMware Tools to a temporary directory
cd /tmp/
tar zxvf VMwareTools-5.5.2-29772.tar.gz
7.进入解压目标目录,执行以下代码,一路回车按下来
cd /tmp/vmware-tools-distrib/
./vmware-install.pl
8.直到该步骤,拷贝粘贴第5步的路径,然后一直按回车,直到选择屏幕分辨率。
What is the location of the directory of C header files that match your running
kernel? [/usr/src/kernels/2.6.18-1.2849.fc6-i686/include]
提示信息显示hgfs模块安装有问题,没关系,下一篇文章中解决。
9.到了该步骤,问你是否改变X-window的设置,选y,就可以改变分辨率。
Do you want to change your guest X resolution? (yes/no) [no] y
Please choose one of the following display sizes (1 - 13):
[1] "640x480"
[2]< "800x600"
[3] "1024x768"
[4] "1152x864"
[5] "1280x800"
[6] "1152x900"
[7] "128024"
[8] "137632"
[9] "140050"
[10] "1680x1050"
[11] "1600x1200"
[12] "1920x1200"
[13] "2364x1773"
Please enter a number between 1 and 13:
[3]
还不行呢,再跟着下边的走吧!
10,
I keep several Linux distributions running on VMware Workstation due tomy work. Unfortunately, due to recent changes in the Linux kernel, youcannot properly compile the vmhgfs driver on Fedora Core 6.Fortunately, I have a workaround until VMware releases a proper fix.
First, go to /usr/lib/vmware-tools/modules/source and unpack vmhgfs.tar like this:
******************ggggggggggg************************
tar -xf vmhgfs.tar
********************************************************
Now you should have a new directory called vmhgfs-only. You need to get the following patch to make it work:
vmhgfs-i_node-fix.patch(http://home.sztoltzteixeira.com/vmhgfs-i_node-fix.patch)
To apply it, simply run:
patch -p1 < /wherever/you/saved/it/vmhgfs-i_node-fix.patch
This will patch vmhgfs-only/driver.c to conform with the kernelchanges. Now you will have to repack it and reconfigure the VMwareTools. Simply run the following two commands:
tar -cf vmhgfs.tar vmhgfs-only
************************ggggggggggggggg*******************
run the command:
/usr/bin/vmware-config-tools.pl
**********************************************************
If all you want is to get the module compiled, you're all set. If youactually need to access a shared folder, then you should know that thisworkaround will not work while SELinux is enabled. If you want to usethe files, you will have to disable SELinux by going to System ->Administration -> Security Level and Firewall. You will have toreboot, but after that, everything should work fine.
One more thing. If your host is Windows, you may notice that the fileson the shared folders will appear as only accessible by root (they arein fact fully modifiable by everyone, but GNOME won't see it and thiscan be an annoyance.) If you want, the patch below will make all filesappear with proper permissions (all permissions for everyone.) Apply itusing the same steps used for the patch above.
vmhgfs-perm-fix.patch (http://home.sztoltzteixeira.com/vmhgfs-perm-fix.patch)
Now,all the ok.
-#define INODE_SET_II_P(inode, info) do { (inode)->u.generic_ip = (info); } while (0)
-#define INODE_GET_II_P(inode) ((HgfsInodeInfo *)(inode)->u.generic_ip)
+#define INODE_SET_II_P(inode, info) do { (inode)->i_private = (info); } while (0)
+#define INODE_GET_II_P(inode) ((HgfsInodeInfo *)(inode)->i_private)
/*
* 2.5.x kernels support nanoseconds timestamps.
@@ -760,7 +760,6 @@
inode->i_uid = 0; /* This is bogus, should be the mount owner. */
inode->i_gid = 0; /* This is bogus, should be the mount owner. */
inode->i_rdev = 0; /* Device nodes are not supported */
- inode->i_blksize = HGFS_BLOCKSIZE;
inode->i_blocks = (attr->size + HGFS_BLOCKSIZE - 1) / HGFS_BLOCKSIZE;
inode->i_size = attr->size;
HGFS_SET_TIME(inode->i_atime, attr->accessTime);
第五步:一路回车,选择默认的即可。 特别说明:在 What is the location of the directory of C header files that match your running 这一步时,系统会给你自动选择正确的文件夹位置,不用改了,直接回车。一般是/lib/modules/(版本号)/build/include