Virtualbox NAT network not connecting to the Internet












2














I installed Ubuntu Server 16.04.3 in two Virtualbox virtual machines, and then I created a NAT network and a DHCP server with the following commands from the host machine:



$ vboxmanage natnetwork add --netname testlab --network "10.10.10.0/24" --enable
$ vboxmanage dhcpserver add --netname testlab --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.12 --enable


I configured the Network setting of each virtual machine to use the Adapter 1 attached to 'Nat Network' testlab.



The two virtual machines can ping each other with these settings, but they cannot access the Internet. If I ping 8.8.8.8, I have a 100% packet loss and I am unable to install any package:



$ apt-get update && apt-get upgrade
Temporary failure resolving ‘gb.archive.ubuntu.com’


Both have an empty /etc/resolv.conf and the same /etc/hosts files.



I need to have them connected to each other and the Internet for testing purposes. One should act as a server, the second one as a client, and the machine acting as a server should be connected to the Internet.



I have no idea why the two servers cannot connect to the internet as Virtualbox NAT Network. Any ideas?










share|improve this question





























    2














    I installed Ubuntu Server 16.04.3 in two Virtualbox virtual machines, and then I created a NAT network and a DHCP server with the following commands from the host machine:



    $ vboxmanage natnetwork add --netname testlab --network "10.10.10.0/24" --enable
    $ vboxmanage dhcpserver add --netname testlab --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.12 --enable


    I configured the Network setting of each virtual machine to use the Adapter 1 attached to 'Nat Network' testlab.



    The two virtual machines can ping each other with these settings, but they cannot access the Internet. If I ping 8.8.8.8, I have a 100% packet loss and I am unable to install any package:



    $ apt-get update && apt-get upgrade
    Temporary failure resolving ‘gb.archive.ubuntu.com’


    Both have an empty /etc/resolv.conf and the same /etc/hosts files.



    I need to have them connected to each other and the Internet for testing purposes. One should act as a server, the second one as a client, and the machine acting as a server should be connected to the Internet.



    I have no idea why the two servers cannot connect to the internet as Virtualbox NAT Network. Any ideas?










    share|improve this question



























      2












      2








      2







      I installed Ubuntu Server 16.04.3 in two Virtualbox virtual machines, and then I created a NAT network and a DHCP server with the following commands from the host machine:



      $ vboxmanage natnetwork add --netname testlab --network "10.10.10.0/24" --enable
      $ vboxmanage dhcpserver add --netname testlab --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.12 --enable


      I configured the Network setting of each virtual machine to use the Adapter 1 attached to 'Nat Network' testlab.



      The two virtual machines can ping each other with these settings, but they cannot access the Internet. If I ping 8.8.8.8, I have a 100% packet loss and I am unable to install any package:



      $ apt-get update && apt-get upgrade
      Temporary failure resolving ‘gb.archive.ubuntu.com’


      Both have an empty /etc/resolv.conf and the same /etc/hosts files.



      I need to have them connected to each other and the Internet for testing purposes. One should act as a server, the second one as a client, and the machine acting as a server should be connected to the Internet.



      I have no idea why the two servers cannot connect to the internet as Virtualbox NAT Network. Any ideas?










      share|improve this question















      I installed Ubuntu Server 16.04.3 in two Virtualbox virtual machines, and then I created a NAT network and a DHCP server with the following commands from the host machine:



      $ vboxmanage natnetwork add --netname testlab --network "10.10.10.0/24" --enable
      $ vboxmanage dhcpserver add --netname testlab --ip 10.10.10.1 --netmask 255.255.255.0 --lowerip 10.10.10.2 --upperip 10.10.10.12 --enable


      I configured the Network setting of each virtual machine to use the Adapter 1 attached to 'Nat Network' testlab.



      The two virtual machines can ping each other with these settings, but they cannot access the Internet. If I ping 8.8.8.8, I have a 100% packet loss and I am unable to install any package:



      $ apt-get update && apt-get upgrade
      Temporary failure resolving ‘gb.archive.ubuntu.com’


      Both have an empty /etc/resolv.conf and the same /etc/hosts files.



      I need to have them connected to each other and the Internet for testing purposes. One should act as a server, the second one as a client, and the machine acting as a server should be connected to the Internet.



      I have no idea why the two servers cannot connect to the internet as Virtualbox NAT Network. Any ideas?







      ubuntu networking virtualbox






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 19 '17 at 11:33

























      asked Sep 18 '17 at 13:18









      Asarluhi

      13819




      13819






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Changing network address range solved the issue.

          I still do not know why the 10.10.10.0/24 address range does not work.

          See at the Virtualbox forum.






          share|improve this answer





























            0














            I had a similar problem with NatNetworking in VirtualBox just recently where guests were able to ping each other but not connect to the network (but they had been previously, the configuration was sound something had clearly just died, this seems especially prevalent on macOS).



            This answer wasn't posted anywhere, I found it by digging through VBoxManage's help prompts. (The ifconfig suggestion didn't work for me.)



            Run these in a command line to restart the NatNetwork server:



            VBoxManage natnetwork stop  --netname NatNetworkName
            VBoxManage natnetwork start --netname NatNetworkName


            Note that enabling and disabling (both from the UI or the GUI) wasn't enough; these lines seem to be more exhaustive.






            share|improve this answer










            New contributor




            user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              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: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              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%2funix.stackexchange.com%2fquestions%2f392946%2fvirtualbox-nat-network-not-connecting-to-the-internet%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              1














              Changing network address range solved the issue.

              I still do not know why the 10.10.10.0/24 address range does not work.

              See at the Virtualbox forum.






              share|improve this answer


























                1














                Changing network address range solved the issue.

                I still do not know why the 10.10.10.0/24 address range does not work.

                See at the Virtualbox forum.






                share|improve this answer
























                  1












                  1








                  1






                  Changing network address range solved the issue.

                  I still do not know why the 10.10.10.0/24 address range does not work.

                  See at the Virtualbox forum.






                  share|improve this answer












                  Changing network address range solved the issue.

                  I still do not know why the 10.10.10.0/24 address range does not work.

                  See at the Virtualbox forum.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 1 '17 at 9:15









                  Asarluhi

                  13819




                  13819

























                      0














                      I had a similar problem with NatNetworking in VirtualBox just recently where guests were able to ping each other but not connect to the network (but they had been previously, the configuration was sound something had clearly just died, this seems especially prevalent on macOS).



                      This answer wasn't posted anywhere, I found it by digging through VBoxManage's help prompts. (The ifconfig suggestion didn't work for me.)



                      Run these in a command line to restart the NatNetwork server:



                      VBoxManage natnetwork stop  --netname NatNetworkName
                      VBoxManage natnetwork start --netname NatNetworkName


                      Note that enabling and disabling (both from the UI or the GUI) wasn't enough; these lines seem to be more exhaustive.






                      share|improve this answer










                      New contributor




                      user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.























                        0














                        I had a similar problem with NatNetworking in VirtualBox just recently where guests were able to ping each other but not connect to the network (but they had been previously, the configuration was sound something had clearly just died, this seems especially prevalent on macOS).



                        This answer wasn't posted anywhere, I found it by digging through VBoxManage's help prompts. (The ifconfig suggestion didn't work for me.)



                        Run these in a command line to restart the NatNetwork server:



                        VBoxManage natnetwork stop  --netname NatNetworkName
                        VBoxManage natnetwork start --netname NatNetworkName


                        Note that enabling and disabling (both from the UI or the GUI) wasn't enough; these lines seem to be more exhaustive.






                        share|improve this answer










                        New contributor




                        user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.





















                          0












                          0








                          0






                          I had a similar problem with NatNetworking in VirtualBox just recently where guests were able to ping each other but not connect to the network (but they had been previously, the configuration was sound something had clearly just died, this seems especially prevalent on macOS).



                          This answer wasn't posted anywhere, I found it by digging through VBoxManage's help prompts. (The ifconfig suggestion didn't work for me.)



                          Run these in a command line to restart the NatNetwork server:



                          VBoxManage natnetwork stop  --netname NatNetworkName
                          VBoxManage natnetwork start --netname NatNetworkName


                          Note that enabling and disabling (both from the UI or the GUI) wasn't enough; these lines seem to be more exhaustive.






                          share|improve this answer










                          New contributor




                          user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          I had a similar problem with NatNetworking in VirtualBox just recently where guests were able to ping each other but not connect to the network (but they had been previously, the configuration was sound something had clearly just died, this seems especially prevalent on macOS).



                          This answer wasn't posted anywhere, I found it by digging through VBoxManage's help prompts. (The ifconfig suggestion didn't work for me.)



                          Run these in a command line to restart the NatNetwork server:



                          VBoxManage natnetwork stop  --netname NatNetworkName
                          VBoxManage natnetwork start --netname NatNetworkName


                          Note that enabling and disabling (both from the UI or the GUI) wasn't enough; these lines seem to be more exhaustive.







                          share|improve this answer










                          New contributor




                          user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer








                          edited 6 hours ago









                          G-Man

                          13k93364




                          13k93364






                          New contributor




                          user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered 7 hours ago









                          user329668

                          1




                          1




                          New contributor




                          user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          user329668 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Unix & Linux Stack Exchange!


                              • 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.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • 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%2funix.stackexchange.com%2fquestions%2f392946%2fvirtualbox-nat-network-not-connecting-to-the-internet%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

                              CARDNET

                              Boot-repair Failure: Unable to locate package grub-common:i386

                              濃尾地震