LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices

Reply
 
Search this Thread
Old 12-01-2009, 07:25 PM   #1
evil_empire
Member
 
Registered: Mar 2005
Distribution: Fedora Core 3
Posts: 176

Rep: Reputation: 31
passing kernel parameter to vms


Hi,
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.
 
Old 12-02-2009, 04:52 AM   #2
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 847

Rep: Reputation: 91
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
 
Old 12-02-2009, 10:31 AM   #3
evil_empire
Member
 
Registered: Mar 2005
Distribution: Fedora Core 3
Posts: 176

Original Poster
Rep: Reputation: 31
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.
 
Old 12-03-2009, 08:21 AM   #4
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 847

Rep: Reputation: 91
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.
 
Old 12-03-2009, 11:44 AM   #5
evil_empire
Member
 
Registered: Mar 2005
Distribution: Fedora Core 3
Posts: 176

Original Poster
Rep: Reputation: 31
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.

peace,

Last edited by evil_empire; 12-03-2009 at 12:42 PM.
 
Old 12-18-2009, 10:57 AM   #6
tacorama
Member
 
Registered: Sep 2009
Distribution: Slackware
Posts: 39

Rep: Reputation: 16
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing a custom parameter to the kernel jkoshi Linux - Kernel 11 07-13-2009 12:54 PM
want to replace $ with \$ in the passing parameter siva512 Linux - Newbie 1 04-03-2008 01:24 PM
passing a file handle as a parameter in c nkoplm Programming 2 02-05-2008 09:28 PM
Passing parameter to kernel when booting from floppy NewtoSlack Slackware 1 10-10-2003 09:24 PM
parameter passing mechanisms dhanakom Programming 2 09-01-2003 05:15 PM


All times are GMT -5. The time now is 05:06 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration