Are you trying to redirect FreeBSD Console To A Serial Port?
This guide is for you.
We use KVM to run multiple virtual machines under Redhat Enterprise Linux.
FreeBSD is an operating system for a variety of platforms that focuses on features, speed, and stability.
In this context, you will see how to redirect FreeBSD version 6, 7, or 8 virtual machine console to a serial port using virsh console command for management purpose from the host itself.
Steps to Redirect FreeBSD Console To A Serial Port in KVM using virsh ?
The below steps are followed by our Support Experts for this redirection using virsh.
1. First, we need to log in as root using ssh to guest operating systems.
We can use the following command:
$ ssh firstname.lastname@example.org
2. After that we need to edit /boot/loader.conf.
# vi /boot/loader.conf
Append the following entry:
We can save and exit the file.
3. Then edit /etc/ttys as given below:
# vi /etc/ttys
We need to replace the below line:
ttyd0 "/usr/libexec/getty std.9600" dialup off secure
With the following line:
ttyd0 "/usr/libexec/getty std.9600" vt100 on secure
Now, we can save and exit the file.
4. To reboot the guest we can use the following command:
After reboot, we can connect to FreeBSD guest as follows from the host.
We will first list the running guest operating systems using the following command:
# virsh list
Id Name State
3 ographics running
4 freebsd running
Once the list gets displayed we can choose FreeBSD from it.
5. Finally, we can connect to Freebsd guest using either of the following commands:
virsh console 4
virsh console freebsd