Networking Made a Real Mess

Discussions about using Linux guests in VirtualBox.
Post Reply
iannem
Posts: 5
Joined: 7. Aug 2013, 13:44

Networking Made a Real Mess

Post by iannem »

Thanks in advance for your help,

I have a host machine running Debain Wheezy and 2 guest os's running Scientific Linux. I have 3 ip addresses that need to be setup: 1 for host and 1 for each guest OS. Between me and another developer and following some of the posts on here I have got this far:

IP Address for host is setup fine and works well.

I have followed this tutorial -> How to install Host-Only networking in OS X (can't post urls) and a couple of posts on here to try and get it working in the guest (obviously adapted for the OS's I am using). I am now in the position where:

1) I have a host-only adapter setup and verified it exists in linux (File->Pref's->Network) and ensured DHCP is turned off
2) I have setup the guest os to use the host-only adapter (Guest OS->Settings->Network Attached To: Host-only Adapter, Name: vboxnet0)

Now this is where it gets annoying:

When I ssh in to the new ip ***.***.***.2 I get the host machine responding which is on ***.***.***.1

I tried to configure the static ip in Scientific Linux but when I try and restart networking I get: "Error, some other host already uses address ***.***.***.2". I am now at a bit of a loss and don't know where to go next.

Thanks again.

Ian
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Networking Made a Real Mess

Post by Perryg »

Either start the guest one at a time and change the address, or change one of them to something other than .1 or .2 until you have the first one set.
iannem
Posts: 5
Joined: 7. Aug 2013, 13:44

Re: Networking Made a Real Mess

Post by iannem »

Thanks for the quick reply. At present I am only running the host and 1 client. I am unable to use any other ip addresses as they are already in use on the network, and getting others is quite complicated.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Networking Made a Real Mess

Post by Perryg »

If you are using host-only there is no way that the addresses are in use on the network. Not unless you have modified the network stack to allow host-only access to the normal LAN and that is *not what you should do, ever.
You mention using a tutorial for Mac OSX but you are using Linux as host so I would need to know a lot more about what you have done before I could attempt to tell you where you need to look or do to fix this issue.

Run the following on the hosts terminal and post the results.

VBoxManage list hostonlyifs
iannem
Posts: 5
Joined: 7. Aug 2013, 13:44

Re: Networking Made a Real Mess

Post by iannem »

Firstly:
VBoxManage list hostonlyifs
Name:            vboxnet0
GUID:            786f6276-656e-4074-8000-0a0027000000
DHCP:            Disabled
IPAddress:       ***.***.***.2
NetworkMask:     255.255.255.0
IPV6Address:     fe80:0000:0000:0000:0800:27ff:fe00:0000
IPV6NetworkMaskPrefixLength: 64
HardwareAddress: 0a:00:27:00:00:00
MediumType:      Ethernet
Status:          Up
VBoxNetworkName: HostInterfaceNetworking-vboxnet0
On the tutorial "How to install Host-Only networking in OS X" I followed steps 1 - 7 exactly (as these are mostly GUI bits). I then used the Host-Only network setup as the Adapter 1 device, as we only want the virtual machine to have the ***.***.***.2 address. I then went in an edited (using nano as root on the guest) /etc/sysconfig/network-scripts/ifcfg-eth0:
DEVICE=eth0
BOOTPROTO=none
IPADDR=***.***.***.2
NETMASK=255.255.255.0
TYPE=Ethernet
GATEWAY=[Our Networks Gateway] I have also tried 192.168.1.1
DNS1=[Our Networks DNS Server]
IPV6INIT=no
USERCTL=no
HWADDR=[Mac Address]
ONBOOT=yes
When I try to restart the networking using: /etc/rc.d/init.d/network restart

I get the error "Error, some other host already uses address ***.***.***.2".

Hope that provides a bit more information.

Thanks Again
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Networking Made a Real Mess

Post by Perryg »

Not really.

The default address scheme for host-only is 192.168.56.* and you should be using that address unless you know networking better than it appears you do.
The host-only network is specifically for use between host and guest/s and does not allow for Internet or LAN access, and as such you would not need to obfuscate the address in your post. Now if you are trying to use a real ( public ) address with Host-only that will cause this issue. For that you should be using Bridged instead of host-only.

Edit: adding a gateway to the host-only adapter will not work and will kill the network on the host.
iannem
Posts: 5
Joined: 7. Aug 2013, 13:44

Re: Networking Made a Real Mess

Post by iannem »

Hi I Really appreciate your help, neither networking nor virtual box are particularly my areas of expertise.

I have now using the GUI changed the network mode to bridged and booted the guest os. Then ensured the ip address is our public ip ***.2 restarted the guest os but am still getting the same issues as above.

ifconfig output on guest:
eth0    Link encap:Ethernet  HWaddr [address]
        UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
        RX packets:4  errors:0  dropped:0  overruns:0  frame:0
        TX packets:1  errors:0  dropped:0  overruns:0  carrier:0
        collisions:0 txqueuelen:1000
        RX bytes:252 (252.0b)  TX bytes:42 (42.0b)
Sorry I have to type these out manually on my laptop so sorry if they are wrong. The lo interface looks to be the same as normal.

Looking up tutorials (both video and text) they show an ip address should appear on the machine automatically, but in this case it isn't. Any ideas?
iannem
Posts: 5
Joined: 7. Aug 2013, 13:44

Re: Networking Made a Real Mess

Post by iannem »

Sorry for the double post. But I worked it out (stupid mistake). I had not deleted the the Host-Only network adapters from within the Virtual Box GUI.

Thank you very much for your assistance.
Post Reply