Linux kernel on virtual machine










5















I am studying Linux driver programming and in it, it is recommended that I work on self-compiled Linux kernels and not any distributions. I have tried compiling Linux 2.6.9 in ubuntu but the process returns errors in 'make menuconfig' stage.



I would prefer to work with Linux in a virtual environment so that I can fearlessly experiment with the kernel. So, is there any way I can compile and run Linux in a virtual machine (say VMware installed on Windows)? I can use live CDs for the purpose of compiling the kernel.



So in short, please suggest, how can I compile, install and run Linux kernel in a virtual machine in an error-free way?



I searched and read this. But after following these steps when I restarted my computer there was no separate Linux 3.2.17 OS. But my ubuntu 12.04 was now showing 3.2.17 kernel. Although this is the first time I could compile a whole kernel on ubuntu without any error, I want to load that kernel on other partition and use it as an independent OS. So, if anyone can tell, what to do in addition to the steps in the tutorial so that I can achieve this?










share|improve this question




























    5















    I am studying Linux driver programming and in it, it is recommended that I work on self-compiled Linux kernels and not any distributions. I have tried compiling Linux 2.6.9 in ubuntu but the process returns errors in 'make menuconfig' stage.



    I would prefer to work with Linux in a virtual environment so that I can fearlessly experiment with the kernel. So, is there any way I can compile and run Linux in a virtual machine (say VMware installed on Windows)? I can use live CDs for the purpose of compiling the kernel.



    So in short, please suggest, how can I compile, install and run Linux kernel in a virtual machine in an error-free way?



    I searched and read this. But after following these steps when I restarted my computer there was no separate Linux 3.2.17 OS. But my ubuntu 12.04 was now showing 3.2.17 kernel. Although this is the first time I could compile a whole kernel on ubuntu without any error, I want to load that kernel on other partition and use it as an independent OS. So, if anyone can tell, what to do in addition to the steps in the tutorial so that I can achieve this?










    share|improve this question


























      5












      5








      5








      I am studying Linux driver programming and in it, it is recommended that I work on self-compiled Linux kernels and not any distributions. I have tried compiling Linux 2.6.9 in ubuntu but the process returns errors in 'make menuconfig' stage.



      I would prefer to work with Linux in a virtual environment so that I can fearlessly experiment with the kernel. So, is there any way I can compile and run Linux in a virtual machine (say VMware installed on Windows)? I can use live CDs for the purpose of compiling the kernel.



      So in short, please suggest, how can I compile, install and run Linux kernel in a virtual machine in an error-free way?



      I searched and read this. But after following these steps when I restarted my computer there was no separate Linux 3.2.17 OS. But my ubuntu 12.04 was now showing 3.2.17 kernel. Although this is the first time I could compile a whole kernel on ubuntu without any error, I want to load that kernel on other partition and use it as an independent OS. So, if anyone can tell, what to do in addition to the steps in the tutorial so that I can achieve this?










      share|improve this question
















      I am studying Linux driver programming and in it, it is recommended that I work on self-compiled Linux kernels and not any distributions. I have tried compiling Linux 2.6.9 in ubuntu but the process returns errors in 'make menuconfig' stage.



      I would prefer to work with Linux in a virtual environment so that I can fearlessly experiment with the kernel. So, is there any way I can compile and run Linux in a virtual machine (say VMware installed on Windows)? I can use live CDs for the purpose of compiling the kernel.



      So in short, please suggest, how can I compile, install and run Linux kernel in a virtual machine in an error-free way?



      I searched and read this. But after following these steps when I restarted my computer there was no separate Linux 3.2.17 OS. But my ubuntu 12.04 was now showing 3.2.17 kernel. Although this is the first time I could compile a whole kernel on ubuntu without any error, I want to load that kernel on other partition and use it as an independent OS. So, if anyone can tell, what to do in addition to the steps in the tutorial so that I can achieve this?







      compilation linux-kernel virtual-machine






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 16 '18 at 6:26









      BSMP

      2,62952536




      2,62952536










      asked Sep 1 '12 at 7:20









      Avinash KumarAvinash Kumar

      1,55433376




      1,55433376






















          3 Answers
          3






          active

          oldest

          votes


















          2














          The simplest thing to do is probably to install some Linux distribution on a VM, such as VMWare or VirtualBox, and continue from there. You could try using a live-cd, but I'm guessing that the lack of persistent storage might get irritating. There are, of course, ways around that, but installing some distribution is probably simpler, and you don't really need that much disk space for it if all you want to do is compile a kernel.



          If all you want to do is compile a kernel module, and if you already have some pre-installed Linux environment, you should also note that modern Linux installations allow you to compile modules without the need to re-compile the entire kernel. You will need the kernel source and headers, though. See, for example, this document.



          And BTW, speaking of modern kernels, why did you choose to use 2.6.9? It's almost 8 years old by now. Newer kernels might actually be easier to develop for. Also, there's no guarantee that
          modules developed with such an old kernel would still work with current ones.






          share|improve this answer























          • @tristram...thanks for your answer...i have ubuntu as an os...but when i compile linux kernel on that...it returns errors...i am asking how can i solve this problem(that is why i wrote 'error free way')

            – Avinash Kumar
            Sep 1 '12 at 9:48






          • 1





            @avinash That depends a lot on the errors you are getting, of course. But if you check the link above you'll see that it points to a complete 'compiling the kernel' guide - though I've specifically pointed to the module compilation chapter.

            – tristram shandy
            Sep 1 '12 at 11:28











          • @tristram...please read the edit

            – Avinash Kumar
            Sep 1 '12 at 16:55



















          1














          I suggest you to read this page. This document shows you how to boot your personal kernel on qemu and how to use the debugger on it.






          share|improve this answer
































            1














            Kernelnewbies is the right place to start kernel hacking. This website contains a set of rich tutorials about kernel hacking and tweaking just for newbie Linux developers. Also, you can join the community and start contributing to some tiny Linux projects.



            For a quick start, follow the instruction from the "kernel first patch" tutorial. Since you're cloning the "origin" remote repository in this tutorial, you'll work on the latest branches of Linux kernel. So, there's no need to worry about working on an old version of Linux. Meanwhile, if you're not comfortable working with git trees, you can always download the latest version of Linux from front page of "kernel.org".






            share|improve this answer
























              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',
              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%2fstackoverflow.com%2fquestions%2f12225786%2flinux-kernel-on-virtual-machine%23new-answer', 'question_page');

              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              2














              The simplest thing to do is probably to install some Linux distribution on a VM, such as VMWare or VirtualBox, and continue from there. You could try using a live-cd, but I'm guessing that the lack of persistent storage might get irritating. There are, of course, ways around that, but installing some distribution is probably simpler, and you don't really need that much disk space for it if all you want to do is compile a kernel.



              If all you want to do is compile a kernel module, and if you already have some pre-installed Linux environment, you should also note that modern Linux installations allow you to compile modules without the need to re-compile the entire kernel. You will need the kernel source and headers, though. See, for example, this document.



              And BTW, speaking of modern kernels, why did you choose to use 2.6.9? It's almost 8 years old by now. Newer kernels might actually be easier to develop for. Also, there's no guarantee that
              modules developed with such an old kernel would still work with current ones.






              share|improve this answer























              • @tristram...thanks for your answer...i have ubuntu as an os...but when i compile linux kernel on that...it returns errors...i am asking how can i solve this problem(that is why i wrote 'error free way')

                – Avinash Kumar
                Sep 1 '12 at 9:48






              • 1





                @avinash That depends a lot on the errors you are getting, of course. But if you check the link above you'll see that it points to a complete 'compiling the kernel' guide - though I've specifically pointed to the module compilation chapter.

                – tristram shandy
                Sep 1 '12 at 11:28











              • @tristram...please read the edit

                – Avinash Kumar
                Sep 1 '12 at 16:55
















              2














              The simplest thing to do is probably to install some Linux distribution on a VM, such as VMWare or VirtualBox, and continue from there. You could try using a live-cd, but I'm guessing that the lack of persistent storage might get irritating. There are, of course, ways around that, but installing some distribution is probably simpler, and you don't really need that much disk space for it if all you want to do is compile a kernel.



              If all you want to do is compile a kernel module, and if you already have some pre-installed Linux environment, you should also note that modern Linux installations allow you to compile modules without the need to re-compile the entire kernel. You will need the kernel source and headers, though. See, for example, this document.



              And BTW, speaking of modern kernels, why did you choose to use 2.6.9? It's almost 8 years old by now. Newer kernels might actually be easier to develop for. Also, there's no guarantee that
              modules developed with such an old kernel would still work with current ones.






              share|improve this answer























              • @tristram...thanks for your answer...i have ubuntu as an os...but when i compile linux kernel on that...it returns errors...i am asking how can i solve this problem(that is why i wrote 'error free way')

                – Avinash Kumar
                Sep 1 '12 at 9:48






              • 1





                @avinash That depends a lot on the errors you are getting, of course. But if you check the link above you'll see that it points to a complete 'compiling the kernel' guide - though I've specifically pointed to the module compilation chapter.

                – tristram shandy
                Sep 1 '12 at 11:28











              • @tristram...please read the edit

                – Avinash Kumar
                Sep 1 '12 at 16:55














              2












              2








              2







              The simplest thing to do is probably to install some Linux distribution on a VM, such as VMWare or VirtualBox, and continue from there. You could try using a live-cd, but I'm guessing that the lack of persistent storage might get irritating. There are, of course, ways around that, but installing some distribution is probably simpler, and you don't really need that much disk space for it if all you want to do is compile a kernel.



              If all you want to do is compile a kernel module, and if you already have some pre-installed Linux environment, you should also note that modern Linux installations allow you to compile modules without the need to re-compile the entire kernel. You will need the kernel source and headers, though. See, for example, this document.



              And BTW, speaking of modern kernels, why did you choose to use 2.6.9? It's almost 8 years old by now. Newer kernels might actually be easier to develop for. Also, there's no guarantee that
              modules developed with such an old kernel would still work with current ones.






              share|improve this answer













              The simplest thing to do is probably to install some Linux distribution on a VM, such as VMWare or VirtualBox, and continue from there. You could try using a live-cd, but I'm guessing that the lack of persistent storage might get irritating. There are, of course, ways around that, but installing some distribution is probably simpler, and you don't really need that much disk space for it if all you want to do is compile a kernel.



              If all you want to do is compile a kernel module, and if you already have some pre-installed Linux environment, you should also note that modern Linux installations allow you to compile modules without the need to re-compile the entire kernel. You will need the kernel source and headers, though. See, for example, this document.



              And BTW, speaking of modern kernels, why did you choose to use 2.6.9? It's almost 8 years old by now. Newer kernels might actually be easier to develop for. Also, there's no guarantee that
              modules developed with such an old kernel would still work with current ones.







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Sep 1 '12 at 9:18









              tristram shandytristram shandy

              1613




              1613












              • @tristram...thanks for your answer...i have ubuntu as an os...but when i compile linux kernel on that...it returns errors...i am asking how can i solve this problem(that is why i wrote 'error free way')

                – Avinash Kumar
                Sep 1 '12 at 9:48






              • 1





                @avinash That depends a lot on the errors you are getting, of course. But if you check the link above you'll see that it points to a complete 'compiling the kernel' guide - though I've specifically pointed to the module compilation chapter.

                – tristram shandy
                Sep 1 '12 at 11:28











              • @tristram...please read the edit

                – Avinash Kumar
                Sep 1 '12 at 16:55


















              • @tristram...thanks for your answer...i have ubuntu as an os...but when i compile linux kernel on that...it returns errors...i am asking how can i solve this problem(that is why i wrote 'error free way')

                – Avinash Kumar
                Sep 1 '12 at 9:48






              • 1





                @avinash That depends a lot on the errors you are getting, of course. But if you check the link above you'll see that it points to a complete 'compiling the kernel' guide - though I've specifically pointed to the module compilation chapter.

                – tristram shandy
                Sep 1 '12 at 11:28











              • @tristram...please read the edit

                – Avinash Kumar
                Sep 1 '12 at 16:55

















              @tristram...thanks for your answer...i have ubuntu as an os...but when i compile linux kernel on that...it returns errors...i am asking how can i solve this problem(that is why i wrote 'error free way')

              – Avinash Kumar
              Sep 1 '12 at 9:48





              @tristram...thanks for your answer...i have ubuntu as an os...but when i compile linux kernel on that...it returns errors...i am asking how can i solve this problem(that is why i wrote 'error free way')

              – Avinash Kumar
              Sep 1 '12 at 9:48




              1




              1





              @avinash That depends a lot on the errors you are getting, of course. But if you check the link above you'll see that it points to a complete 'compiling the kernel' guide - though I've specifically pointed to the module compilation chapter.

              – tristram shandy
              Sep 1 '12 at 11:28





              @avinash That depends a lot on the errors you are getting, of course. But if you check the link above you'll see that it points to a complete 'compiling the kernel' guide - though I've specifically pointed to the module compilation chapter.

              – tristram shandy
              Sep 1 '12 at 11:28













              @tristram...please read the edit

              – Avinash Kumar
              Sep 1 '12 at 16:55






              @tristram...please read the edit

              – Avinash Kumar
              Sep 1 '12 at 16:55














              1














              I suggest you to read this page. This document shows you how to boot your personal kernel on qemu and how to use the debugger on it.






              share|improve this answer





























                1














                I suggest you to read this page. This document shows you how to boot your personal kernel on qemu and how to use the debugger on it.






                share|improve this answer



























                  1












                  1








                  1







                  I suggest you to read this page. This document shows you how to boot your personal kernel on qemu and how to use the debugger on it.






                  share|improve this answer















                  I suggest you to read this page. This document shows you how to boot your personal kernel on qemu and how to use the debugger on it.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Sep 2 '12 at 3:00

























                  answered Sep 2 '12 at 0:32









                  FedericoFederico

                  2,7992035




                  2,7992035





















                      1














                      Kernelnewbies is the right place to start kernel hacking. This website contains a set of rich tutorials about kernel hacking and tweaking just for newbie Linux developers. Also, you can join the community and start contributing to some tiny Linux projects.



                      For a quick start, follow the instruction from the "kernel first patch" tutorial. Since you're cloning the "origin" remote repository in this tutorial, you'll work on the latest branches of Linux kernel. So, there's no need to worry about working on an old version of Linux. Meanwhile, if you're not comfortable working with git trees, you can always download the latest version of Linux from front page of "kernel.org".






                      share|improve this answer





























                        1














                        Kernelnewbies is the right place to start kernel hacking. This website contains a set of rich tutorials about kernel hacking and tweaking just for newbie Linux developers. Also, you can join the community and start contributing to some tiny Linux projects.



                        For a quick start, follow the instruction from the "kernel first patch" tutorial. Since you're cloning the "origin" remote repository in this tutorial, you'll work on the latest branches of Linux kernel. So, there's no need to worry about working on an old version of Linux. Meanwhile, if you're not comfortable working with git trees, you can always download the latest version of Linux from front page of "kernel.org".






                        share|improve this answer



























                          1












                          1








                          1







                          Kernelnewbies is the right place to start kernel hacking. This website contains a set of rich tutorials about kernel hacking and tweaking just for newbie Linux developers. Also, you can join the community and start contributing to some tiny Linux projects.



                          For a quick start, follow the instruction from the "kernel first patch" tutorial. Since you're cloning the "origin" remote repository in this tutorial, you'll work on the latest branches of Linux kernel. So, there's no need to worry about working on an old version of Linux. Meanwhile, if you're not comfortable working with git trees, you can always download the latest version of Linux from front page of "kernel.org".






                          share|improve this answer















                          Kernelnewbies is the right place to start kernel hacking. This website contains a set of rich tutorials about kernel hacking and tweaking just for newbie Linux developers. Also, you can join the community and start contributing to some tiny Linux projects.



                          For a quick start, follow the instruction from the "kernel first patch" tutorial. Since you're cloning the "origin" remote repository in this tutorial, you'll work on the latest branches of Linux kernel. So, there's no need to worry about working on an old version of Linux. Meanwhile, if you're not comfortable working with git trees, you can always download the latest version of Linux from front page of "kernel.org".







                          share|improve this answer














                          share|improve this answer



                          share|improve this answer








                          edited Jul 5 '16 at 3:03

























                          answered Jul 4 '16 at 19:36









                          hmofradhmofrad

                          88121221




                          88121221



























                              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.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f12225786%2flinux-kernel-on-virtual-machine%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

                              Top Tejano songwriter Luis Silva dead of heart attack at 64

                              政党

                              天津地下鉄3号線