Page 1 of 1

port forwarding isn't working

Posted: 7. Mar 2018, 03:32
by sgu
I am trying to set up port forwarding between ubuntu 16.04 and mac os 10.12 following this post: https://stackoverflow.com/questions/155 ... at-adapter

However, this doesn't work. I cannot even see the VirtualBox is listening on the port 8888 after I restart VirtualBox.

Code: Select all

$ netstat -ap tcp|grep -i "listen"
tcp4       0      0  *.ddi-tcp-1            *.*                    LISTEN     
tcp4       0      0  localhost.49152        *.*                    LISTEN     
tcp4       0      0  localhost.29754        *.*                    LISTEN     
tcp46      0      0  *.sunproxyadmin        *.*                    LISTEN     
tcp6       0      0  *.61500                *.*                    LISTEN     
tcp4       0      0  *.61500                *.*                    LISTEN     
tcp4       0      0  *.ssh                  *.*                    LISTEN     
tcp6       0      0  *.ssh                  *.*                    LISTEN
Here is the Network part of the vbox file. Screen shots are also attached. I am using VirtualBox version 5.2.6. Any helps on tracking down the problems are appreciated.

Code: Select all

<Network>
  <Adapter slot="0" enabled="true" MACAddress="0800270E37F1" type="virtio">
    <NAT>
      <Forwarding name="jupyter-notebook" proto="1" hostport="8888" guestport="8888"/>
    </NAT>
  </Adapter>
</Network>
NAT port forwarding settings:

Code: Select all

Name                Protocol    Host IP    Host Port    Guest IP    Guest Port
jupyter-noteb...    TCP                    8888                     8888

Re: port forwarding isn't working

Posted: 7. Mar 2018, 23:06
by sgu
The `netstat -ap tcp` command doesn't list port numbers. we should use `lsof -n i4TCP:8888` instead on MacOS.