On 03.10.2015 00:07, poma wrote:
Hi Fi,
cmdline: console=hvc0 systemd.wants=getty@hvc0
Connect via virt-manager - View / Text Consoles / Text Console no.:
Fedora 24 (Rawhide)
Kernel 4.3.0-0.rc3.git2.4.fc24.x86_64 on an x86_64 (hvc0)
localhost login: root
Last login: Fri Oct 2 17:28:36 on hvc0
# tty
/dev/hvc0
# systemctl status getty(a)hvc0.service
● getty(a)hvc0.service - Getty on hvc0
Loaded: loaded (/usr/lib/systemd/system/getty@.service; enabled; vendor preset:
enabled)
Active: active (running) since Fri 2015-10-02 17:28:39 EDT; 26s ago
Docs: man:agetty(8)
man:systemd-getty-generator(8)
http://0pointer.de/blog/projects/serial-console.html
Main PID: 2034 (login)
CGroup: /system.slice/system-getty.slice/getty(a)hvc0.service
‣ 2034 login -- root
Oct 02 17:28:39 localhost systemd[1]: Started Getty on hvc0.
It obviously works.
Connect via virsh:
# virsh console <domain> console1
Connected to domain <domain>
Escape character is ^]
error: operation failed: Active console session exists for this domain
# virsh console --devname console1 <domain>
Connected to domain <domain>
Escape character is ^]
error: operation failed: Active console session exists for this domain
Obviously does not work.
Is it possible to connect hvc via virsh, if domain/guest is started with the
virt-manager?
Is it possible at all, to connect hypervisor virtual console via virsh?
The answer is, of course!
Connect via virt-manager - View / Text Consoles / Text Console 1:
Fedora 24 (Rawhide)
Kernel 4.3.0-0.rc3.git2.4.fc24.x86_64 on an x86_64 (hvc0)
localhost login: root
# tty
/dev/hvc0
# cat /proc/cmdline
BOOT_IMAGE=vmlinuz0 initrd=initrd0.img root=live:CDLABEL=Rawhide-Xfce-Live-1001
rootfstype=auto ro rd.live.image console=hvc0 systemd.wants=getty@hvc0 console=hvc1
systemd.wants=getty@hvc1
Connect via virsh to "Text Console 2":
# virsh console <domain> console0
Connected to domain <domain>
Escape character is ^]
error: operation failed: Active console session exists for this domain
- This console is obviously busy!
# virsh console <domain> console1
Connected to domain <domain>
Escape character is ^]
Fedora 24 (Rawhide)
Kernel 4.3.0-0.rc3.git2.4.fc24.x86_64 on an x86_64 (hvc1)
localhost login: root
Last login: Fri Oct 2 18:41:46 on hvc0
# tty
/dev/hvc1
Conclusion:
It is necessary to shutdown domain/guest and disconnect from hypervisor, after the
connection established via virt-manager, to free up a slot for next connection, via
virsh.
And vice versa.
Even better is if defined more "Text Consoles" i.e. hypervisor virtual consoles,
as shown here.