-   Linux - Virtualization and Cloud (
-   -   passing kernel parameter to vms (

evil_empire 12-01-2009 06:25 PM

passing kernel parameter to vms
I am using Xen in CentOS 5.4. The guest vm is Centos 5.4 as well. How can I specify boot parameters before I can boot the VMs. I seem to have forgotten the root password for one of the VMs I created. I want to boot it into repair mode and change the password. Please suggest me the best way to achieve this.
Also, I tried to mount the vm disk image file but failed.

dyasny 12-02-2009 03:52 AM

kernel params for the VM are passed the same way as you would pass a normal machine - using the console, edit the kernel line in grub.
It really has nothing to do with virtualization

evil_empire 12-02-2009 09:31 AM

My question has everything to do with virtualization. I think you did not understand my problem well enough. I can't access the centos vm after booting it because I forgot the root password I set. So there is no way of modifying the grub config. I want to be able to pass a boot parameter, i.e., "single" so that the vm boots into single user mode which does not require a password. I could change the root password then.

I managed to mount the vm image file very painfully and have edited the config and set a new password. But I'd still like to know if and it is possible to pass boot parameter to guest linux guest vms beforehand. I tried using the "extra=whatever you want" line in vm config file but didn't work.

dyasny 12-03-2009 07:21 AM

I'm afraid you do not understand what virtualization is, and how it works. You cannot pass OS level commands like that, unless the guest OS has a daemon listening for the command (usually over the hypercall device or simply over a network socket).
you can also pass keystrokes using qemuMonitor sendKey commands, but that's all.

Correct me if I'm wrong, but maybe you're just not bringing the console up fast enough, to be able to stop the grub prompt and enter the "single" option. In that case, it is possible to start qemu in paused mode, bring up the VNC console, and then unpause the VM, which gives you enough time for everything.

evil_empire 12-03-2009 10:44 AM

I am afraid I wasn't asking for assessment on my virtualization knowledge.

Anywho, my problem was resolved. I mounted the vm disk image and modified the grub config file to boot into into single mode and did the password change.


tacorama 12-18-2009 09:57 AM

you could have also booted off of a live linux iso file instead of virtual HDD image and modified the /etc/passwd or /etc/shadow for user root

All times are GMT -5. The time now is 11:45 PM.