I need to SSH from guest VM (Linux/Debian 9) to its host running VirtualBox on a Windows 10 machine. Network configuration: NAT.
Which Linux command can I use to figure out the IP of the host from within the guest?
I need to SSH from guest VM (Linux/Debian 9) to its host running VirtualBox on a Windows 10 machine. Network configuration: NAT.
Which Linux command can I use to figure out the IP of the host from within the guest?
$ ip route show default
default via 10.0.2.2 dev eth0 proto static
10.0.2.0/24 dev etho proto kernel scope link src 10.0.2.15
In the above, 10.0.2.2 is the address of the host which is routing packets from the guest's IP (10.0.2.15 above for reference)
If you prefer getting the IP itself, you could use grep and cut (or just awk), eg:
$ ip route show default | grep default | cut -d ' ' -f3
10.0.2.2
ListenAddressis configured) as you say. Presumably OP is able to configure host, but needs access from guest. – bertieb Apr 11 '18 at 14:28ListenAddresswas specified? – user1876484 Apr 11 '18 at 14:33sshdflavour though. – bertieb Apr 11 '18 at 14:3410.0.2.2host10.0.2.15guest seems to be default for NAT mode. I also had a look at shared properties (VBoxControl guestproperty enumerate) and the host IP isn't there- it could be set from the host side -- again, configuration -- and shared that way. – bertieb Apr 11 '18 at 14:37