- 积分
- 23
- 鸿鹄币
- 个
- 好评度
- 点
- 精华
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 听众
- 收听
网络小学徒

|
作者:醉龙凌云
时间:2007.5.13
首发:中国虚拟化先锋网
说明:转载请注明所有信息
功夫不负有心人啊,经过长久的摸索,终于为fedora系统安装vmware tools找到了一条最佳途径。
曾经,我找遍网络,找到了最专业最实际也曾经是最简单的办法为fedora(fedora 6以前版本叫fedora core linux,7.0后就叫fedora linux)系统安装vmware tools,具体如下:(如果大家已经了解这个方法或不想了解这个老方法可以跳过这节)
————————————————————————————————————————————————————————————————————
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] Administration -> Security Level and Firewall. You will have to reboot, but after that, everything should work fine.
One more thing. If your host is Windows, you may notice that the files on the shared folders will appear as only accessible by root (they are in fact fully modifiable by everyone, but GNOME won't see it and this can be an annoyance.) If you want, the patch below will make all files appear with proper permissions (all permissions for everyone.) Apply it using the same steps used for the patch above.
vmhgfs-perm-fix.patch (http://home.sztoltzteixeira.com/vmhgfs-perm-fix.patch)
Now,all the ok.
下面是两个patch文件的内容:
1
diff -Naur vmhgfs-only/driver.c vmhgfs-only-new/driver.c
--- vmhgfs-only/driver.c 2006-08-04 14:25:52.000000000 -0300
+++ vmhgfs-only-new/driver.c 2006-10-28 15:26:14.000000000 -0300
@@ -41,8 +41,8 @@
#define HGFS_SB_TO_COMMON(sb) ((HgfsSuperInfo *)(sb)->s_fs_info)
#endif
-#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);
2
--- vmhgfs-only/driver.c 2006-10-28 15:26:14.000000000 -0300
+++ vmhgfs-only/driver.c-new 2006-10-28 15:34:07.000000000 -0300
@@ -755,7 +755,7 @@
/* Set the access mode. */
inode->i_mode &= ~S_IRWXUGO;
- inode->i_mode |= (attr->permissions i_mode |= attr->permissions * 0111; /* Only applies to owner. */
inode->i_nlink = 1; /* Bogus? */
inode->i_uid = 0; /* This is bogus, should be the mount owner. */
inode->i_gid = 0; /* This is bogus, should be the mount owner. */
最后修改xorg config设置,不然重启后会报X-WINDOWS出错。
进入/etc/X11/,用文本打开xorg.conf,加上以下几段:
1、Section "Monitor"
Identifier "vmware"
EndSection
Section "InputDevice"
Identifier "Mouse0"
Driver "vmmouse"
Option "Protocol" "Auto"
Option "Device" "/dev/input/mouse0"
EndSection
2、Section "Monitor"
Identifier "Monitor0"
ModelName "LCD Panel 1280x1024"
HorizSync 31.5 - 67.0
VertRefresh 50.0 - 75.0
Option "dpms"
EndSection
然后找到 含有"ServerLayout" 的section, 在Section跟EndSection之间加上以下一行。
InputDevice "Mouse0" "CorePointer"
————————————————————————————————-——————————————————————
呵呵,仔细算一下吧,一般安装好系统的话,总是可以在网上找到更新包的,所以进行前面几步更新的话,你需要一个可以联网的fedora,由于是连接到外国的服务器,又由于没有迅雷可以用, 所以:gcc安装更新的话,有16M之多,kernel-devel安装的话有60M的文件要下载,这个在网络好的情况下也大概要折腾整个白天吧。安装完了,还要修改配置,才能正常使用!累啊。 我可受不了的哦。
fedora这么优秀的系统就是为了方便我们的学习,方便我们的使用,方便我们的操作啊!为什么要这么复杂呢!
现在在fedora下安装vmware tools就改用下面的方法吧:
********************************************************************************************************
第一步
:为此客户机(GUEST OS)选择插入了此fedora系统的安装光盘的光驱。
第二步:启动此客户机,在图像模式下(图形模式比较方便,如果你喜欢在文本模式下操作只能说明你是高手哦)挂载光盘,打开/Media/disk/Fedora/RPM,也就是光盘里的fedora文件夹下的rpm文件夹,里面有kenel-devel-(版本号)-i586.RPM和一个i686的RPM文件,根据你的系统选择一个,安装就可以了。然后弹出光盘。(i386、i586、i686指的是适用于intel i386、 i586、i686 兼容指令集的微处理器。一般来说,等级愈高的机器可接受较低等级的rpm文件。你可以透过/proc/cpuinfo这个档案查询你的CPU等级。)
这一步是核心,这一步就代替了老方法的前7部,就给你省了整个白天的时间。 |
|