Running Alpine Linux on QEMU ARM guests












1















I'm trying to build packages for Alpine Linux, which has official support for x86, x86_64, armhf, aarch64, s390x, ppc64le, so I want to build for all of these architectures.



Currently I'm using QEMU's user mode emulation to run chroot environments of these architectures on a x86_64 host, but it seems that it's quite unstable and often lead to crashes. So now I'm trying to run full virtual machines using QEMU.



Installing Alpine Linux for the non-ARM architectures is quite simple and can be done by attaching the .iso images provided in the official download page. However, it's a different story for ARM. There is no other things provided except the archives for netboot and u-boot so I have no idea how to install it. I have tried extracting the archive for netboot and setting -kernel and -initrd to the extracted files but that didn't work. (The full command I used was qemu-system-aarch64 -M vexpress-a9 -kernel vmlinuz-vanilla -initrd initrd-vanilla -append "root=/dev/ram") I got no output in the terminal and Guest had not initialized the display (yet) in the VNC window.



So how can I get the virtual machine booted up? Thanks.










share|improve this question























  • How did you chroot into aarch64 Alpine? I got musl dependency issue.

    – Biswapriyo
    Jan 24 at 21:06






  • 1





    @Biswapriyo github.com/DDoSolitary/alpine-repo/blob/master/build.sh

    – DDoSolitary
    Jan 25 at 0:38
















1















I'm trying to build packages for Alpine Linux, which has official support for x86, x86_64, armhf, aarch64, s390x, ppc64le, so I want to build for all of these architectures.



Currently I'm using QEMU's user mode emulation to run chroot environments of these architectures on a x86_64 host, but it seems that it's quite unstable and often lead to crashes. So now I'm trying to run full virtual machines using QEMU.



Installing Alpine Linux for the non-ARM architectures is quite simple and can be done by attaching the .iso images provided in the official download page. However, it's a different story for ARM. There is no other things provided except the archives for netboot and u-boot so I have no idea how to install it. I have tried extracting the archive for netboot and setting -kernel and -initrd to the extracted files but that didn't work. (The full command I used was qemu-system-aarch64 -M vexpress-a9 -kernel vmlinuz-vanilla -initrd initrd-vanilla -append "root=/dev/ram") I got no output in the terminal and Guest had not initialized the display (yet) in the VNC window.



So how can I get the virtual machine booted up? Thanks.










share|improve this question























  • How did you chroot into aarch64 Alpine? I got musl dependency issue.

    – Biswapriyo
    Jan 24 at 21:06






  • 1





    @Biswapriyo github.com/DDoSolitary/alpine-repo/blob/master/build.sh

    – DDoSolitary
    Jan 25 at 0:38














1












1








1


1






I'm trying to build packages for Alpine Linux, which has official support for x86, x86_64, armhf, aarch64, s390x, ppc64le, so I want to build for all of these architectures.



Currently I'm using QEMU's user mode emulation to run chroot environments of these architectures on a x86_64 host, but it seems that it's quite unstable and often lead to crashes. So now I'm trying to run full virtual machines using QEMU.



Installing Alpine Linux for the non-ARM architectures is quite simple and can be done by attaching the .iso images provided in the official download page. However, it's a different story for ARM. There is no other things provided except the archives for netboot and u-boot so I have no idea how to install it. I have tried extracting the archive for netboot and setting -kernel and -initrd to the extracted files but that didn't work. (The full command I used was qemu-system-aarch64 -M vexpress-a9 -kernel vmlinuz-vanilla -initrd initrd-vanilla -append "root=/dev/ram") I got no output in the terminal and Guest had not initialized the display (yet) in the VNC window.



So how can I get the virtual machine booted up? Thanks.










share|improve this question














I'm trying to build packages for Alpine Linux, which has official support for x86, x86_64, armhf, aarch64, s390x, ppc64le, so I want to build for all of these architectures.



Currently I'm using QEMU's user mode emulation to run chroot environments of these architectures on a x86_64 host, but it seems that it's quite unstable and often lead to crashes. So now I'm trying to run full virtual machines using QEMU.



Installing Alpine Linux for the non-ARM architectures is quite simple and can be done by attaching the .iso images provided in the official download page. However, it's a different story for ARM. There is no other things provided except the archives for netboot and u-boot so I have no idea how to install it. I have tried extracting the archive for netboot and setting -kernel and -initrd to the extracted files but that didn't work. (The full command I used was qemu-system-aarch64 -M vexpress-a9 -kernel vmlinuz-vanilla -initrd initrd-vanilla -append "root=/dev/ram") I got no output in the terminal and Guest had not initialized the display (yet) in the VNC window.



So how can I get the virtual machine booted up? Thanks.







linux virtual-machine qemu arm alpine-linux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 24 at 16:27









DDoSolitaryDDoSolitary

1266




1266













  • How did you chroot into aarch64 Alpine? I got musl dependency issue.

    – Biswapriyo
    Jan 24 at 21:06






  • 1





    @Biswapriyo github.com/DDoSolitary/alpine-repo/blob/master/build.sh

    – DDoSolitary
    Jan 25 at 0:38



















  • How did you chroot into aarch64 Alpine? I got musl dependency issue.

    – Biswapriyo
    Jan 24 at 21:06






  • 1





    @Biswapriyo github.com/DDoSolitary/alpine-repo/blob/master/build.sh

    – DDoSolitary
    Jan 25 at 0:38

















How did you chroot into aarch64 Alpine? I got musl dependency issue.

– Biswapriyo
Jan 24 at 21:06





How did you chroot into aarch64 Alpine? I got musl dependency issue.

– Biswapriyo
Jan 24 at 21:06




1




1





@Biswapriyo github.com/DDoSolitary/alpine-repo/blob/master/build.sh

– DDoSolitary
Jan 25 at 0:38





@Biswapriyo github.com/DDoSolitary/alpine-repo/blob/master/build.sh

– DDoSolitary
Jan 25 at 0:38










1 Answer
1






active

oldest

votes


















2














Finally, I successfully booted the virtual machines up.





aarch64



Simply use a command to the following one:



qemu-system-aarch64 
-M virt -m 512M -cpu cortex-a57 # Required, cortex-a53 is OK too
-kernel vmlinuz-vanilla -initrd initramfs-vanilla # These two files are from the netboot archive
-append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # The console argument is required to get console output
-nographic




armhf



A custom kernel is needed. The one I built is available in my GitHub repo. I used the script from another repo but added some more drivers.



qemu-system-arm 
-M versatilepb -m 256M -cpu arm1176
-kernel vmlinuz -dtb versatile-pb.dtb # From my repo mentioned above
-initrd initramfs-vanilla # From netboot archive
-append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # Same as aarch64
-nographic


UPDATE The official kernel in the netboot archive can also work if used with a proper dtb file, which can be extracted from the Alpine's linux-vanilla package in the main repo. e.g. -M vexpress-a15 -kernel vmlinuz-vanilla -dtb vexpress-v2p-ca15_a7.dtb (another machine type with corresponding dtb should also work)






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%2f1397991%2frunning-alpine-linux-on-qemu-arm-guests%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









    2














    Finally, I successfully booted the virtual machines up.





    aarch64



    Simply use a command to the following one:



    qemu-system-aarch64 
    -M virt -m 512M -cpu cortex-a57 # Required, cortex-a53 is OK too
    -kernel vmlinuz-vanilla -initrd initramfs-vanilla # These two files are from the netboot archive
    -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # The console argument is required to get console output
    -nographic




    armhf



    A custom kernel is needed. The one I built is available in my GitHub repo. I used the script from another repo but added some more drivers.



    qemu-system-arm 
    -M versatilepb -m 256M -cpu arm1176
    -kernel vmlinuz -dtb versatile-pb.dtb # From my repo mentioned above
    -initrd initramfs-vanilla # From netboot archive
    -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # Same as aarch64
    -nographic


    UPDATE The official kernel in the netboot archive can also work if used with a proper dtb file, which can be extracted from the Alpine's linux-vanilla package in the main repo. e.g. -M vexpress-a15 -kernel vmlinuz-vanilla -dtb vexpress-v2p-ca15_a7.dtb (another machine type with corresponding dtb should also work)






    share|improve this answer






























      2














      Finally, I successfully booted the virtual machines up.





      aarch64



      Simply use a command to the following one:



      qemu-system-aarch64 
      -M virt -m 512M -cpu cortex-a57 # Required, cortex-a53 is OK too
      -kernel vmlinuz-vanilla -initrd initramfs-vanilla # These two files are from the netboot archive
      -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # The console argument is required to get console output
      -nographic




      armhf



      A custom kernel is needed. The one I built is available in my GitHub repo. I used the script from another repo but added some more drivers.



      qemu-system-arm 
      -M versatilepb -m 256M -cpu arm1176
      -kernel vmlinuz -dtb versatile-pb.dtb # From my repo mentioned above
      -initrd initramfs-vanilla # From netboot archive
      -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # Same as aarch64
      -nographic


      UPDATE The official kernel in the netboot archive can also work if used with a proper dtb file, which can be extracted from the Alpine's linux-vanilla package in the main repo. e.g. -M vexpress-a15 -kernel vmlinuz-vanilla -dtb vexpress-v2p-ca15_a7.dtb (another machine type with corresponding dtb should also work)






      share|improve this answer




























        2












        2








        2







        Finally, I successfully booted the virtual machines up.





        aarch64



        Simply use a command to the following one:



        qemu-system-aarch64 
        -M virt -m 512M -cpu cortex-a57 # Required, cortex-a53 is OK too
        -kernel vmlinuz-vanilla -initrd initramfs-vanilla # These two files are from the netboot archive
        -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # The console argument is required to get console output
        -nographic




        armhf



        A custom kernel is needed. The one I built is available in my GitHub repo. I used the script from another repo but added some more drivers.



        qemu-system-arm 
        -M versatilepb -m 256M -cpu arm1176
        -kernel vmlinuz -dtb versatile-pb.dtb # From my repo mentioned above
        -initrd initramfs-vanilla # From netboot archive
        -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # Same as aarch64
        -nographic


        UPDATE The official kernel in the netboot archive can also work if used with a proper dtb file, which can be extracted from the Alpine's linux-vanilla package in the main repo. e.g. -M vexpress-a15 -kernel vmlinuz-vanilla -dtb vexpress-v2p-ca15_a7.dtb (another machine type with corresponding dtb should also work)






        share|improve this answer















        Finally, I successfully booted the virtual machines up.





        aarch64



        Simply use a command to the following one:



        qemu-system-aarch64 
        -M virt -m 512M -cpu cortex-a57 # Required, cortex-a53 is OK too
        -kernel vmlinuz-vanilla -initrd initramfs-vanilla # These two files are from the netboot archive
        -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # The console argument is required to get console output
        -nographic




        armhf



        A custom kernel is needed. The one I built is available in my GitHub repo. I used the script from another repo but added some more drivers.



        qemu-system-arm 
        -M versatilepb -m 256M -cpu arm1176
        -kernel vmlinuz -dtb versatile-pb.dtb # From my repo mentioned above
        -initrd initramfs-vanilla # From netboot archive
        -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/ # Same as aarch64
        -nographic


        UPDATE The official kernel in the netboot archive can also work if used with a proper dtb file, which can be extracted from the Alpine's linux-vanilla package in the main repo. e.g. -M vexpress-a15 -kernel vmlinuz-vanilla -dtb vexpress-v2p-ca15_a7.dtb (another machine type with corresponding dtb should also work)







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 28 at 13:00

























        answered Jan 28 at 7:28









        DDoSolitaryDDoSolitary

        1266




        1266






























            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%2f1397991%2frunning-alpine-linux-on-qemu-arm-guests%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

            "Incorrect syntax near the keyword 'ON'. (on update cascade, on delete cascade,)

            Alcedinidae

            RAC Tourist Trophy