2010-08-10 21:41
環境:
Hyper-V: 6.1.7600
ubuntu server 10.04.1 64 bit
於Hyper-V環境安裝 ubuntu server 過程中,出現下面找不到網卡的警示畫面,
雖然按「繼續」可以繼續進行安中過程,但安裝完畢後,執行 ifconfig 指令,只看見 loopback 虛擬網卡,
不到 eth0 網卡,所以此時 ubuntu 也無法與 internet 連結。
在網路上找了一些前人的說明,都不是很完整,所以順手把調整步驟整理如下:
- ubuntu 啟用 Hyper-V 網卡模組支援
編輯 /etc/initramfs-tools/modules
sudo vi /etc/initramfs-tools/modules
加入下列四行後,存檔
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc
執行
sudo update-initramfs – u
- 設定網卡參數,使用 static ipaddress
編輯 /etc/network/interface
sudo vi /etc/network/interface
加入下列 eth0 網卡設定參數,存檔
auto eth0
iface seth0 inet static
address xxx.xxx.xxx.xxx <-- 你的主機要使用的 ip address
netmask 255.255.255.0 <-- 此網段的subnet mask
network xxx.xxx.xxx.0
broadcast xxx.xxx.xxx.255
gateway xxx.xxx.xxx.yyy <-- 此網段的default gateway
- 重開機
sudo reboot
- 設定 DNS
編輯 /etc/resolv.conf
sudo vi /etc/resolv.conf
加入(或調整) nameserver ip address設定行
nameserver xxx.yyy.www.zzz
存檔
- 移除DHCP client
sudo apt-get remove dhcp-client
- 重新啟用網卡及確認
執行
sudo /etc/init.d/networking restart
重新啟動網卡
執行 ping 確認網路及DNS正常
參考資料:
Hyper-V Linuv integration
Hyper-V Guest instructions for ubuntu
Ubuntu Server 10.4 in Hyper-V
Change Ubuntu Server from DHCP to a Static IP Address