title: Define hugepages in qemu using ubuntu without libvirt
body: <p>I am using qemu, with kvm and I load ubuntu 18.04 image, the qemu is loaded with the following command:</p>
  <pre><code>qemu-system-x86_64 -boot c -m 16G -smp 4 -vnc :0 -enable-kvm -drive if=virtio,file=ubuntu.qcow2,cache=none
  </code></pre>
  <p>I <strong>don't</strong> use libvirt.</p>
  <p>I need to change hugepages from the default 2048kb to 1GB.
  I configured my host vm to support this size</p>
  <p><strong>Configuration:</strong></p>
  <pre><code>cat /proc/meminfo | grep Huge
  AnonHugePages:         0 kB
  ShmemHugePages:        0 kB
  FileHugePages:         0 kB
  HugePages_Total:      13
  HugePages_Free:       13
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  Hugepagesize:    1048576 kB
  Hugetlb:        13631488 kB
  </code></pre>
  <p>and in the ubuntu, I configured
  <code>/etc/default/grub</code>
  and added
  <code>GRUB_CMDLINE_LINUX=&quot;default_hugepagesz=1G hugepagesz=1G hugepages=40”</code>
  and then run</p>
  <pre><code>grub-mkconfig -o /boot/grub/grub.cfg 
  </code></pre>
  <p><strong>Execution:</strong>
  after qemu was loaded, in the terminal I run the following commands:</p>
  <pre><code>cat /proc/meminfo | grep Huge 
  AnonHugePages:         0 kB
  ShmemHugePages:        0 kB
  HugePages_Total:       0
  HugePages_Free:        0
  HugePages_Rsvd:        0
  HugePages_Surp:        0
  **Hugepagesize:       2048 kB**
  
  cat /proc/cmdline 
  BOOT_IMAGE=/vmlinuz-4.15.0-137-generic root=/dev/mapper/ubuntu--vg-ubuntu--lv ro default_hugepagesz=1G hugepagesz=1G hugepages=40 maybe-ubiquity
  </code></pre>
  <p>Does anyone have an idea how to define the huge pages to be 1gb in this configuration?</p>