发布网友 发布时间:2022-12-28 12:33
共1个回答
热心网友 时间:2023-10-23 03:57
The /usr/lib/systemd/system/getty@.servicefile is responsible for the virtual terminals (/dev/tty[X]). /usr/lib/systemd/system/serial-getty@.serviceis responsible for all other terminals, such as a serial terminal on /dev/ttyS0.
Systemd provides a template unit file for serial getty. Template file can be found here /lib/systemd/system/serial-getty@.service
There are many cloud platforms which are working in Linux virtualisation on back-end. In terms of connectivity we have better option in KVM, which connect it through serial console.
In this post we would see how we could connect Ubuntu17.04 KVM Virtual machine through serial console. I remember in earlier version and distributions, it need to configure serial console in grub file, but in Ubuntu its very easy and reliable as most of configurations and settings are already configured in OS.
let’s see how things happened here …
For this post, we are using Ubuntu-17.04 Guest Machine on Ubuntu-16.04 Host machine.
How to setup serial console, for same we have to connect machine and login on as root user.
We could connect on KVM Guest machine through SSH from Host Machine.
We could connect Guest machine through VNC Viewer and could setup Serial console from there. Configuring and connecting VNC viewer posted here . This could be best option to connect Guest machine in any troubleshooting because it could configure without any network connectivity, this also make it same control which we have in serial console with Graphical User Interface from remote host.
This is Graphical User interface on Host Machine. For this we should have access to Host Machine or Graphical desktop from remote through SSH or VNC.
Above package should installed for this command. Like in below image we could connect KVM Guest machine.
Configure a serial console in the Ubuntu guest
After getting login console we need to start serial console and enable it with below two commands.
Now we could connect serial console in easy way with virsh console command.
以下方法: 在centos6.5也适用