# Pass kernel commandline parameter when not using direct kernel boot

**URL:** <https://forum.opennebula.io/t/pass-kernel-commandline-parameter-when-not-using-direct-kernel-boot/9781>\
**Category:** Installation & Configuration\
**Tags:** solved\
**Created:** [August 2, 2021, 7:05am UTC](https://forum.opennebula.io/t/pass-kernel-commandline-parameter-when-not-using-direct-kernel-boot/9781 "2021-08-02T07:05:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cursedclock](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cursedclock/32/7067_2.png) [@cursedclock](https://forum.opennebula.io/u/cursedclock)\
**Post date:** [August 2, 2021, 7:05am UTC](https://forum.opennebula.io/t/pass-kernel-commandline-parameter-when-not-using-direct-kernel-boot/9781/1 "2021-08-02T07:05:23Z")

</div>

Is there any way to pass a kernel cmd parameter when booting a vm made from a template image?  
From what I understand kernel\_cmd only works for when you select a kernel from the files datastore and is not handled by the contextualisation framework.  
Does the official linux contextualisation support passing in kernel params through some other option or is this feature nonexistent.  
I figured there has to be some sort of mechanism for this since the provisioner might might to force some options for the vm without giving the user the ability to turn it off. (eg. mounting rootfs with certain flags)

---

<div class="post-metadata">

**Author:** ![vholer](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/vholer/32/4392_2.png) [@vholer](https://forum.opennebula.io/u/vholer)\
**Post date:** [August 2, 2021, 11:06am UTC](https://forum.opennebula.io/t/pass-kernel-commandline-parameter-when-not-using-direct-kernel-boot/9781/2 "2021-08-02T11:06:16Z")

</div>

Hello,

when kernel is selected and executed by the boot loader in the VM, there is currently no way to pass custom kernel arguments from the OpenNebula into the OS instance.

Best,  
Vlastimil

---

<div class="post-metadata">

**Author:** ![cursedclock](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/cursedclock/32/7067_2.png) [@cursedclock](https://forum.opennebula.io/u/cursedclock)\
**Post date:** [August 2, 2021, 1:50pm UTC](https://forum.opennebula.io/t/pass-kernel-commandline-parameter-when-not-using-direct-kernel-boot/9781/3 "2021-08-02T13:50:36Z")

</div>

Ah, that’s a shame. Is this a feature that can easily be added to the contextualization package to pass the kernel params to libvirt/qemu? Or is that a route not worth exploring?

---

<div class="post-metadata">

**Author:** ![vholer](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/vholer/32/4392_2.png) [@vholer](https://forum.opennebula.io/u/vholer)\
**Post date:** [August 6, 2021, 11:07am UTC](https://forum.opennebula.io/t/pass-kernel-commandline-parameter-when-not-using-direct-kernel-boot/9781/4 "2021-08-06T11:07:44Z")

</div>

Context packages would have to reconfigure the boot loader inside the running VM to pass extra parameters to the kernel and trigger a reboot. So machine would have to pass through two boot sequences. The only real problem is to reconfigure various boot loaders correctly (e.g., GRUB in /etc/default/grub and trigger update-grub2 on Debian or grub2-mkconfig on RedHats or sed `/boot/loader/entries/...`, syslinux on Alpine, …). It’s not impossible, but since it requires booting into a VM first, it doesn’t cover the problem when kernel arguments need to be adapted right from the start…

You can always make a feature request in [Issues · OpenNebula/addon-context-linux · GitHub](https://github.com/OpenNebula/addon-context-linux/issues), or even contribute the change on your own 😉 .
