Connectivity Problems

Discussions related to using VirtualBox on Windows hosts.
Post Reply
domobcn
Posts: 6
Joined: 16. Sep 2015, 10:59

Connectivity Problems

Post by domobcn »

Hi,
my name is Alberto and I am trying to connect my host computer to the virtual machine.

I have a Windows 7 Installed and in the Virtual Machine i've installed a Ubuntu 14.04 Server 32-bit.

My /etc/network/interfaces configuration looks like:
-----------------------------------------
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 192.168.56.101
network 192.168.56.0
netmask 255.255.255.0
broadcast 192.168.56.255
gateway 192.168.56.1

auto eth1
iface eth1 inet dhcp
--------------------------------

In /etc/resolv.conf there's nothing (well a commented text with #)

I've looked through internet and so and some people are talking about /etc/udev/rules.d/70-persistent-net.rules, but I don't have this file

My configuration on Oracle VM Virtualbox looks like this:

Adapter 1:
Adapter Host only
VirtualBox Host-only Adapter
Adapter type: Intel Pro/1000MT Desktop (82540EM)
Promiscuous mode: Allow everything
Cable connected (option marked)

Adapter2:
NAT
(Same Type of Adapter...83540EM)
Promiscuous mode Deny
Cable Connected
Port forwaridng option:
Rule 1 TCP (blank on both IP addresses) Host port 2525, Guest Port 22)

Also there is another place where to configure
Virtualbox->File->Preferences (CTRL+G)-> Network
Nat Network:
One Nat network added and checkbox marked with the same port forwarding configuration as in the other place with the nat, dhcp allowed, ipv6 not
and in host only adapter
Virtualbox ethernet adapter without dhcp server and address 192.168.56.1
mask: 255.255.255.0

Also when I start my Ubuntu no network interfaces except from loopback could be seen, when I force it (eth0 up) they appear without IP addres, no ping to any network.


I have added some pics about it to make it easily but I couldn't put them in any order (sorry).
Attachments
Network Conf Adapter 1
Network Conf Adapter 1
Network_Config_Adapter1.png (45.58 KiB) Viewed 1577 times
ifconfig
ifconfig
ifconfig.png (17.15 KiB) Viewed 1577 times
etc_network_interfaces
etc_network_interfaces
etc_network_interfaces.png (45.32 KiB) Viewed 1577 times
domobcn
Posts: 6
Joined: 16. Sep 2015, 10:59

Re: Connectivity Problems

Post by domobcn »

I am adding some pics since there are only 3 visible per post
Attachments
resolv_conf
resolv_conf
resolv_conf.png (4.19 KiB) Viewed 1575 times
ipconfig
ipconfig
ipconfig.png (16.77 KiB) Viewed 1575 times
Adapter2
Adapter2
Network_Config_Adapter2.png (68.14 KiB) Viewed 1575 times
domobcn
Posts: 6
Joined: 16. Sep 2015, 10:59

Re: Connectivity Problems

Post by domobcn »

And some more...
Attachments
udev
udev
udev.png (2.01 KiB) Viewed 1575 times
Host Only2
Host Only2
Preferences_Host_only_2.png (118.66 KiB) Viewed 1575 times
Host_only
Host_only
Preferences_Host_only.png (55.57 KiB) Viewed 1575 times
domobcn
Posts: 6
Joined: 16. Sep 2015, 10:59

Re: Connectivity Problems

Post by domobcn »

And the last ones...
Attachments
Preferences_Nat_2.png
Preferences_Nat_2.png (76.26 KiB) Viewed 1575 times
Nat
Nat
Preferences_Nat.png (36.26 KiB) Viewed 1575 times
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Connectivity Problems

Post by noteirak »

All I can tell you is that your guest configuration is not correct for eth0.
You need to remove the gateway - Host-Only mode does not offer a gateway and so nothing will go throught there. It might block other requests until you do so.
I would also advise on setting the IP to 192.168.56.2 and not 101 - this overlap with the DHCP range of the Host-Only interface which is never a good idea.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
domobcn
Posts: 6
Joined: 16. Sep 2015, 10:59

Re: Connectivity Problems

Post by domobcn »

Hi noteirak,

Thank you for answering my question, I went to /etc/network/interfaces and erased the gateway and also changed the ip address to 192.168.56.2, but it didn't work for me :(

Ifconfig result is only loopback and when I attempt to "ifconfig -a" there are no ip addresses on eth0 eth1. I have the dhcp server in host-only empty. Should I put something there?

Eth1 (Nat) doesn't have any Ip also.

I'm getting stuck in this and I am not sure what am I doing wrong, please help.

Thank you!
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Connectivity Problems

Post by noteirak »

Moved to "Linux Guests".

try the following command:

Code: Select all

sudo ifconfig eth1 down
sudo ifconfig eth1 192.168.56.2 netmask 255.255.255.0
sudo ifconfig eth1 up
sudo route -n
What is the output?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
domobcn
Posts: 6
Joined: 16. Sep 2015, 10:59

Re: Connectivity Problems

Post by domobcn »

Hi noteirak!

Everything works now!! :D

How it has been solved: ( I feel kind of ashamed because it was a stupid mistake)

in the /etc/network interfaces I deleted a '#' (comment character) at the beginning of the file (second line), while i was putting some IP addresses and the keyboard was with the Bloq Num, so I moved to start and end of the /etc/network/interfaces file while I tried to put the Ip and each time I write the point 192.168.... my keyboard supress some characters :D

So, my configuration has ended this way:
1st Adapter: //my network
Bridge Adapter //network access
Promiscuous mode: Everything
2nd Adapter:
Nat //internet Access
(with the port forwarding
3rd Adapter: //host access with putty
Host-only Adapter
Promiscuous mode: Everything

And my /etc/network/interfaces looks like:

Code: Select all

nagios@ubuntu:~$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
#ad how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
 auto eth0
 iface eth0 inet static
 address 192.168.0.25
 network 192.168.0.0
 netmask 255.255.255.0
 broadcast 192.168.0.255
 gateway 192.168.0.9
 dns-nameservers 8.8.8.8 8.8.4.4


# The secondary network interface
auto eth1
iface eth1 inet dhcp

# The tertiary network interface
auto eth2
iface eth2 inet static
address 192.168.56.101
netmask 255.255.255.0

IMPORTANT:
I put the eth0 into the same network my host is working.
I am still trying how to connect with putty from another computer (in my network) directly to the guest machine.

Thank you for your pacience, specially noteirak. I hope this post help somehow.
Last edited by noteirak on 19. Sep 2015, 01:16, edited 1 time in total.
Reason: Added code tag
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Connectivity Problems

Post by noteirak »

I had a feeling it was something like that, that's why I asked you to do it manually. Glad it's working now!

I see you have setup 3 adapters now, one with NAT and another with Bridged - BEWARE! if your Bridged gets a gateway via DHCP (or you configure one) you'll get network problems when trying to connect to/from the VM. Make sure only one gateway exists.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply