port forwarding isn't working

Discussions related to using VirtualBox on Mac OS X hosts.
Post Reply
sgu
Posts: 8
Joined: 15. Aug 2016, 00:15

port forwarding isn't working

Post 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
Attachments
Screen Shot 2018-03-06 at 5.23.39 PM.png
Screen Shot 2018-03-06 at 5.23.39 PM.png (54.47 KiB) Viewed 1001 times
Last edited by socratis on 9. Mar 2018, 08:39, edited 2 times in total.
Reason: Replaced attachment with actual text. Be more "green".
sgu
Posts: 8
Joined: 15. Aug 2016, 00:15

Re: port forwarding isn't working

Post by sgu »

The `netstat -ap tcp` command doesn't list port numbers. we should use `lsof -n i4TCP:8888` instead on MacOS.
Post Reply