VirtualBox: MacOS host cannot connect to guest, but guest can connect to host












0















My setup:




  • MacOS host (High Sierra 10.13.3)

  • Linux guest (Ubuntu 16.04)

  • Virtual Box 5.2.12

  • NAT networking


I need to talk from host to guest and from guest to internet.



The guest gets an IP address of 10.0.2.15 and gateway of 10.0.2.2. I can ping host from guest with no problem. Yet, I cannot ping guest from host:



PING 10.0.2.15 (10.0.2.15): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
...



10.0.2.2 address seems to be assigned to my host: I have an httpd server running on host - and if I navigate to 10.0.2.2 in a browser from guest, I get the host's site.



Looking at network configuration, I don't see any interfaces added by virtualbox:



host$ ifconfig
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
OHC4: flags=0<> mtu 0
EHC36: flags=0<> mtu 0
EHC38: flags=0<> mtu 0
OHC6: flags=0<> mtu 0
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether xxxxx
inet6 fe80::1c34:9a51:ed93:3a5b%en1 prefixlen 64 secured scopeid 0x9
inet 10.37.37.37 netmask 0xffffff00 broadcast 10.37.37.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
ether xxxxx
media: autoselect
status: inactive
fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
lladdr xxxxx
nd6 options=201<PERFORMNUD,DAD>
media: autoselect <full-duplex>
status: inactive
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
ether xxxxx
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (none)
status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
inet6 fe80::9a23:8dd9:bf4e:f69d%utun0 prefixlen 64 scopeid 0x8
nd6 options=201<PERFORMNUD,DAD>


and I don't see any routes to connect from host to guest:



host$ netstat -nr
Routing tables

Internet:
Destination Gateway Flags Refs Use Netif Expire
default 10.37.37.1 UGSc 77 10 en1
10.37.37/24 link#9 UCS 3 0 en1
127 127.0.0.1 UCS 0 0 lo0
127.0.0.1 127.0.0.1 UH 3 458010 lo0
169.254 link#9 UCS 0 0 en1
255.255.255.255/32 link#9 UCS 0 0 en1

Internet6:
Destination Gateway Flags Netif Expire
default fe80::%utun0 UGcI utun0
::1 ::1 UHL lo0
fe80::%lo0/64 fe80::1%lo0 UcI lo0
fe80::1%lo0 link#1 UHLI lo0
fe80::%utun0/64 fe80::9a23:8dd9:bf4e:f69d%utun0 UcI utun0
fe80::9a23:8dd9:bf4e:f69d%utun0 link#8 UHLI lo0
fe80::%en1/64 link#9 UCI en1
fe80::1c34:9a51:ed93:3a5b%en1 f0:b4:79:1f:81:f0 UHLI lo0
ff01::%lo0/32 ::1 UmCI lo0
ff01::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
ff01::%en1/32 link#9 UmCI en1
ff02::%lo0/32 ::1 UmCI lo0
ff02::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
ff02::%en1/32 link#9 UmCI en1


It's understandable that host can't talk to guest. The question is how can I make it do it?










share|improve this question



























    0















    My setup:




    • MacOS host (High Sierra 10.13.3)

    • Linux guest (Ubuntu 16.04)

    • Virtual Box 5.2.12

    • NAT networking


    I need to talk from host to guest and from guest to internet.



    The guest gets an IP address of 10.0.2.15 and gateway of 10.0.2.2. I can ping host from guest with no problem. Yet, I cannot ping guest from host:



    PING 10.0.2.15 (10.0.2.15): 56 data bytes
    Request timeout for icmp_seq 0
    Request timeout for icmp_seq 1
    Request timeout for icmp_seq 2
    ...



    10.0.2.2 address seems to be assigned to my host: I have an httpd server running on host - and if I navigate to 10.0.2.2 in a browser from guest, I get the host's site.



    Looking at network configuration, I don't see any interfaces added by virtualbox:



    host$ ifconfig
    lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet 127.0.0.1 netmask 0xff000000
    inet6 ::1 prefixlen 128
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
    nd6 options=201<PERFORMNUD,DAD>
    gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
    stf0: flags=0<> mtu 1280
    OHC4: flags=0<> mtu 0
    EHC36: flags=0<> mtu 0
    EHC38: flags=0<> mtu 0
    OHC6: flags=0<> mtu 0
    en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether xxxxx
    inet6 fe80::1c34:9a51:ed93:3a5b%en1 prefixlen 64 secured scopeid 0x9
    inet 10.37.37.37 netmask 0xffffff00 broadcast 10.37.37.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
    p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether xxxxx
    media: autoselect
    status: inactive
    fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
    lladdr xxxxx
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect <full-duplex>
    status: inactive
    en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
    ether xxxxx
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect (none)
    status: inactive
    utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
    inet6 fe80::9a23:8dd9:bf4e:f69d%utun0 prefixlen 64 scopeid 0x8
    nd6 options=201<PERFORMNUD,DAD>


    and I don't see any routes to connect from host to guest:



    host$ netstat -nr
    Routing tables

    Internet:
    Destination Gateway Flags Refs Use Netif Expire
    default 10.37.37.1 UGSc 77 10 en1
    10.37.37/24 link#9 UCS 3 0 en1
    127 127.0.0.1 UCS 0 0 lo0
    127.0.0.1 127.0.0.1 UH 3 458010 lo0
    169.254 link#9 UCS 0 0 en1
    255.255.255.255/32 link#9 UCS 0 0 en1

    Internet6:
    Destination Gateway Flags Netif Expire
    default fe80::%utun0 UGcI utun0
    ::1 ::1 UHL lo0
    fe80::%lo0/64 fe80::1%lo0 UcI lo0
    fe80::1%lo0 link#1 UHLI lo0
    fe80::%utun0/64 fe80::9a23:8dd9:bf4e:f69d%utun0 UcI utun0
    fe80::9a23:8dd9:bf4e:f69d%utun0 link#8 UHLI lo0
    fe80::%en1/64 link#9 UCI en1
    fe80::1c34:9a51:ed93:3a5b%en1 f0:b4:79:1f:81:f0 UHLI lo0
    ff01::%lo0/32 ::1 UmCI lo0
    ff01::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
    ff01::%en1/32 link#9 UmCI en1
    ff02::%lo0/32 ::1 UmCI lo0
    ff02::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
    ff02::%en1/32 link#9 UmCI en1


    It's understandable that host can't talk to guest. The question is how can I make it do it?










    share|improve this question

























      0












      0








      0








      My setup:




      • MacOS host (High Sierra 10.13.3)

      • Linux guest (Ubuntu 16.04)

      • Virtual Box 5.2.12

      • NAT networking


      I need to talk from host to guest and from guest to internet.



      The guest gets an IP address of 10.0.2.15 and gateway of 10.0.2.2. I can ping host from guest with no problem. Yet, I cannot ping guest from host:



      PING 10.0.2.15 (10.0.2.15): 56 data bytes
      Request timeout for icmp_seq 0
      Request timeout for icmp_seq 1
      Request timeout for icmp_seq 2
      ...



      10.0.2.2 address seems to be assigned to my host: I have an httpd server running on host - and if I navigate to 10.0.2.2 in a browser from guest, I get the host's site.



      Looking at network configuration, I don't see any interfaces added by virtualbox:



      host$ ifconfig
      lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
      options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
      inet 127.0.0.1 netmask 0xff000000
      inet6 ::1 prefixlen 128
      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
      nd6 options=201<PERFORMNUD,DAD>
      gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
      stf0: flags=0<> mtu 1280
      OHC4: flags=0<> mtu 0
      EHC36: flags=0<> mtu 0
      EHC38: flags=0<> mtu 0
      OHC6: flags=0<> mtu 0
      en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
      ether xxxxx
      inet6 fe80::1c34:9a51:ed93:3a5b%en1 prefixlen 64 secured scopeid 0x9
      inet 10.37.37.37 netmask 0xffffff00 broadcast 10.37.37.255
      nd6 options=201<PERFORMNUD,DAD>
      media: autoselect
      status: active
      p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
      ether xxxxx
      media: autoselect
      status: inactive
      fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
      lladdr xxxxx
      nd6 options=201<PERFORMNUD,DAD>
      media: autoselect <full-duplex>
      status: inactive
      en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
      options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
      ether xxxxx
      nd6 options=201<PERFORMNUD,DAD>
      media: autoselect (none)
      status: inactive
      utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
      inet6 fe80::9a23:8dd9:bf4e:f69d%utun0 prefixlen 64 scopeid 0x8
      nd6 options=201<PERFORMNUD,DAD>


      and I don't see any routes to connect from host to guest:



      host$ netstat -nr
      Routing tables

      Internet:
      Destination Gateway Flags Refs Use Netif Expire
      default 10.37.37.1 UGSc 77 10 en1
      10.37.37/24 link#9 UCS 3 0 en1
      127 127.0.0.1 UCS 0 0 lo0
      127.0.0.1 127.0.0.1 UH 3 458010 lo0
      169.254 link#9 UCS 0 0 en1
      255.255.255.255/32 link#9 UCS 0 0 en1

      Internet6:
      Destination Gateway Flags Netif Expire
      default fe80::%utun0 UGcI utun0
      ::1 ::1 UHL lo0
      fe80::%lo0/64 fe80::1%lo0 UcI lo0
      fe80::1%lo0 link#1 UHLI lo0
      fe80::%utun0/64 fe80::9a23:8dd9:bf4e:f69d%utun0 UcI utun0
      fe80::9a23:8dd9:bf4e:f69d%utun0 link#8 UHLI lo0
      fe80::%en1/64 link#9 UCI en1
      fe80::1c34:9a51:ed93:3a5b%en1 f0:b4:79:1f:81:f0 UHLI lo0
      ff01::%lo0/32 ::1 UmCI lo0
      ff01::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
      ff01::%en1/32 link#9 UmCI en1
      ff02::%lo0/32 ::1 UmCI lo0
      ff02::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
      ff02::%en1/32 link#9 UmCI en1


      It's understandable that host can't talk to guest. The question is how can I make it do it?










      share|improve this question














      My setup:




      • MacOS host (High Sierra 10.13.3)

      • Linux guest (Ubuntu 16.04)

      • Virtual Box 5.2.12

      • NAT networking


      I need to talk from host to guest and from guest to internet.



      The guest gets an IP address of 10.0.2.15 and gateway of 10.0.2.2. I can ping host from guest with no problem. Yet, I cannot ping guest from host:



      PING 10.0.2.15 (10.0.2.15): 56 data bytes
      Request timeout for icmp_seq 0
      Request timeout for icmp_seq 1
      Request timeout for icmp_seq 2
      ...



      10.0.2.2 address seems to be assigned to my host: I have an httpd server running on host - and if I navigate to 10.0.2.2 in a browser from guest, I get the host's site.



      Looking at network configuration, I don't see any interfaces added by virtualbox:



      host$ ifconfig
      lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
      options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
      inet 127.0.0.1 netmask 0xff000000
      inet6 ::1 prefixlen 128
      inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
      nd6 options=201<PERFORMNUD,DAD>
      gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
      stf0: flags=0<> mtu 1280
      OHC4: flags=0<> mtu 0
      EHC36: flags=0<> mtu 0
      EHC38: flags=0<> mtu 0
      OHC6: flags=0<> mtu 0
      en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
      ether xxxxx
      inet6 fe80::1c34:9a51:ed93:3a5b%en1 prefixlen 64 secured scopeid 0x9
      inet 10.37.37.37 netmask 0xffffff00 broadcast 10.37.37.255
      nd6 options=201<PERFORMNUD,DAD>
      media: autoselect
      status: active
      p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
      ether xxxxx
      media: autoselect
      status: inactive
      fw0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 4078
      lladdr xxxxx
      nd6 options=201<PERFORMNUD,DAD>
      media: autoselect <full-duplex>
      status: inactive
      en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
      options=b<RXCSUM,TXCSUM,VLAN_HWTAGGING>
      ether xxxxx
      nd6 options=201<PERFORMNUD,DAD>
      media: autoselect (none)
      status: inactive
      utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
      inet6 fe80::9a23:8dd9:bf4e:f69d%utun0 prefixlen 64 scopeid 0x8
      nd6 options=201<PERFORMNUD,DAD>


      and I don't see any routes to connect from host to guest:



      host$ netstat -nr
      Routing tables

      Internet:
      Destination Gateway Flags Refs Use Netif Expire
      default 10.37.37.1 UGSc 77 10 en1
      10.37.37/24 link#9 UCS 3 0 en1
      127 127.0.0.1 UCS 0 0 lo0
      127.0.0.1 127.0.0.1 UH 3 458010 lo0
      169.254 link#9 UCS 0 0 en1
      255.255.255.255/32 link#9 UCS 0 0 en1

      Internet6:
      Destination Gateway Flags Netif Expire
      default fe80::%utun0 UGcI utun0
      ::1 ::1 UHL lo0
      fe80::%lo0/64 fe80::1%lo0 UcI lo0
      fe80::1%lo0 link#1 UHLI lo0
      fe80::%utun0/64 fe80::9a23:8dd9:bf4e:f69d%utun0 UcI utun0
      fe80::9a23:8dd9:bf4e:f69d%utun0 link#8 UHLI lo0
      fe80::%en1/64 link#9 UCI en1
      fe80::1c34:9a51:ed93:3a5b%en1 f0:b4:79:1f:81:f0 UHLI lo0
      ff01::%lo0/32 ::1 UmCI lo0
      ff01::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
      ff01::%en1/32 link#9 UmCI en1
      ff02::%lo0/32 ::1 UmCI lo0
      ff02::%utun0/32 fe80::9a23:8dd9:bf4e:f69d%utun0 UmCI utun0
      ff02::%en1/32 link#9 UmCI en1


      It's understandable that host can't talk to guest. The question is how can I make it do it?







      linux networking macos virtualbox






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked May 26 '18 at 22:52









      Aleks GAleks G

      262413




      262413






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I did figure it out eventually. The trick is to create a host-only network and then add two network interfaces in the guest - one for host-only network and the other one using NAT. Now the NAT interface allows the guest to access the internet and host-only interface allows two-way communication between the host and the guest.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1326255%2fvirtualbox-macos-host-cannot-connect-to-guest-but-guest-can-connect-to-host%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            I did figure it out eventually. The trick is to create a host-only network and then add two network interfaces in the guest - one for host-only network and the other one using NAT. Now the NAT interface allows the guest to access the internet and host-only interface allows two-way communication between the host and the guest.






            share|improve this answer




























              0














              I did figure it out eventually. The trick is to create a host-only network and then add two network interfaces in the guest - one for host-only network and the other one using NAT. Now the NAT interface allows the guest to access the internet and host-only interface allows two-way communication between the host and the guest.






              share|improve this answer


























                0












                0








                0







                I did figure it out eventually. The trick is to create a host-only network and then add two network interfaces in the guest - one for host-only network and the other one using NAT. Now the NAT interface allows the guest to access the internet and host-only interface allows two-way communication between the host and the guest.






                share|improve this answer













                I did figure it out eventually. The trick is to create a host-only network and then add two network interfaces in the guest - one for host-only network and the other one using NAT. Now the NAT interface allows the guest to access the internet and host-only interface allows two-way communication between the host and the guest.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 17 '18 at 10:22









                Aleks GAleks G

                262413




                262413






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1326255%2fvirtualbox-macos-host-cannot-connect-to-guest-but-guest-can-connect-to-host%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Plaza Victoria

                    Puebla de Zaragoza

                    Musa