9

As I said in the title, I want to access via ssh my VM from the host OS and the other way around (both OSes are ubuntu; 10.10 on the host, 9.10 on the guest)

To do so, I've configured a bridged NIC on the guest, attached it to my physical eth0 NIC and then statically assigned to both interfaces addresses of the same sub-network (10.0.0.100 and 10.0.0.100).

All the interfaces are up, with the right entry in route -n:

$ ifconfig 
eth0      Link encap:Ethernet  HWaddr 00:1d:ba:65:10:12  
          inet addr:10.0.0.100  Bcast:10.0.255.255  Mask:255.255.0.0
...
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        0.0.0.0         255.255.0.0     U     0      0        0 eth0

(this is on the host os - same situation on guest os).

The problem is that both machines doesn't "see" one each other:

$ ping 10.0.0.101
PING 10.0.0.101 (10.0.0.101) 56(84) bytes of data.
^C
--- 10.0.0.101 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5040ms

What's the problem? What I'm missing?

2 Answers 2

7

Rather than a "bridged" adaptor from what I can tell what you need to set up is a "host-only" adaptor.

The bridged adaptor will cut out your host entirely and forward all data via your physical network card, even bypassing the NAT mode that is used by default. I expect this is most useful if you want to host a network-wide service on a virtual machine.

The "host-only" adaptor on the other hand sets up a mini dhcp server (for your guest to get an IP) and passes data only between the host and guest.

You would set up the host-only connection in the same way as any other connection, using ifconfig and dhcpcd.

0
6

Ref: https//blogs.oracle.com/fatbloke/entry/networking_in_virtualbox1

VM -> Settings -> Network

Set the first adaptor as Host-Only

  • The host OS gets 192.168.56.1 and the guests get 192.168.56.101/254

Set the 2nd adaptor with e.g. NAT

  • This will allow the guest OS to talk to the outer world
  • Every guest OS gets 10.0.2.15
  • Each guest OS can set its own port forwarding
  • to Of course, the same host ports should not be used for different guests

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .