如何在Hyper-V中安装和配置Ubuntu Server (11.04和10.10)

背景

Ubuntu Linux已经发布了11.04版本,目前能够在Windows Hyper-V中高效运行的Ubuntu已经有2个release了(11.04和10.10)。由于Ubuntu Server的内核中已经编译了Hype-V IC的模块,因此只需要在经过简单的配置,使kernel在启动时加载Hyper-V IC module就可以高效运行了。

下载安装介质

Ubuntu Linux的11.04和10.10,只有Server版中才包括Hyper-V IC的模块,因此需要下载Ubuntu Server版的安装ISO:
https://releases.ubuntu.com/11.04/ubuntu-11.04-server-amd64.iso
https://releases.ubuntu.com/10.10/ubuntu-10.10-server-amd64.iso

安装过程

1. 在Hyper-V中为安装Ubuntu Server建立VM,1-4个CPU,内存512MB以上,网卡,设置从已下载的Ubuntu安装ISO启动
2. 安装正常步骤安装Ubuntu Server
3. 安装结束后在编辑Ubuntu Server中的文件/etc/initramfs-tools/modules,在文件末尾添加配置行:
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc
4. 运行update-initramfs,并reboot系统
# update-initramfs –u
# reboot
5. Ubunut再次启动后已经是Hyper-V IC生效(enable)了,可以使用lsmod命令进行验证:
# lsmod | grep hv_vmbus
hv_vmbus               50431  4 hv_utils,hv_netvsc,hv_blkvsc,hv_storvsc

参考文档:
https://blogs.msdn.com/b/virtual_pc_guy/archive/2010/10/21/installing-ubuntu-server-10-10-on-hyper-v.aspx
https://www.panterlo.com/2010/10/10/ubuntu-10-10-and-hyper-v-r2/