網頁

2008年12月25日 星期四

Install Virtual Machine Additions for Fedora Linux

在 Microsoft Virtual Server 2005 R2 上安裝好 fedora 10 之後,就來裝 Virtual Machine Additions for Linux

How to install Virtual Machine Additions for Linux in Fedora 10


1. You should install kernel-devel (kernel source), make, gcc
你需要安裝 kernel-devel (kernel source), make, gcc
root# yum -y install kernel-devel, make, gcc

2. Download the Virtual Machine Additions for Linux

3. Install vmadd-full-RHEL-2.0-1.i386.rpm
安裝 vmadd-full-RHEL-2.0-1.i386.rpm
root# rpm -ivh vmadd-full-RHEL-2.0-1.i386.rpm

4. You can check /var/log/vmadd-install.log after install.
裝完可以查看 /var/log/vmadd-install.log

*** VM additions kernel module ***
make: Entering directory `/lib/modules/vmadd/module'
make -C /lib/modules/2.6.27.7-134.fc10.i686/build modules SUBDIRS=/lib/modules/vmadd/module M=/lib/modules/vmadd/module
make[1]: Entering directory `/usr/src/kernels/2.6.27.7-134.fc10.i686'
CC [M] /lib/modules/vmadd/module/vpc-mod.o
/lib/modules/vmadd/module/vpc-mod.c:120: error: variable ‘vpc_fops’ has initializer but incomplete type
... delete lots of warnings/errors ...
make[2]: *** [/lib/modules/vmadd/module/vpc-mod.o] Error 1
make[1]: *** [_module_/lib/modules/vmadd/module] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.27.7-134.fc10.i686'
make: *** [vmadd-build-module] Error 2
make: Leaving directory `/lib/modules/vmadd/module'
Could not build kernel module


5. Patch the vmadd source
修改 vmadd source

root# cd /lib/modules/vmadd/module/

Modify vpc-mod.c
修改 vpc-mod.c

Add #include <linux/fs.h>, before the following source 
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/interrupt.h>

=== Patched version ===
#include <linux/fs.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
...

Modify vpc-utils.c, at line 105
修改 vpc-utils.c 第 105 行處

vpc-utils.c
line 105: "ebx", "ecx", "edx", "esi", "edi" , "ebp"
delete the chars in red including the ","
刪除紅字部分,包括逗號

6. reinstall vmadd
再安裝 vmadd

root# make
root# make vmadd-install-module
root# depmod

If you enable SELinux, then you should ...
root# chcon system_u:object_r:modules_object_t:s0 /lib/modules/`uname -r`/misc
root@# chcon system_u:object_r:modules_object_t:s0 /lib/modules/`uname -r`/misc/vmadd.ko

7. load vmadd modules
root# /etc/rc.d/init.d/vmadd start
Starting VM additions [ OK ]
root# /etc/rc.d/init.d/vmadd-heartbeat start
Starting heartbeat [ OK ]
root# /etc/rc.d/init.d/vmadd-timesync start
Starting timesync [ OK ]
root# /etc/rc.d/init.d/vmadd-shutdown start
Starting shutdown [ OK ]

以上的東西當然不是我想出來的,是在一個日本網站上找到的。
我的日文很好嗎?當然不是,是股溝大師的翻譯功能還不錯。

沒有留言: