Interface on the computer motherboard: Interface for serial transmission, it can only transmit 1Bit at a time. the serial port can be used to connect an external modem, a plotter or a serial printer. It can also be connected to network devices such as routers and switches by means of a console connection and is mainly used to configure them. Consumer electronics have been replaced by USB for serial interfaces; however, in non-consumer uses, such as networking devices, serial interfaces are still the primary method of transmission control.

First assign a serial port device to the virtual machine, select Settings->Add->Serial Port. after assigning the serial port device, we need to choose a debugging method for the serial port device, one is to shift the output to a file, or via socket.

If it is just a viewing method, just choose outpu file. If you need to debug, then you can do it via socket method.

The socket way needs to assign /tmp/ to a fixed path, which is given as /tmp/vhost when I debug. from selects Server, To selects An Application. from means where the information comes from, the information is sent from the system in the virtual machine, so the Server is selected here, and if it is a reverse operation, the Client needs to be selected. To also has two options, the first is An Virtual Machine, the second is An Application. used to send the message to another virtual machine, or an application on the host.

Install minicom package for debugging, minicom this thing, not too good, the way to exit is to first press Ctrl + A, and then press q, sometimes it does not always work, I do not know if it is not accepted, or press the wrong.

First minicom -s to initialize, select Serial port setup, press A to edit Serial Device, here you need to note that debugging via socket, you need to use unix# prefix, and then add the path written in the virtual machine unix#/tmp/vhost. Then save, select Exit, and after exiting, actually restart minicom, you will enter the debugging interface of minicom, then open the virtual machine at this time, add a console=ttyS0 parameter to the kernel, you will see the output of minicom display information, you can also interact.

1
2
3
4
5
[    3.855725] [drm:vmw_fb_setcolreg [vmwgfx]] *ERROR* Bad regno 254.
[    3.857125] [drm:vmw_fb_setcolreg [vmwgfx]] *ERROR* Bad regno 255.
deepin Login:

CTRL-A Z for help | unix-socket | NOR | Minicom 2.7.1 | VT102 | Offline | unix#/tmp/vhost

At this point you can interact, the use and tty the same, the last line is the output of minicom, you can see CTRL-A Z can see help, minicom version, and access to the serial port socket.