Skip to content

Instantly share code, notes, and snippets.

@itzurabhi
Last active October 3, 2025 09:33
Show Gist options
  • Select an option

  • Save itzurabhi/a760155c28c0e34ebb14ccf10f08d47b to your computer and use it in GitHub Desktop.

Select an option

Save itzurabhi/a760155c28c0e34ebb14ccf10f08d47b to your computer and use it in GitHub Desktop.

Revisions

  1. itzurabhi revised this gist May 5, 2021. No changes.
  2. itzurabhi revised this gist Jul 14, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion UB18-Qemu-AARCH64.md
    Original file line number Diff line number Diff line change
    @@ -35,4 +35,4 @@ cp ubuntu-18.04-server-cloudimg-arm64.img ubuntu-18.04-server-cloudimg-arm64.img


    # qemu boot
    ```sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=ubuntu-18.04-server-cloudimg-arm64.img,id=hd0 -drive file=user-data.img,format=raw,id=cloud -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0```
    ```sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=ubuntu-18.04-server-cloudimg-arm64.img,id=hd0 -drive file=user-data.img,format=raw,id=cloud -device virtio-blk-device,drive=hd0 -net user,hostfwd=tcp::30022-:22 -net nic -vnc :3```
  3. itzurabhi revised this gist Jul 14, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion UB18-Qemu-AARCH64.md
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,8 @@ sudo apt install qemu-system-arm qemu-system-mips qemu-efi-aarch64 qemu-kvm qemu
    ```

    # Prepare the EFI partition
    ```dd if=/dev/zero of=flash0.img bs=1M count=64
    ```
    dd if=/dev/zero of=flash0.img bs=1M count=64
    dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
    dd if=/dev/zero of=flash1.img bs=1M count=64
    ```
  4. itzurabhi revised this gist Jul 10, 2020. 1 changed file with 8 additions and 4 deletions.
    12 changes: 8 additions & 4 deletions UB18-Qemu-AARCH64.md
    Original file line number Diff line number Diff line change
    @@ -19,11 +19,15 @@ chpasswd: { expire: False }
    ssh_pwauth: True
    EOF
    ```
    #create a user-data image
    cloud-localds user-data.img user-data
    # create a user-data image to initialize the VM with
    ```cloud-localds user-data.img user-data```

    #download img
    ```wget "http://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-arm64.img"
    # download ubuntu image

    ```
    wget "http://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-arm64.img"
    # create a backup, VM will modify the image.
    cp ubuntu-18.04-server-cloudimg-arm64.img ubuntu-18.04-server-cloudimg-arm64.img.orig
    ```

  5. itzurabhi revised this gist Jul 10, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion UB18-Qemu-AARCH64.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,8 @@ dd if=/dev/zero of=flash1.img bs=1M count=64
    ```

    # Set the credentials for the user
    ```cat >user-data <<EOF
    ```
    cat >user-data <<EOF
    #cloud-config
    password: thepassword
    chpasswd: { expire: False }
  6. itzurabhi revised this gist Jul 10, 2020. 1 changed file with 13 additions and 8 deletions.
    21 changes: 13 additions & 8 deletions UB18-Qemu-AARCH64.md
    Original file line number Diff line number Diff line change
    @@ -1,27 +1,32 @@
    # Install the dependecies
    sudo apt update

    ```sudo apt update
    sudo apt install qemu-system-arm qemu-system-mips qemu-efi-aarch64 qemu-kvm qemu-efi cloud-image-utils
    ```

    # Prepare the EFI partition
    dd if=/dev/zero of=flash0.img bs=1M count=64
    ```dd if=/dev/zero of=flash0.img bs=1M count=64
    dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
    dd if=/dev/zero of=flash1.img bs=1M count=64
    ```


    cat >user-data <<EOF
    # Set the credentials for the user
    ```cat >user-data <<EOF
    #cloud-config
    password: juniper2020
    password: thepassword
    chpasswd: { expire: False }
    ssh_pwauth: True
    EOF

    ```
    #create a user-data image
    cloud-localds user-data.img user-data

    #download img
    wget "http://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-arm64.img"
    ```wget "http://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-arm64.img"
    cp ubuntu-18.04-server-cloudimg-arm64.img ubuntu-18.04-server-cloudimg-arm64.img.orig
    ```



    # qemu boot
    sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=ubuntu-18.04-server-cloudimg-arm64.img,id=hd0 -drive file=user-data.img,format=raw,id=cloud -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0
    ```sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=ubuntu-18.04-server-cloudimg-arm64.img,id=hd0 -drive file=user-data.img,format=raw,id=cloud -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0```
  7. itzurabhi created this gist Jul 10, 2020.
    27 changes: 27 additions & 0 deletions UB18-Qemu-AARCH64.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    # Install the dependecies
    sudo apt update
    sudo apt install qemu-system-arm qemu-system-mips qemu-efi-aarch64 qemu-kvm qemu-efi cloud-image-utils

    # Prepare the EFI partition
    dd if=/dev/zero of=flash0.img bs=1M count=64
    dd if=/usr/share/qemu-efi/QEMU_EFI.fd of=flash0.img conv=notrunc
    dd if=/dev/zero of=flash1.img bs=1M count=64


    cat >user-data <<EOF
    #cloud-config
    password: juniper2020
    chpasswd: { expire: False }
    ssh_pwauth: True
    EOF

    #create a user-data image
    cloud-localds user-data.img user-data

    #download img
    wget "http://cloud-images.ubuntu.com/releases/bionic/release/ubuntu-18.04-server-cloudimg-arm64.img"



    # qemu boot
    sudo qemu-system-aarch64 -m 1024 -cpu cortex-a57 -M virt -nographic -pflash flash0.img -pflash flash1.img -drive if=none,file=ubuntu-18.04-server-cloudimg-arm64.img,id=hd0 -drive file=user-data.img,format=raw,id=cloud -device virtio-blk-device,drive=hd0 -netdev type=tap,id=net0 -device virtio-net-device,netdev=net0