Ubuntu 7.04下Virtualbox安装及网络桥接

豆豆网   技术应用频道   2007年08月20日  【字号: 收藏本文

内容摘要:Ubuntu 7.04下Virtualbox安装及网络桥接

  auto br0

  iface br0 inet dhcp

  bridge_ports all tap0

  在这里你可以根据自己的网络状况做相应的更改,你可以使网络桥使用静态 IP:

  iface br0 inet static

  address 192.168.1.2

  netmask 255.255.255.0

  network 192.168.1.0

  broadcast 192.168.1.255

  gateway 192.168.1.1

  5. 让 virtualbox 使用这个虚拟网络接口,启动 virtualbox,在主界面上选中要使用刚才建立的虚拟网络接口tap0的虚拟机,点“设置”,在弹出的窗口中选“网络”,选中其中一块网卡(通常为 “网络适配器 0”),选中“启用网络适配器”,“连接到”后面选 "Host Interface",选中“接入网线”,然后在“主机网络界面名称”中填入刚才建立的虚拟网络接口的名字 "tap0",确定。同样的你也可以使用 VBoxManage 的命令行工具(将 "My VM" 换成你的虚拟机名字 ):

  VBoxManage modifyvm "My VM" -hostifdev1 tap0

  最后,配置主机和虚拟机的网络,使主机和虚拟机在同一个网段,这样主机和虚拟机就成了局域网中地位相同的两台机器了,可以互相访问了。

  三、撤销网络桥

  1. 禁用网桥和虚拟网卡:

  sudo /sbin/ifdown br0

  sudo /sbin/ifdown tap0

  2. 将前面修改的 /etc/network/interfaces 文件还原。

  Debian 和 Ubuntu 下 virtualbox 桥接设置原文:

  6.5.1.1 Debian and Ubuntu hosts

  To set up a permanent host interface on a Debian or Ubuntu host, follow these steps:

  1. On modern Debian and Ubuntu based hosts, you must first install the UserMode Linux utilities package (uml-utilities), which contains tools to create TAP interfaces, as well as the bridge utilities (bridge-utils). package. You can do this from the command line using

责编:豆豆技术应用

正在加载评论...