Re: [ovirt-users] ovirt-vmconsole serial

2016-05-04 Thread Michal Skrivanek

> On 03 May 2016, at 13:08, Gianluca Cecchi  wrote:
> 
> Hello,
> I attach to this thread to detail how I was able to have serial console 
> working both on CentOS 6.7 and CentOS 7.2 VMs on 3.6.5
> 
> - CentOS 6.7
> Basically what described in general here (but using ttyS0 instead ttyS1):
> http://www.cyberciti.biz/faq/centos-rhel-6-install-serial-console/ 
> 
> 
> So in /boot/grub/grub.conf 
> 
> a) right before the "hiddenmenu" line:
> 
> serial --unit=0 --speed=19200 --word=8 --parity=no --stop=1
> terminal --timeout=5 serial console
> 
> b) At the end of kernel line added:
> console=tty0 console=ttyS0,19200n8
> 
> Added at the end of /etc/securetty the line
> ttyS0
> 
> Only difference is that as I used ttyS0, the upstart configuration was not 
> needed: the system after reboot was already listening on ttyS0
> Creating upstart config file generated 2 processes listening on ttyS0
> 
> 
> - CentOS 7.2
> created VM with virtio console enabled in options and basically following 
> what described here
> https://www.youtube.com/watch?v=Sx2HRwFqG7o 
> 
> 
> from default configuration I got after install:
> 
> Add in /etc/default/grub "console=ttyS0" in GRUB_CMDLINE_LINUX so that it is 
> now:
> GRUB_CMDLINE_LINUX="rd.lvm.lv =centos/root rd.lvm.lv 
> =centos/swap rhgb quiet console=ttyS0"
> 
> grub2-mkconfig -o /boot/grub2/grub.cfg
> 
> reboot the VM
> 
> From a client:
> $ ssh -t -p  ovirt-vmcons...@ovirt.lutwyn.org 
>  connect
> Available Serial Consoles:
> 00 c6desktop[68a82ada-a1d2-44d0-85b0-f3a08cc2f579]
> 01 c7desktop[787f46f6-de4a-4b42-ba39-9609908c2905]
> SELECT> 01
> 
> CentOS Linux 7 (Core)
> Kernel 3.10.0-327.13.1.el7.x86_64 on an x86_64
> 
> Host-006 login: root
> Password: 
> Last login: Tue May  3 01:34:57 on pts/0
> [root@Host-006 ~]# 
> [root@Host-006 ~]# 
> [root@Host-006 ~]# cat /etc/redhat-release
> CentOS Linux release 7.2.1511 (Core) 
> [root@Host-006 ~]# exit

Hi Gianluca,
would you care to extend 
http://www.ovirt.org/documentation/admin-guide/serial-console-setup/ with this 
useful info? I suppose there are quite a few people who would find handy some 
tips how to set it up for various guest OSes

Thanks,
michal

> 
> HIH,
> Gianluca
> ___
> Users mailing list
> Users@ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] ovirt-vmconsole serial

2016-05-03 Thread Gianluca Cecchi
Hello,
I attach to this thread to detail how I was able to have serial console
working both on CentOS 6.7 and CentOS 7.2 VMs on 3.6.5

- CentOS 6.7
Basically what described in general here (but using ttyS0 instead ttyS1):
http://www.cyberciti.biz/faq/centos-rhel-6-install-serial-console/

So in /boot/grub/grub.conf

a) right before the "hiddenmenu" line:

serial --unit=*0 *--speed=19200 --word=8 --parity=no --stop=1
terminal --timeout=5 serial console

b) At the end of kernel line added:
console=tty0 console=ttyS*0*,19200n8

Added at the end of /etc/securetty the line
ttyS0

Only difference is that as I used ttyS0, the upstart configuration was not
needed: the system after reboot was already listening on ttyS0
Creating upstart config file generated 2 processes listening on ttyS0


- CentOS 7.2
created VM with virtio console enabled in options and basically following
what described here
https://www.youtube.com/watch?v=Sx2HRwFqG7o

from default configuration I got after install:

Add in /etc/default/grub "console=ttyS0" in GRUB_CMDLINE_LINUX so that it
is now:
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
console=ttyS0"

grub2-mkconfig -o /boot/grub2/grub.cfg

reboot the VM

>From a client:
$ ssh -t -p  ovirt-vmcons...@ovirt.lutwyn.org connect
Available Serial Consoles:
00 c6desktop[68a82ada-a1d2-44d0-85b0-f3a08cc2f579]
01 c7desktop[787f46f6-de4a-4b42-ba39-9609908c2905]
SELECT> 01

CentOS Linux 7 (Core)
Kernel 3.10.0-327.13.1.el7.x86_64 on an x86_64

Host-006 login: root
Password:
Last login: Tue May  3 01:34:57 on pts/0
[root@Host-006 ~]#
[root@Host-006 ~]#
[root@Host-006 ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@Host-006 ~]# exit

HIH,
Gianluca
___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


Re: [ovirt-users] ovirt-vmconsole serial

2016-04-25 Thread Nathanaël Blanchet

Le 24/04/2016 19:49, Paul Groeneweg | Pazion a écrit :
I have followed the setup on 
http://www.ovirt.org/documentation/admin-guide/serial-console-setup/


I am able to ssh to the hosted engine and select a VM.
A VM with console enabled and permissions set gives a blank screen ( 
freezes ).

Many reasons can lead to this, depending on the guest os.
Have you modified all needed files into the guest OS?

 This is what I did for my vms (tty0 is to get the boot sequence into 
the spice/vnc console insted of a black screen)


CentOS 5:

 * grub.conf

for i in $(cat /tmp/update_grub); do ssh root@$i 'sed -e 
"s/^\\t\(kernel\).*$/&*console\=tty0 console\=ttyS0*/g" -i 
/etc/grub.conf'; done


 * inittab

for i in $(cat /tmp/liste) ; do echo $i; ssh root@$i "sed -i \"/tty6/a 
*S0:2345:respawn:/sbin/mingetty ttyS0*\" /etc/inittab"; done


 * securetty

for i in $(cat /tmp/liste) ; do echo $i; ssh root@$i "sed -i \"/tty11/a 
*ttyS0*\" /etc/securetty"; done


CentOS 6:

 * grub.conf

for i in $(cat /tmp/update_grub); do ssh root@$i 'sed -e 
"s/^\\t\(kernel\).*$/&*console\=tty0 console\=ttyS0*/g" -i 
/etc/grub.conf'; done


 * securetty

for i in $(cat /tmp/liste) ; do echo $i; ssh root@$i "sed -i \"/tty11/a 
*ttyS0*\" /etc/securetty"; done


CentOS 7 : securetty file already includes ttyS0 by default

 * grub2.cfg

for i in $(cat /tmp/update_grub2);do echo -e "$i:\n"; ssh root@$i 'sed 
-e "s/^\\t\(linux16\).*$/&*console\=tty0 console\=ttyS0*/g" -i 
/boot/grub2/grub.cfg'; done
for i in $(cat /tmp/update_grub2);do echo -e "$i:\n"; ssh root@$i 
'grub2-mkconfig -o /boot/grub2/grub.cfg'; done


As a last alternative, grubby does the staff on every OS and grub 
versions, but doesn't modify the securetty file.


 * grubby

for i in $(cat /tmp/update_grub2);do echo -e "$i:\n"; ssh root@$i 
"grubby --update-kernel=ALL --args=\"console=tty0 console=ttyS0\""; done


So I checked serial-getty@.service

So you run el7 :)

Am I right this service should run on a host?

Sure, but not enough


When I check status, I get this:

... systemd[1]: *Dependency failed for Serial Getty on hvc0.*

.. systemd[1]: *Job serial-getty@hvc0.service/start failed with result 
'dependency'.*


*
*

What needs to be done? When I restart the service it takes a long tine 
and looks like a timeout is triggered.



you can check if ttyS0 is opened with  stty < /dev/ttyS0
If true, the issue might come from a right permission.
Did you add the wanted user (doesn't work with group) per vm with the 
minimum UserVmManager role?
if the user is SuperUser, it still can't connect to the console due to a 
bug.


Looking forward to use the serial console feature.


it works very well and it is very convinient:)

Just a last tip : the default escape character to escape from ssh is "~."

Good luck!


*
*



___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users


--
Nathanaël Blanchet

Supervision réseau
Pôle Infrastrutures Informatiques
227 avenue Professeur-Jean-Louis-Viala
34193 MONTPELLIER CEDEX 5   
Tél. 33 (0)4 67 54 84 55
Fax  33 (0)4 67 54 84 14
blanc...@abes.fr

___
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users