My newly compiled kernel loses Networking in qemu











up vote
0
down vote

favorite












I compiled a kernel from source :
make defconfig
make kvmconfig
make -j 4
After this , i use the resulting bzImage for my qemu command:

qemu-system-x86_64 -hda debian.img -kernel bzImage -append "root=/dev/sda console=ttyS0" -nographic -m 4096 -smp 2 --enable-kvm -net user,hostfwd=tcp::10021-:22 -net nic

It mounts, and I get a shell and everything, but it loses connectivity. In qemu, it logs :

[FAILED] Failed to start Raise network interfaces.
See 'systemctl status networking.service' for details.

Can someone guide me on this ? I already consulted Linux vanilla kernel on QEMU and networking with eth0 but it does not solve my issue. Also, Im not looking for hardcore qemu-bridge-solutions. Im pretty sure some network drivers are not getting loaded , but I can't figure out how to resolve it. Or maybe Im missing some kernel .config options.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I compiled a kernel from source :
    make defconfig
    make kvmconfig
    make -j 4
    After this , i use the resulting bzImage for my qemu command:

    qemu-system-x86_64 -hda debian.img -kernel bzImage -append "root=/dev/sda console=ttyS0" -nographic -m 4096 -smp 2 --enable-kvm -net user,hostfwd=tcp::10021-:22 -net nic

    It mounts, and I get a shell and everything, but it loses connectivity. In qemu, it logs :

    [FAILED] Failed to start Raise network interfaces.
    See 'systemctl status networking.service' for details.

    Can someone guide me on this ? I already consulted Linux vanilla kernel on QEMU and networking with eth0 but it does not solve my issue. Also, Im not looking for hardcore qemu-bridge-solutions. Im pretty sure some network drivers are not getting loaded , but I can't figure out how to resolve it. Or maybe Im missing some kernel .config options.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I compiled a kernel from source :
      make defconfig
      make kvmconfig
      make -j 4
      After this , i use the resulting bzImage for my qemu command:

      qemu-system-x86_64 -hda debian.img -kernel bzImage -append "root=/dev/sda console=ttyS0" -nographic -m 4096 -smp 2 --enable-kvm -net user,hostfwd=tcp::10021-:22 -net nic

      It mounts, and I get a shell and everything, but it loses connectivity. In qemu, it logs :

      [FAILED] Failed to start Raise network interfaces.
      See 'systemctl status networking.service' for details.

      Can someone guide me on this ? I already consulted Linux vanilla kernel on QEMU and networking with eth0 but it does not solve my issue. Also, Im not looking for hardcore qemu-bridge-solutions. Im pretty sure some network drivers are not getting loaded , but I can't figure out how to resolve it. Or maybe Im missing some kernel .config options.










      share|improve this question













      I compiled a kernel from source :
      make defconfig
      make kvmconfig
      make -j 4
      After this , i use the resulting bzImage for my qemu command:

      qemu-system-x86_64 -hda debian.img -kernel bzImage -append "root=/dev/sda console=ttyS0" -nographic -m 4096 -smp 2 --enable-kvm -net user,hostfwd=tcp::10021-:22 -net nic

      It mounts, and I get a shell and everything, but it loses connectivity. In qemu, it logs :

      [FAILED] Failed to start Raise network interfaces.
      See 'systemctl status networking.service' for details.

      Can someone guide me on this ? I already consulted Linux vanilla kernel on QEMU and networking with eth0 but it does not solve my issue. Also, Im not looking for hardcore qemu-bridge-solutions. Im pretty sure some network drivers are not getting loaded , but I can't figure out how to resolve it. Or maybe Im missing some kernel .config options.







      linux networking linux-kernel kernel qemu






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 8 at 0:16









      GreatPoseidon_11

      82




      82
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          You are using a user socket. For this qemu creates a regular socket in its host process and forwards the packets for specific ports in your guest machine to the host socket. It is doable but I find it annoying.



          I always prefer creating a tap device and bridging it to my physical interface with these QEMU switches:



          -netdev tap,ifname=tap0,script=no,downscript=no,id=my_net_id 
          -device driver=virtio-net,netdev=my_net_id


          This way you have full network capabilities and you don't need to use some weird port redirection.






          share|improve this answer





















          • Many thanks, while I did not actually use this technique, I googled about it, and how to setup tap0 on bridge, and came across a command called "dhclient", apparently running it allows the vm to reconnect to the network drivers (probably) , and it ups the network interface .
            – GreatPoseidon_11
            Nov 10 at 16:53











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          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',
          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%2fstackoverflow.com%2fquestions%2f53199827%2fmy-newly-compiled-kernel-loses-networking-in-qemu%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








          up vote
          0
          down vote



          accepted










          You are using a user socket. For this qemu creates a regular socket in its host process and forwards the packets for specific ports in your guest machine to the host socket. It is doable but I find it annoying.



          I always prefer creating a tap device and bridging it to my physical interface with these QEMU switches:



          -netdev tap,ifname=tap0,script=no,downscript=no,id=my_net_id 
          -device driver=virtio-net,netdev=my_net_id


          This way you have full network capabilities and you don't need to use some weird port redirection.






          share|improve this answer





















          • Many thanks, while I did not actually use this technique, I googled about it, and how to setup tap0 on bridge, and came across a command called "dhclient", apparently running it allows the vm to reconnect to the network drivers (probably) , and it ups the network interface .
            – GreatPoseidon_11
            Nov 10 at 16:53















          up vote
          0
          down vote



          accepted










          You are using a user socket. For this qemu creates a regular socket in its host process and forwards the packets for specific ports in your guest machine to the host socket. It is doable but I find it annoying.



          I always prefer creating a tap device and bridging it to my physical interface with these QEMU switches:



          -netdev tap,ifname=tap0,script=no,downscript=no,id=my_net_id 
          -device driver=virtio-net,netdev=my_net_id


          This way you have full network capabilities and you don't need to use some weird port redirection.






          share|improve this answer





















          • Many thanks, while I did not actually use this technique, I googled about it, and how to setup tap0 on bridge, and came across a command called "dhclient", apparently running it allows the vm to reconnect to the network drivers (probably) , and it ups the network interface .
            – GreatPoseidon_11
            Nov 10 at 16:53













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          You are using a user socket. For this qemu creates a regular socket in its host process and forwards the packets for specific ports in your guest machine to the host socket. It is doable but I find it annoying.



          I always prefer creating a tap device and bridging it to my physical interface with these QEMU switches:



          -netdev tap,ifname=tap0,script=no,downscript=no,id=my_net_id 
          -device driver=virtio-net,netdev=my_net_id


          This way you have full network capabilities and you don't need to use some weird port redirection.






          share|improve this answer












          You are using a user socket. For this qemu creates a regular socket in its host process and forwards the packets for specific ports in your guest machine to the host socket. It is doable but I find it annoying.



          I always prefer creating a tap device and bridging it to my physical interface with these QEMU switches:



          -netdev tap,ifname=tap0,script=no,downscript=no,id=my_net_id 
          -device driver=virtio-net,netdev=my_net_id


          This way you have full network capabilities and you don't need to use some weird port redirection.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 8 at 12:41









          Knightingale

          1115




          1115












          • Many thanks, while I did not actually use this technique, I googled about it, and how to setup tap0 on bridge, and came across a command called "dhclient", apparently running it allows the vm to reconnect to the network drivers (probably) , and it ups the network interface .
            – GreatPoseidon_11
            Nov 10 at 16:53


















          • Many thanks, while I did not actually use this technique, I googled about it, and how to setup tap0 on bridge, and came across a command called "dhclient", apparently running it allows the vm to reconnect to the network drivers (probably) , and it ups the network interface .
            – GreatPoseidon_11
            Nov 10 at 16:53
















          Many thanks, while I did not actually use this technique, I googled about it, and how to setup tap0 on bridge, and came across a command called "dhclient", apparently running it allows the vm to reconnect to the network drivers (probably) , and it ups the network interface .
          – GreatPoseidon_11
          Nov 10 at 16:53




          Many thanks, while I did not actually use this technique, I googled about it, and how to setup tap0 on bridge, and came across a command called "dhclient", apparently running it allows the vm to reconnect to the network drivers (probably) , and it ups the network interface .
          – GreatPoseidon_11
          Nov 10 at 16:53


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • 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%2fstackoverflow.com%2fquestions%2f53199827%2fmy-newly-compiled-kernel-loses-networking-in-qemu%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







          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini