You are not logged in.

#1 2017-05-25 19:48:47

balance
Member
Registered: 2017-02-17
Posts: 64

Host-Only Adapter doesn't work in Vbox

Hi,

Guest: debian

so I installed Vbox with virtualbox-host-modules-arch. I loaded all four modules and created a host-only adapter. Then I disabled its DHCP Server and went to my VM and assigned a Host-Only adapter as the second one. So now I have NAT and Host-Only. Then I run: ifconfig eth1 192.168.56.101 netmask 255.255.255.0 up

Now I expect to be able to ping it and be able to ssh into my server but I just kee pgetting time out's and I have no idea why. (I know that the command above is temporarily - also created the entry in the interfaces file but same problem.)

I basically followed http://christophermaier.name/2010/09/01 … irtualbox/

I just can't see why it doesn't work. Any hints?

Offline

#2 2017-05-25 20:20:18

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Host-Only Adapter doesn't work in Vbox

Let me guess.  The host is on the 192.18.56.0/24 subnet of your local area network.  NAT does not work that way.

In general, when you set up a virtual network between VirtualBox hosts and guests, the virtual networks are usually a 10.0.xx.00/24 network.  Mine happens to be 10.0.2.0/24.
What you should do is turn the virtual DHCP server back on and let it assign the host an address.  It will probably be 10.0.2.15/24, or something very similar.  Do this for both the host only and the NAT networks.  They will automatically be different subnets, probably 10.0.1.0/24 and 10.0.2.0/24 (the exact subnets wont matter)

Back on your host use ip addr, you will see (at least) three networks and the host's addresses on those networks -- 192.18.56.0/24 (your real network) and the two 10.0.xx.00/24 (virtual networks).  One of those two virtual networks will have NAT forwarding to the 192.18.56.0 network, allowing your guest access to the physical network.   The other will only permit communication between the guest and the host.

If you really, really, really want a 192.168.56.101 address for the guest, then you do not want NAT.  You want a "Bridged" network.  In this mode, the physical NIC in the host will have two addresses on the physical network -- one of which is virtuallized in the guest.  Not all hardware supports this.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2017-05-26 04:51:41

balance
Member
Registered: 2017-02-17
Posts: 64

Re: Host-Only Adapter doesn't work in Vbox

I have no idea what you mean by " The host is on the 192.18.56.0/24 subnet of your local area network". You mean my pc is in the same subnet? I just can't see any conflicting settings.

Anyway, somehow the host-only adapter doesn't get any ip on my host. So doing ip addr on my host gives me:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 fe80::a9ba:ac6a:1c54:1666/64 scope link
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 80:19:34:08:e8:73 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.110/24 brd 192.168.1.255 scope global wlp4s0
       valid_lft forever preferred_lft forever
    inet6 2a02:1205:c691:4ca0:1567:b723:f294:ddb6/64 scope global mngtmpaddr noprefixroute dynamic
       valid_lft 298sec preferred_lft 58sec
    inet6 fe80::8219:34ff:fe08:e873/64 scope link
       valid_lft forever preferred_lft forever
13: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff

the host-only settings are:
IPv4 address: 192.168.56.1
and its DHCP is set to:
Server Address: 192.168.56.100
Server Mask: 255.255.255.0
Lower Address Bound: 192.168.56.101
Upper Address Bound: 192.168.56.254

Currently I just use a bridged adapter so I can ssh into it. I know that I also could use NAT with port forwarding but still using a NAT and a Host-Only is probably the best solution. But it doesn't work hmm

Last edited by balance (2017-05-26 05:07:06)

Offline

#4 2017-05-29 11:13:13

balance
Member
Registered: 2017-02-17
Posts: 64

Re: Host-Only Adapter doesn't work in Vbox

Anyone can point me in the right direction?

Offline

#5 2017-05-29 11:48:22

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: Host-Only Adapter doesn't work in Vbox

You did notice that guide tells you to create two network adapters for the guest ?

One is nat with dhcp , the other is the host-only one.

What does ip addr    show on the guest ?


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#6 2017-05-29 14:51:24

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: Host-Only Adapter doesn't work in Vbox

Sorry, I had missed seeing your response.  What is more, I missed your bump.  I'm losing my touch hmm


On your host, what is the output of ip addr?
On your guest, what is the output of ip addr

And what, briefly, are you trying to achieve?  Example, Have one host only network so you can communicate with the host, and another for talking to the Internet? Or another so I can host a website.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

Board footer

Powered by FluxBB