目的:现在的后台debian hyper-v虚拟机,还是在使用旧版网络适配器,磁盘驱动也是默认的,LinuxIC又不支持debian,装不上,感觉总不舒服,虽然因为负载小,使用起来感觉不出来。准备升级kernel内核,2.6.32版本以上,安装上hyper-v驱动。经过几天试验,基本成功。
环境:debian 5.04 amd64,root权限
步骤:
1、更新源设置,增加backports:
sources.list内容,使用163源,速度非常快:
deb http://mirrors.163.com/debian-backport/ lenny-backports main contrib non-free
deb http://mirrors.163.com/debian lenny main non-free contrib
deb http://mirrors.163.com/debian lenny-proposed-updates main contrib non-free
deb http://mirrors.163.com/debian-security lenny/updates main contrib non-free
deb-src http://mirrors.163.com/debian lenny main non-free contrib
deb-src http://mirrors.163.com/debian lenny-proposed-updates main contrib non-free
deb-src http://mirrors.163.com/debian-security lenny/updates main contrib non-free
deb http://http.us.debian.org/debian lenny main contrib non-free
#deb http://non-us.debian.org/debian-non-US lenny/non-US main contrib non-free
deb http://security.debian.org lenny/updates main contrib non-free
apt-get install debian-backports-keyring
apt-get update
apt-get install build-essential ncurses-dev kernel-package 2、安装linux-source:
cd /usr/src
apt-get install linux-source-2.6.32
tar jxf linux-source-2.6.32.tar.bz2 3、配置、选择驱动、编译、安装
cd linux-source-2.6.32
#复制原来的config文件
cp /boot/config-`uname -r` ./.config
#配置,记得选择 device drivers -> staging drivers -> Microsoft hyper-v client drivers,把下面的三个驱动打上M标志
make menuconfig
#第一次编译可以不用clean
make-kpkg clean
#编译,binary-arch方式,生成的image及headers可以拷到其它机器使用
make-kpkg –append_to_version -hvsupport –revision rev.01 –initrd binary-arch
#生成 linux-image-2.6.32-hvsupport_rev.01_amd64.deb及linux-headers-2.6.32-hvsupport_rev.01_amd64.deb
cd ..
ls -l
#安装
dpkg -i *.deb
#加载驱动
echo -e “hv_vmbus\nhv_storvsc\nhv_blkvsc\nhv_netvsc” >> /etc/initramfs-tools/modules
#网卡
# sed -i ’s/eth/seth/g’ /etc/network/interfaces
#创建initramfs
update-initramfs -u -k 2.6.32-hvsupport
#重启,记得把旧版网卡删掉,加一块新的。
#halt
最新评论