0

How to start a KVM-guest as single user mode?

When I tried to start the VM as sigle user mode, it displayed "Booting a command line" on the screen and got stucked. This guest VM starts fine as multi user mode.

Here is the procedure I did:

  1. Start a guest VM on a Host.

    $ virsh start --console myguestvm
    
  2. Select a menu on grub menu and press e.

  3. Edit a line below and add "single" parameter

    linux /boot/vmlinuz-3.11.0-20-generic root=UUID=XXXXX ro quiet splash $vt_handoff
    
  4. Then press ctrl + x.

Thanks in advance.

g_p
  • 18,504
  • Use the link for reference :http://askubuntu.com/questions/132965/how-do-i-boot-into-single-user-mode-from-grub – BDRSuite Jan 06 '15 at 09:09

1 Answers1

2

Remove the $vt_handoff, quiet, and splash parts of the line.

The vt_handoff option causes the kernel not to display the text console so that there can be a flickerless transition to Xwindows when it starts up, which is why you don't see anything when you boot to single user mode. The splash option tells plymouth to show the pretty splash screen, and the quiet option suppresses a bunch of text console output.

psusi
  • 37,551
  • @guntbert, good point ;) – psusi Jan 06 '15 at 23:07
  • I removed the $vt_handoff, quiet and splash, then add single. But the situation didn't change. What do I miss?

    BTW, when I just removed the $vt_handoff, quiet and splash, it displayed "Booting a command list" message and no message but login prompt displayed.

    – matsuzaki Jan 07 '15 at 04:20
  • @matsuzaki, when you do log in, run tty and what does it say? I'm not sure how your virtualization is set up, but it could be that the console is a special virtual device and you'd need to pass "console=/dev/whatever" to redirect the standard linux console there. – psusi Jan 07 '15 at 14:04
  • when i logged in and ran "tty", it said "/dev/ttyS0". How do I tell "console=/dev/ttyS0" to kvm when I start the vm? – matsuzaki Jan 08 '15 at 01:18
  • @matsuzaki, if you are having the vm bootstrap itself with grub, you need to add that to the kernel command line in your grub config. – psusi Jan 08 '15 at 02:25
  • Thank you 4 your advice. I added "console=tty0 console=ttyS0,115200n8 single" to the kernel command line, then I can see single user mode prompt. – matsuzaki Jan 09 '15 at 08:49