在 VirtualBox 中设置 Ubuntu 并连接到 Windows 7 和互联网

在 VirtualBox 中设置 Ubuntu 并连接到 Windows 7 和互联网

我已经安装了最新的 VirtualBox 4.1.2 和 Ubuntu Server 11.04。

在尝试了网络设置后,我发现 eth1 和 eth2 没有配置 IP 地址。我想我以前有 eth0。

图像

网络读物:

Adapter 1: Intel PRO/1000 MT Desktop(Host-only adapter, "VirtualBox Host-Only Ethernet Adapter")  
Adapter 2: Intel Pro/1000 T Server (NAT)

我应该如何设置 VirtualBox 和 Ubuntu,以便能够以 Windows 7 的访客身份访问它?Ubuntu 还应该能够访问互联网。

答案1

首先在 VirtualBox 中为网卡设置 nat。这样您就可以通过主机 PC 访问互联网。如果我理解了您所说的“来宾”的意思(您希望能够通过 ssh 进入虚拟机,并以 Windows7 客户端的身份访问其服务器进程),那么您需要使用桥接网络。这将设置一个可用于在主机和来宾之间进行通信的网络。

为清楚起见,请将网卡设置为 nat,并确保您可以访问互联网。当一切正常时,关闭虚拟机,并将网卡 2 更改为使用桥接网络。ifconfig eth0 和 ifconfig eth1 应该会显示不同的网络。

相关内容