Why is TCP/IP networking working so strangely with Linux guests?

Discussions about using Linux guests in VirtualBox.
Post Reply
GeorgeRT
Posts: 13
Joined: 21. Jan 2017, 16:31

Why is TCP/IP networking working so strangely with Linux guests?

Post by GeorgeRT »

I have a Windows 10 laptop that has a wireless network connection. I have a few Oracle VirtualBox VMs. Each VM is running Ubuntu 18.04. Their /etc/hosts files map their host names to their forwarding IP addresses (as configured in Oracle VirtualBox in the Network Adapter section). If I use ssh, ssh-keyscan, or nmap with their IP addresses from a different Linux VM, the result is consistent with the remote IP address being substituted with 127.0.0.1. So if I do this ssh@1.2.3.4 from the server at 5.6.7.8, it will connect to 5.6.7.8. In fact, it will say "last connected from 127.0.0.1" once I connect. If I am on the VM at 5.6.7.8, and I do this "nmap -Pn 1.2.3.4", I will see the results of "nmap -Pn 5.6.7.8". The ssh-keyscan results do have an IP address that changes based on what IP address I use with an ssh-keyscan command. But all the rest of the output does not change. Why are the remote IP addresses "resolving" to 127.0.0.1? I have seen DNS names resolve incorrectly. I have not seen IP addresses "resolve" to 127.0.0.1.

This problem is 100% reproducible, and I have never had normal TCP/IP networking working on the VMs among themselves. They have access to the internet (after I run a "sudo ip route add..." command). I have tried many different network adapter settings for the VMs of Oracle VirtualBox (using the GUI).
ghr
Volunteer
Posts: 376
Joined: 25. May 2007, 22:46
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: DOS, Win3x, Win95, WinXP, Ubuntu, OS/2

Re: Why is TCP/IP networking working so strangely with Linux guests?

Post by ghr »

Sounds complicated... What I did is this (and I get networking from the VM to host/outside world):
  • make fresh Ubuntu 18.04 VM
  • edit /etc/samba/smb.conf by adding 'client max protocol = NT1' below the 'workgroup =' line
  • use command 'testparm' to check your edits
  • sudo systemctl restart smbd
In this way I can connect to the outside world, e.g. Ubuntu 14 or Windows 10. I cannot tell if this will work for you though because my setups allow even DOS VMs to connect.
Setting up a share inside the VM is more/too complicated; I can get that to work but the method seems overdone...
Post Reply