设为首页 收藏本站
查看: 1333|回复: 0

[经验分享] VirtualBox中linux和windows建立桥接

[复制链接]

尚未签到

发表于 2016-1-11 07:11:53 | 显示全部楼层 |阅读模式
  在windowsxp下用virtualbox安装ubuntu8.04后,默认的是NAT连接方式,不需要做任何更改就可以上网,但是这种方式很不灵活,你无法像访问局域网中的其他主机一样访问linux,为此,可以建立桥接,让你的windows xp和linux在网络中具有同等的地位。

具体方式步骤如下:(下面是在ubuntu论坛上的文章设置方法)

The installation of VBox, creation of the guest and installation ofDebian Etch was done in the normal fashion. Once that was completed Ifollowed the following steps to setup networking.

以正常方式完成VBox的安装,Guest系统的创建以及Debian的安装之后,按照以下步骤来设置网络

I. Create Network Connection in VBox
1.  Network;à SettingsàOpen VBox¬¬
2. Click on “Attached to” and then select “Host Interfaces”;
3. In Host Interfaces click Add;
4. Type "VirtualBox Host Interface #" without the quotation marks wherethe # represents a number for the interface, usually 1 (on one computerthe name of the virtual box host interface appeared automatically, onthe other computer I had to type the information);
5. Click OK, and
6. Close VBox
在虚拟机中创建网络连接

1.      虚拟主机设置 -〉网络 –〉网络连接方式

2.      选择“Host Interface”

3.      在Host Interface 点击“添加”

4.      输入“VirtuakBox Host Interface #”(注:不输入引号,#号代表接口的数字,通常为1)

5.      点击OK

6.      关闭虚拟主机设置

II. Create a Network Bridge
Network Connections;à1. Open Control Panel
2. While holding down Ctrl select the Local Area connection and click on the VirtualBox Host Interface;
3. Right click on one of the selected connections; and
4. From the drop-down menu select Create Network Bridge
II.创建一个网桥

1.    打开控制面板-〉网络连接

2.    按下“Ctrl”键的同时选择“本地连接”和“VirtualBox Host Interface”

3.    在其中一个选择的连接上,点右键

4.    从下拉菜单里选择,创建网桥

Since I am using static IP’s on my network set up I had to configure the TCP/IP properties for the Network Bridge.
注:由于我的网络使用的是静态IP设置,因此必须配置网桥的TCP/IP属性
5. Right click on the Network Bridge that was just created;
6. Select TCP/IP;
7. Click on Properties;
8. Set the Static Connection Values; and
9. Close Network Connection.

5.    在刚刚创建的网桥上右击,选择属性

6.    选择TCP/IP

7.    点击属性

8.    设置静态IP地址的值

9.    关闭网络连接

III. Set Network Adapters to promiscuous mode
III.设置网卡为混杂模式
When VBox and the guest VM load Windows XP should put the networkadapters into promiscuous mode, but sometimes this does not happen.Therefore, I think it is best to force the adapters into promiscuousmode. It is only necessary to do this once.
当VBOX和VM主机载入后,XP应该自动使网卡处于混杂模式,但有时候并未实现。因此,最好手工强制网卡处于混杂模式。只需按以下步骤操作。

1.      Open a Run and type "CMD" without the quotes and pressàWindows command prompt (Start ENTER;

2.       Type "netsh bridge show adapter";

3. There will be a line of information displayed for each networkadapter in the Bridge. Look for any adapter that is listed as disabled,note the number of the adapter and go to step four.

4. Type "netsh bridge set adapter # forcecompatmode=enable" for eachadapter that was listed as disabled, inserting the number of theadapter for the #;

5.      Type "netsh bridge show adapter" once again to check to see if your adapters have been enabled;

6.      Exit the command prompt; and

7.       Reboot the computer.  

1.        开始 –〉运行 –〉输入”CMD”

2.        输入“netsh bridge show adapter”

3.        网桥中的每张网卡会有一行信息显示。注意显示为“未应用”的每张网卡,记下网卡的数值然后看第4步

4.        输入“netsh bridge set adapter # forcecompatmode=enable”为每张显示为未应用的网卡,输入相应的网卡号,并运行一遍命令

III. Configure the TCP/IP Properties for the Debian guest

为VM客户机操作系统配置TCP/IP属性
Again, this is necessary because I am using static IP's in my LAN.
同样,这是必须的,应为我的LAN使用静态IP

1.      Open VBox;

2.       Start Debian;

3.       Since I have installed GNOME Networking;àAdministrationàdesktop I will open   Networking by clicking Desktop

4.       Select Ethernet Connection eth0;

5.       Click on Properties;

6.       Set the static configuration for the Debian VM;

7.       Close Networking; and

8.       Reboot Debian.

1.      打开虚拟机

2.      启动Debian

3.      由于我安装可Gnome,我将通过桌面打开网络

4.      选择网络连接eth0

5.      点击属性

6.      设置静态IP地址

7.      关闭网络

8.      重起Debian

After Debian has rebooted LAN connections with the host and any other computers

on the network should have been established.

Debian重起之后,虚拟主机与LAN里其他计算机的网络连接就建立了。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-162726-1-1.html 上篇帖子: Oracle VM VirtualBox 虚拟机设置全屏与共享 下篇帖子: VirtualBox主机和虚拟机之间怎样实现文件共享
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表