title: How to make Openwrt running on AWS EC2?
body: <p>I have tried two methods to upload openwrt x86_64 image to AWS AMI and run on EC2, but both failed.</p>
  <p>The image I built runs ok on VirutalBox and vmware.</p>
  <h2>The first method - vm_import/export.</h2>
  <p>I followed instruction on <a href="https://amazonaws-china.com/cn/ec2/vm-import/" rel="nofollow noreferrer">https://amazonaws-china.com/cn/ec2/vm-import/</a>, vm_import tool failed and said &quot;Not found initrd in Grub&quot; at last.</p>
  <p>Openwrt doesn't use initrd at boot stage. This is the default boot entry of grub.cfg</p>
  <pre><code>menuentry &quot;OpenWrt&quot; {
          linux /boot/vmlinuz root=PARTUUID=fbdad417-02 rootfstype=ext4 rootwait console=tty0 console=ttyS0,115200n8 noinitrd
  }
  </code></pre>
  <h2>The second method - ec2-bundle-image/ec2-upgrade-image</h2>
  <p>I tried this way, and it can upload image files and metadata files to S3, and I could make a new AMI, and launch EC2 instance. But EC2 instance was not be booted correctly it stop at the <code>grubdom&gt;</code>.</p>
  <p>I followed the instruction of <a href="https://forum.archive.openwrt.org/viewtopic.php?id=41588" rel="nofollow noreferrer">https://forum.archive.openwrt.org/viewtopic.php?id=41588</a>, it seems a little old, I didn't found the aki instance it mentioned and used a alternative one (aki-7077ab11    pv-grub-hd0_1.05-x86_64.gz).</p>
  <p>Whatever the combined image(openwrt default built) or the custom image(release rootfs.tar.gz and copy kernel and grub config to it), both failed, here is EC2 instance system log:</p>
  <pre><code>Xen Minimal OS!
  
    start_info: 0x10d4000(VA)
  
      nr_pages: 0xe504a
  
    shared_inf: 0xeeb28000(MA)
  
       pt_base: 0x10d7000(VA)
  
  nr_pt_frames: 0xd
  
      mfn_list: 0x9ab000(VA)
  
     mod_start: 0x0(VA)
  
       mod_len: 0
  
         flags: 0x300
  
      cmd_line: root=/dev/sda1 ro console=hvc0 4
  
    stack:      0x96a100-0x98a100
  
  MM: Init
  
        _text: 0x0(VA)
  
       _etext: 0x7b824(VA)
  
     _erodata: 0x97000(VA)
  
       _edata: 0x9cce0(VA)
  
  stack start: 0x96a100(VA)
  
         _end: 0x9aa700(VA)
  
    start_pfn: 10e7
  
      max_pfn: e504a
  
  Mapping memory range 0x1400000 - 0xe504a000
  
  setting 0x0-0x97000 readonly
  
  skipped 0x1000
  
  MM: Initialise page allocator for 1809000(1809000)-e504a000(e504a000)
  
  MM: done
  
  Demand map pfns at e504b000-20e504b000.
  
  Heap resides at 20e504c000-40e504c000.
  
  Initialising timer interface
  
  Initialising console ... done.
  
  gnttab_table mapped at 0xe504b000.
  
  Initialising scheduler
  
  Thread &quot;Idle&quot;: pointer: 0x20e504c050, stack: 0x1f10000
  
  Thread &quot;xenstore&quot;: pointer: 0x20e504c800, stack: 0x1f20000
  
  xenbus initialised on irq 3 mfn 0xfeffc
  
  Thread &quot;shutdown&quot;: pointer: 0x20e504cfb0, stack: 0x1f30000
  
  Dummy main: start_info=0x98a200
  
  Thread &quot;main&quot;: pointer: 0x20e504d760, stack: 0x1f40000
  
  &quot;main&quot; &quot;root=/dev/sda1&quot; &quot;ro&quot; &quot;console=hvc0&quot; &quot;4&quot; 
  
  vbd 2049 is hd0
  
  ******************* BLKFRONT for device/vbd/2049 **********
  
  
  
  
  
  backend at /local/domain/0/backend/vbd/27482/2049
  
  2097152 sectors of 512 bytes
  
  **************************
  
  vbd 2064 is hd1
  
  ******************* BLKFRONT for device/vbd/2064 **********
  
  
  
  
  
  backend at /local/domain/0/backend/vbd/27482/2064
  
  8377344 sectors of 512 bytes
  
  **************************
  
  [H[J
  
  
      GNU GRUB  version 0.97  (3752232K lower / 0K upper memory)
  
  
  
  
  
         [ Minimal BASH-like line editing is supported.   For
  
  
           the   first   word,  TAB  lists  possible  command
  
  
           completions.  Anywhere else TAB lists the possible
  
  
           completions of a device/filename. ]
  
  
  
  
  
  
  grubdom&gt;                    
  </code></pre>
  <p>Any idea? thanks.</p>