Install Linux Integration Service Pack on Hyper-V
First download the linux integration package
Mount the image to the specified partition:
Mount /dev/cdrom /media/cdrom
Copy the contents of the iso to the specified directory:
Mkdir /mnt/linux
Cp –R /media/cdrom/* /mnt/linux/
Cd / mnt / linux /
Make
Make install
Reboot
If it appears when make:
[root@localhost linux]# make
Building all modules...
make -C /lib/modules/2.6.18-194.el5/build SUBDIRS=/opt/linux/src modules
make: *** /lib/modules/2.6.18-194.el5/build: No such file or directory. stop.
make: *** [all] Error 2
Solution:
1. First, the compilation environment must be guaranteed to be good
Yum –y install gcc
2. Check if the file exists
Cd /lib/modules/2.6.18-194.el5/build
Ls –la
View post results
[root@localhost 2.6.18-194.el5]# ll
Total 1372
lrwxrwxrwx 1 root root 44 04-17 01:00 build -> ../../../usr/src/kernels/2.6.18-194.el5-i686
After reading it, you will find that there is no content under /usr/src/kernels/
For centos, the kernel source code is placed in the /usr/src/kernels directory; if you upgrade the kernel online, it is also placed in this directory; if there is no content in /usr/src/kernels/ in your system, it means There is no kernel source package kernel-devel package installed;
通过在线安装的内核源码包,内核源码会被放到/usr/src/kernel下的目录中,您要进入相对应的目录进行编译;在这里我直接用yum安装。yum -y install kernel
yum -y install kernel-devel
再进入/mnt/linux下make如果还是出现没有那个文件的报错,说明build还是有问题
3.重新链接文件
查看系统链接文件的名称:注意/module下的版本号
[root@localhost 2.6.18-194.el5]# ll
总计1368
lrwxrwxrwx 1 root root 41 04-17 08:52 build -> ../../../lib/modules/2.6.18-194.el5/build
查看新下载的
cd /usr/src/kernels/
[root@localhost kernels]# ls
2.6.18-348.3.1.el5.centos.plus-i686
会发现2个原有链接的文件和现有的是不符的,需要重新链接
ln -fs ../../../usr/src/kernels/2.6.18-348.3.1.el5.centos.plus-i686 build
完成后再进行make
Cd /mnt/linux/
Make
Make install
Reboot