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?
Best Answer
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
anddhcpcd
.