在Hyper-V中安装和配置Ubuntu网络
2014-02-20 21:48
316 查看
http://www.abcde.cn/knowledgebase/845/Hyper-VUbuntu.html
(文中的nameserver要改成自己路由器的IP:我的是192.168.2.1。)
安装过程
1. 在Hyper-V中为安装Ubuntu,安装正常步骤安装Ubuntu Server
2. 安装结束后在编辑Ubuntu 中的文件
#sudo vi /etc/initramfs-tools/modules,在文件末尾添加配置行:
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc
3. 运行update-initramfs,并reboot系统
# update-initramfs –u
# reboot
4. Ubunut再次启动后已经是Hyper-V IC生效(enable)了,可以使用lsmod命令进行验证:
# lsmod | grep hv_vmbus
hv_vmbus 50431 4 hv_utils,hv_netvsc,hv_blkvsc,hv_storvsc
5.设置IP、网关、掩码等。
sudo vi /etc/network/interfaces,添加以下内容:
使用静态IP(推荐):
iface eth0 inet static
address 192.168.2.200
netmask 255.255.255.0
gateway 192.168.2.1
auto eth0
使用DHCP:
auto eth0
iface eth0 inet dhcp
6.添加DNS:
vi /etc/resolv.conf(可能要新建),添加以下内容:
# 添加域名服务器
nameserver 192.168.2.1
/etc/resolv.conf重启后会重新生成,之前的修改会丢失,所以
#sudo vi /etc/resolvconf/resolv.conf.d/tail
然后在这个文件里添加的DNS,格式与以前的/etc/resolv.conf文件一致:
nameserver 192.168.2.1
然后输入wq保存退出,并重启下resolvconf让配置生效:
#/etc/init.d/resolvconf restart
7.重新启动网络:
#sudo /etc/init.d/networking restart
这步如果报错,
RTNETLINK answers: File exists
Failed to bring up ethX
可能需要先执行:
#sudo iptables-save
另外还需要注意网络配置,可以在右上角的网络配置中修改,推荐使用静态IP配置
(文中的nameserver要改成自己路由器的IP:我的是192.168.2.1。)
安装过程
1. 在Hyper-V中为安装Ubuntu,安装正常步骤安装Ubuntu Server
2. 安装结束后在编辑Ubuntu 中的文件
#sudo vi /etc/initramfs-tools/modules,在文件末尾添加配置行:
hv_vmbus
hv_storvsc
hv_blkvsc
hv_netvsc
3. 运行update-initramfs,并reboot系统
# update-initramfs –u
# reboot
4. Ubunut再次启动后已经是Hyper-V IC生效(enable)了,可以使用lsmod命令进行验证:
# lsmod | grep hv_vmbus
hv_vmbus 50431 4 hv_utils,hv_netvsc,hv_blkvsc,hv_storvsc
5.设置IP、网关、掩码等。
sudo vi /etc/network/interfaces,添加以下内容:
使用静态IP(推荐):
iface eth0 inet static
address 192.168.2.200
netmask 255.255.255.0
gateway 192.168.2.1
auto eth0
使用DHCP:
auto eth0
iface eth0 inet dhcp
6.添加DNS:
vi /etc/resolv.conf(可能要新建),添加以下内容:
# 添加域名服务器
nameserver 192.168.2.1
/etc/resolv.conf重启后会重新生成,之前的修改会丢失,所以
#sudo vi /etc/resolvconf/resolv.conf.d/tail
然后在这个文件里添加的DNS,格式与以前的/etc/resolv.conf文件一致:
nameserver 192.168.2.1
然后输入wq保存退出,并重启下resolvconf让配置生效:
#/etc/init.d/resolvconf restart
7.重新启动网络:
#sudo /etc/init.d/networking restart
这步如果报错,
RTNETLINK answers: File exists
Failed to bring up ethX
可能需要先执行:
#sudo iptables-save
另外还需要注意网络配置,可以在右上角的网络配置中修改,推荐使用静态IP配置
相关文章推荐
- 使用Hyper-V安装Ubuntu16.04 Server 网络配置
- 在Hyper-V中安装和配置Ubuntu网络
- 服务器DELL-R720安装Ubuntu14.04系统与配置网络
- Ubuntu安装的flask上做一个简单的网络配置
- Ubuntu安装配置Charles,抓取http网络请求包
- ubuntu 安装初配 双网卡 网络配置
- 在 Hyper-V 上配置 Ubuntu 虚机的网络
- 在VirtualBox中安装Ubuntu 8.04 Server(3,配置本机网络)
- Win7 VMware安装ubuntu网络配置联网
- ubuntu下使用qemu安装虚拟机并配置桥接网络
- 在 Hyper-V 上配置 Ubuntu 虚机的网络
- hyper-v Centos安装后网络配置及Nginx安装详细过程
- 关于虚拟机安装Ubuntu10.04 server 网络配置的问题
- (超详细)Ubuntu 10.10 图形安装教程、网络设置、软件源、基本配置
- Ubuntu 开通root权限、配置网络、安装ssh
- Ubuntu 10.10 图形安装教程、网络设置、软件源、基本配置(转)
- OpenStack之安装4网卡ubuntu-14.04及网络详细配置
- ubuntu下使用qemu安装虚拟机并配置桥接网络
- ubuntu下配置pxe启动网络安装系统(pxe+dhcp+tftp+nfs)