How to make my VM connect to internet ?
Posted: 3. Apr 2013, 06:06
I install VirtualBox on my windows 7 home version PC, and I create a Linux 2.6 with CentOS 6.3.
I do the settings for network of VirtualBox Manager: VirtualBox Host-Only Ethernet Adapter as below
Adapter: IPv4 Address: 192.168.17.2
IPv4 Network Mask: 255.255.255.0
DHCP Server: Server Address: 192.168.17.226 (same as my windows 7 home host pc IP setting)
Server Mask: 255.255.255.0
Lower Address Bound: 192.168.17.101
Upper Address Bound: 192.168.17.254
And for my Linux VM network setting, I enable network adapter 1 and 2.
Adapter 1: attached to Bridged Adapter (Because my windows 7 laptop is using wireless connection to internet), Name (Intel(R) Centrino(R) Wireless-N 1030) (same as my windows 7 laptop wireless adapter), advanced: adapter Type - PCnet-FAST III (Am79C973), Promiscuous Mode: Deny, MAC Address: 080027523116, Cable connected check
Adapter 2: attached to Host-Only Adapter, name: virtualBox host-only Ethernet adapter, advanced: adapter type: intel PRO/1000 MT Desktop (82540EM), Promiscuous Mode: Deny, MAC Address: 0800279B4F25, Cable connected check
And from my windows 7 laptop network and sharing center, I found out another Unidentified network, VirtualBox Host-Only Network, so I click it go to its IPv4 properties to change its IP:
192.168.17.2, subnetmask: 255.255.255.0, Default gateway: 192.168.17.1, Preferred DNS server: 192.168.17.1
After all the above setting is done, I run my Linux VM, and type ifconfig, the IP for lo still show 127.0.0.1, how to check whether my VM can connect to internet use command ? Is my setting all correct ?
I do the settings for network of VirtualBox Manager: VirtualBox Host-Only Ethernet Adapter as below
Adapter: IPv4 Address: 192.168.17.2
IPv4 Network Mask: 255.255.255.0
DHCP Server: Server Address: 192.168.17.226 (same as my windows 7 home host pc IP setting)
Server Mask: 255.255.255.0
Lower Address Bound: 192.168.17.101
Upper Address Bound: 192.168.17.254
And for my Linux VM network setting, I enable network adapter 1 and 2.
Adapter 1: attached to Bridged Adapter (Because my windows 7 laptop is using wireless connection to internet), Name (Intel(R) Centrino(R) Wireless-N 1030) (same as my windows 7 laptop wireless adapter), advanced: adapter Type - PCnet-FAST III (Am79C973), Promiscuous Mode: Deny, MAC Address: 080027523116, Cable connected check
Adapter 2: attached to Host-Only Adapter, name: virtualBox host-only Ethernet adapter, advanced: adapter type: intel PRO/1000 MT Desktop (82540EM), Promiscuous Mode: Deny, MAC Address: 0800279B4F25, Cable connected check
And from my windows 7 laptop network and sharing center, I found out another Unidentified network, VirtualBox Host-Only Network, so I click it go to its IPv4 properties to change its IP:
192.168.17.2, subnetmask: 255.255.255.0, Default gateway: 192.168.17.1, Preferred DNS server: 192.168.17.1
After all the above setting is done, I run my Linux VM, and type ifconfig, the IP for lo still show 127.0.0.1, how to check whether my VM can connect to internet use command ? Is my setting all correct ?