Trouble Logging into Virtual Console on Virtual Server

2014-Jun-07
The Muddling Tech

References:
1. http://biogoo.org/get-virsh-console-working/

I noticed today that I cannot log into a console on my virtual server. Using

sudo virsh console

doesn’t produce an error message, just confirmation that I’m connected to the server and a notice that the escape character is ^], but no log in prompt, and the terminal doesn’t respond to anything that I try. The one thing I can do is exit the terminal with Ctrl+].

I found the reference above that promises to address the issue, so let’s see what happens.

The first step is to copy tty1.conf to ttyS0.conf with

sudo cp /etc/init/tty1.conf /etc/init/ttyS0.conf

Next we’ll change the last line of ttyS0.conf from

exec /sbin/getty -8 38400 tty1

to

exec /sbin/getty -8 115200 ttyS0 xterm

so

sudo /etc/init/ttyS0.conf

and make the appropriate changes.

The other thing we need to do is have grub send its output to the new terminal that we just set up so we get the login prompt and can interact with it.

sudo vi /etc/default/grub

and change the line that reads

GRUB_CMDLINE_LINUX=””

to

GRUB_CMDLINE_LINUX=”console=ttyS0″

Now to reboot the virtual server

exit
sudo virsh reboot

Now testing the new set up,

virsh console <server name>

produces exactly the same prompt, but if I type in my user name now, it prompts for a password and lets me log in to the terminal.

So, thank you, biogoo.

Advertisements
This entry was posted in Linux and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s