Network access from Host doesn't work

Discussions related to using VirtualBox on Windows hosts.
Post Reply
JochenW
Posts: 23
Joined: 30. Dec 2018, 14:18

Network access from Host doesn't work

Post by JochenW »

Hi,

I am unable to access a VM from the host via network, although I believe, that this should work:

Host Details:
- VirtualBox Version: 7.0.2,
- OS Windows 10.0.19044 N/A Build 19044 (According to systeminfo)

Guest Details:
- Network interfaces: #1, NAT, IP address 10.0.10.0.2.15
#2, Host-only, IP address 192.168.56.109
- OS AlmaLinux 9.1, dnf uptodate
- Firewall status: Disabled, according to systemctl

What I tried on the host:

A "ping 192.168.56.109" gives no response.
λ curl http://192.168.56.109:10355 -v
* Trying 192.168.56.109:10355...
No response, as if a firewall would suppress packets, but the firewall on the guest is down. And, I assume that the Windows host wouldn't do this, would it?

The same code on the guest works flawlessly, so the port is open.

Thanks,

Jochen
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Network access from Host doesn't work

Post by scottgus1 »

  1. Start the VM from full normal shutdown, not save-state. Run until you see the problem happen, then shut down the VM from within the VM's OS if possible. If not possible, close the Virtualbox window for the VM with the Power Off option set.

    Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. In the "Logs" subfolder, zip the VM's "vbox.log", and post the zip file, using the forum's Upload Attachment tab.
  2. Right-click the VM in the main Virtualbox window's VM list, choose Show in Explorer/Finder/File Manager. Zip the VM's .vbox file (not the .vbox-prev file), and post the zip file, using the forum's Upload Attachment tab. (Configure your host OS to show all extensions if the folder that opens does not show a .vbox file.)
  3. In the Windows OS, open a Command Prompt and run ipconfig /all. Post the command output.
  4. In the Linux OS, open a Terminal and run ifconfig or ip address. Post the command output.
JochenW
Posts: 23
Joined: 30. Dec 2018, 14:18

Re: Network access from Host doesn't work

Post by JochenW »

Hi, @scottgus1,

attached you will find a file VBox-Infos.7z with the following files:

- VBox.log copied after fully restarting the VM, reproducing the problem, and shutting the VM down
- Alma9Wm103.vbox Likewise
- ifconfig-linux.out Output of "ifconfig" on the guest. (Taken while problem was present.)
- ipconfig-windows.out Output of "ipconfig /all" on the host. (Likewise.)


Thanks,

Jochen
Attachments
VBox-Infos.7z
(33.87 KiB) Downloaded 4 times
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Network access from Host doesn't work

Post by scottgus1 »

Check that the Alma OS firewall is truly off, or that it allows Ping (ICMP Echo Request).

The Windows ipconfig /all was typed wrong and the posted output was a syntax error? Try that one again.

Also, please post the output of:

cd "C:\Program Files\Oracle\VirtualBox"
vboxmanage list hostonlyifs


Please check outputs for errors before posting them. :wink:
JochenW
Posts: 23
Joined: 30. Dec 2018, 14:18

Re: Network access from Host doesn't work

Post by JochenW »

Hi,

As far as I know, this command indicates the status of the firewall:

Code: Select all

sag@alma9wm103 ~]$ sudo systemctl status firewalld
○ firewalld.service - firewalld - dynamic firewall daemon
     Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendo>
     Active: inactive (dead)
       Docs: man:firewalld(1)
So, it looks down to me. The corrected output of ipconfig /all should be available in the new attachment.

Thanks,

Jochen
Attachments
ipconfig-windows.7z
(1.03 KiB) Downloaded 5 times
JochenW
Posts: 23
Joined: 30. Dec 2018, 14:18

Re: Network access from Host doesn't work

Post by JochenW »

One more indicator on the status of the firewall:

Code: Select all

[sag@alma9wm103 ~]$ sudo firewall-cmd --state
not running
JochenW
Posts: 23
Joined: 30. Dec 2018, 14:18

Re: Network access from Host doesn't work

Post by JochenW »

Hi, @scottgus1,

just noticed, that you asked for the output of the following command:

Code: Select all

$ ./vboxmanage list hostonlyifs
Name:            VirtualBox Host-Only Ethernet Adapter
GUID:            4150b292-0fd5-4804-9cc7-dc75d64ee14d
DHCP:            Disabled
IPAddress:       169.254.102.192
NetworkMask:     255.255.0.0
IPV6Address:     fe80::e67b:775:4769:663a
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:0f
MediumType:      Ethernet
Wireless:        No
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Network access from Host doesn't work

Post by scottgus1 »

JochenW wrote:Network interfaces:
#1, NAT, IP address 10.0.2.15
#2, Host-only, IP address 192.168.56.109
....
A "ping 192.168.56.109" gives no response.
VM ifconfig wrote:enp0s3: inet 10.0.2.15
enp0s8: inet 192.168.56.109
Everything seems to look good above. However:
vboxmanage list hostonlyifs wrote:Name: VirtualBox Host-Only Ethernet Adapter
IPAddress: 169.254.102.192
ipconfig /all wrote:Ethernet adapter Ethernet 3:
Description . . . . . . . . . . . : VirtualBox Host-Only Ethernet Adapter
Physical Address. . . . . . . . . : 0A-00-27-00-00-0E
Autoconfiguration IPv4 Address. . : 169.254.143.198(Preferred)
Your Host-Only adapters are auto-selecting an APIPA address, which is incompatible with the Host-Only network IP range where the VM is getting its IP address. 169.254.#.# cannot talk to 192.168.56.#. APIPA addresses are auto-selected by the OS when an adapter is set to get an IP address from DHCP, but there is no DHCP server on the network.

I suspect that you have set the Host-Only adapter's "Adapter" tab to "Configure Adapter Automatically". Virtualbox's default is to "Configure Adapter Manually", and a specific IP address is picked by Virtualbox to match the default DHCP server set in the Host-Only network.

Please try making a new Host-Only network, letting Virtualbox handle all the setup. The Host-Only adapter in the host OS should get a 192.168.something.1 IP address. Change the VM to the new Host-Only network. If the Host-Only network is set to hand out IP addresses via DHCP, the VM should get a 192.168.something.# IP address, where both "something"s are the same number. You may have to reboot the VM or take the enp0s8 adapter "down" then "up" to get the new IP address to be received. Or set enp0s8 to a static IP address in the 192.168.something.# address range.
Post Reply