I am connecting to a server via ssh -L 8000:localhost:8000 <hostname>
on my Ubuntu virtual machine in VirtualBox. In the VM, I can access the server via "localhost:8000" but cannot from the IP address "192.168.11.175:8000" (I have a bridged adapter). I cannot access the server in my host OS (Windows 10) via localhost or the IP. How could I get access to the VM localhost from my host machine?
Results from running ifconfig:
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.11.175 netmask 255.255.255.0 broadcast 192.168.11.255
inet6 fe80::61a3:b162:4e6e:4731 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:30:85:c2 txqueuelen 1000 (Ethernet)
RX packets 4097 bytes 3519328 (3.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3347 bytes 551359 (551.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2179 bytes 1877351 (1.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2179 bytes 1877351 (1.8 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
One to achieve this is to ssh
into your Ubuntu VM from the "host" (your Windows 10 machine) using -L
(for local port forwarding) as well.
You chose Windows as your host for some reason, so there is no built-in ssh
command as in macOS, Linux etc.
So I assume you're probably using tools like PuTTY?
You can set up local port forwarding in PuTTY using its config dialog - find more information i.e. here.
After having forwarded port 8000 from your Windows host to the Ubuntu VM, it will then be further forwarded through the ssh -L ...
command you mentioned to the remote server.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments