Virtualbox took over pc's hostname problem

Discussions related to using VirtualBox on Windows hosts.
Post Reply
jonrick
Posts: 6
Joined: 6. Sep 2014, 20:27

Virtualbox took over pc's hostname problem

Post by jonrick »

I have virtualbox v4.3.12 installed in laptop with windows 7. The laptop has name PC-A and I assigned my wifi network adapter with static ip address 192.168.1.121. Then I also have other laptop with name PC-B. The PC-B's wifi adapter has been assigned with static IP: 192.168.1.122.

If I ping PC-A before I installed virtual box, I will get result:

Code: Select all

Reply from 192.168.1.121: bytes=32 ...
Reply from 192.168.1.121: bytes=32 ...
...
but now instead I got result:

Code: Select all

Reply from 192.168.56.1: bytes=32 ...
Reply from 192.168.56.1: bytes=32 ...
...
Same thing happened if I ping PC-B.

As far I know, 192.168.56.1 is virtualbox's ip address.


So how do I make the PC-A and PC-B to resolve to original ip address?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Virtualbox took over pc's hostname problem

Post by Perryg »

You would need to use bridged instead of host-only
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Virtualbox took over pc's hostname problem

Post by BillG »

Actually 192.168.56.1 is the host's IP address, not the guest's. It is the IP address of the host only interface of the host. If you have a guest using host only, its IP address will be 192.168.56.x and it will connect to the host using the host's host only interface with IP address 192.168.56.1 .

Do you actually need to use host only? If you do not, disable the host only adapter in the host machine (from Network and Sharing Center in Windows). The only IP address on the host will then be 192.168.1.121

You will need to use bridged networking if you want to be able to connect to the vm from PC-B.
Bill
jonrick
Posts: 6
Joined: 6. Sep 2014, 20:27

Re: Virtualbox took over pc's hostname problem

Post by jonrick »

BillG wrote:Actually 192.168.56.1 is the host's IP address, not the guest's. It is the IP address of the host only interface of the host. If you have a guest using host only, its IP address will be 192.168.56.x and it will connect to the host using the host's host only interface with IP address 192.168.56.1 .
What is the meaning of "host only interface of the host"? I don't really get it.
BillG wrote: Do you actually need to use host only? If you do not, disable the host only adapter in the host machine (from Network and Sharing Center in Windows). The only IP address on the host will then be 192.168.1.121

You will need to use bridged networking if you want to be able to connect to the vm from PC-B.
Did you mean disable the "VirtualBox Host-Only Network" adapter? What is the impact of doing this?

The guest OS is in PC-A, and I don't have a need of PC-B or external device to access the guest OS in PC-A. So is it okay to disable it?
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Virtualbox took over pc's hostname problem

Post by BillG »

I explained what it was and what it was used for. What more is there to say? You can read the manual if you cannot work out what I was saying.

Yes, it is safe to disable the host only adapter on the host if you do not need it. In fact you do not even need to install it if you don't need it. There is an option in the installation procedure for VirtualBox for this.
Bill
jonrick
Posts: 6
Joined: 6. Sep 2014, 20:27

Re: Virtualbox took over pc's hostname problem

Post by jonrick »

If 192.168.56.1 is host's address which in my case the host is PC-A, then why if I ping other machine like "PC-B" which is neither host or guest in my case has ip address become 192.168.56.1 ?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Virtualbox took over pc's hostname problem

Post by Perryg »

jonrick wrote:If 192.168.56.1 is host's address which in my case the host is PC-A, then why if I ping other machine like "PC-B" which is neither host or guest in my case has ip address become 192.168.56.1 ?
jomrick,

In a command window on the host type the following and post the results here:

Code: Select all

ipconfig /all
jonrick
Posts: 6
Joined: 6. Sep 2014, 20:27

Re: Virtualbox took over pc's hostname problem

Post by jonrick »

Here:

Code: Select all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : pc-a
   Primary Dns Suffix  . . . . . . . : 
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No

Wireless LAN adapter Wireless Network Connection 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter #2
   Physical Address. . . . . . . . . : 60-36-DD-60-08-89
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Ethernet adapter Local Area Connection:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Realtek PCIe GBE Family Controller
   Physical Address. . . . . . . . . : 3C-97-0E-8E-16-34
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Wireless Network Connection 2:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Microsoft Virtual WiFi Miniport Adapter
   Physical Address. . . . . . . . . : 60-36-DD-60-08-89
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes

Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Intel(R) Centrino(R) Wireless-N 2230
   Physical Address. . . . . . . . . : 60-36-DD-60-08-88
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::602f:c78:514a:857e%13(Preferred) 
   IPv4 Address. . . . . . . . . . . : 192.168.1.121(Preferred) 
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.1.1
   DHCPv6 IAID . . . . . . . . . . . : 291518173
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-4C-C8-D8-60-36-DD-60-08-88
   DNS Servers . . . . . . . . . . . : 8.8.8.8
                                       8.8.4.4
   NetBIOS over Tcpip. . . . . . . . : Enabled

Ethernet adapter VirtualBox Host-Only Network:

   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
   Physical Address. . . . . . . . . : 08-00-27-00-08-ED
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::5012:fcd5:6778:e168%22(Preferred) 
   IPv4 Address. . . . . . . . . . . : 192.168.56.1(Preferred) 
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 
   DHCPv6 IAID . . . . . . . . . . . : 738721831
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-4C-C8-D8-60-36-DD-60-08-88
   DNS Servers . . . . . . . . . . . : fec0:0:0:ffff::1%1
                                       fec0:0:0:ffff::2%1
                                       fec0:0:0:ffff::3%1
   NetBIOS over Tcpip. . . . . . . . : Enabled

Tunnel adapter isatap.{06F08902-32D6-49D4-AFF7-EFBFB1289466}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{6F8A8808-8821-44FC-BED6-A17046017437}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #2
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Teredo Tunneling Pseudo-Interface
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{E157AE0A-4F15-4BC3-B9E1-9F0415AC71AC}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #3
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes

Tunnel adapter isatap.{212C6E17-C45B-4ACC-A813-DEAFFDBFF272}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . : 
   Description . . . . . . . . . . . : Microsoft ISATAP Adapter #5
   Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Virtualbox took over pc's hostname problem

Post by Perryg »

  • IPv4 Address. . . . . . . . . . . : 192.168.1.121(Preferred) LAN
    IPv4 Address. . . . . . . . . . . : 192.168.56.1(Preferred) Host-Only
As you can see you have two addresses. Your LAN address is 192.168.1.121 where you would talk to the rest of your network. The host-only is for the host and guest *only*
If you want the guest to be included in your LAN it *must* have the same address scheme and for that you would need to use Bridged.
jonrick
Posts: 6
Joined: 6. Sep 2014, 20:27

Re: Virtualbox took over pc's hostname problem

Post by jonrick »

Perryg wrote:
  • IPv4 Address. . . . . . . . . . . : 192.168.1.121(Preferred) LAN
    IPv4 Address. . . . . . . . . . . : 192.168.56.1(Preferred) Host-Only
As you can see you have two addresses. Your LAN address is 192.168.1.121 where you would talk to the rest of your network. The host-only is for the host and guest *only*
If you want the guest to be included in your LAN it *must* have the same address scheme and for that you would need to use Bridged.
So for the case of "PC-A", if I ping "PC-A" from inside PC-A itself, I got 192.168.56.1 because of the host-only adapter is active. But I don't get how the "PC-B" name can be turned into "192.168.56.1" as well when I pinged it, while the reality is PC-B is 192.168.1.122 and it is an external machine that connected to WLAN (wireless lan) through a router.

Btw, I forget to tell you all that PC-B is windows XP machine. I accessed the PC-B for its sharing folder. In Windows 7 explorer, you can see at left panel there is "Network" icon that you can expand, it will show several machine names (e.g. PC-B) in the WLAN, then you can expand again to see its sharing folder (if exist). Because of the virtualbox's network driver taking over the hostname, if I tried to expand the PC-B, I will keep getting login dialog pop-up. The workaround is I have to type directly into the explorer: "\\192.168.1.122\my_share_folder". The weird thing is another device with windows 7 has its ip address are not taken over by 192.168.56.1, if I ping it, it will show the ip address correctly. But one thing I haven't told you is that the PC-B is also installed with virtualbox, but when I ping "PC-B" from PC-B itself, the result is correct IP: 192.168.1.122, and as well as when I pinged PC-A from PC-B, it shows the ip address correctly. So I wonder if the problem is come from windows 7 itself? :?:
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Virtualbox took over pc's hostname problem

Post by Perryg »

Well I can't teach you networking over the forums. Either used Bridged and be done with it or study on how networking actually works.
jonrick
Posts: 6
Joined: 6. Sep 2014, 20:27

Re: Virtualbox took over pc's hostname problem

Post by jonrick »

Okay, I understand. It's just my curiosity that keep bugging me.

I have several android VM created by Genymotion emulators (it uses virtualbox underlying), if I disable the VirtualBox Host-Only Network adapter, should the android VM use the bridged adapter too in order to be able to connect to host?
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Virtualbox took over pc's hostname problem

Post by Perryg »

jonrick wrote:Okay, I understand. It's just my curiosity that keep bugging me.

I have several android VM created by Genymotion emulators (it uses virtualbox underlying), if I disable the VirtualBox Host-Only Network adapter, should the android VM use the bridged adapter too in order to be able to connect to host?
I have no idea since android is not supported.
Post Reply