I'm using KVM to run multiple virtual machines under Redhat Enterprise Linux server 5.5. I've installed FreeBSD 7.x 64 bit as guest operating systems. How do I redirect the FreeBSD version 6, 7 or 8 virtual machine console to a serial port using virsh console command for management purpose from host itself?
FreeBSD does support a dumb terminal on a serial port as a console. This is useful for quick login or debug guest system problem without using ssh. First, login as root using ssh to your guest operating systems:
$ ssh vivek@freebsd.nixcraft.in
su -
Edit /boot/loader.conf, enter:
# vi /boot/loader.conf
Append the following entry:
console="comconsole"
Save and close the file. Edit /etc/ttys, enter:
# vi /etc/ttys
Find the line that read as follows:
ttyd0 "/usr/libexec/getty std.9600" dialup off secure
Update it as follows:
ttyd0 "/usr/libexec/getty std.9600" vt100 on secure
Save and close the file. Reboot the guest, enter:
# reboot
After reboot, you can connect to FreeBSD guest as follows from host (first guest the list of running guest operating systems):
# virsh list
Sample outputs:
Id Name State ---------------------------------- 3 ographics running 4 freebsd running
Now, connect to Freebsd guest, enter:
virsh console 4
OR
virsh console freebsd
Sample outputs:
References:
- Setting Up the Serial Console
- man pages virsh (Linux), boot (FreeBSD)
- CentOS / Redhat: Install KVM Virtualization Software
- CentOS / Redhat: KVM Bridged Network Configuration
- KVM virt-manager: Install CentOS As Guest Operating System
- KVM virt-install: Install FreeBSD / CentOS As Guest Operating System
- KVM: Install CentOS / RHEL Using Kickstart File (Automated Installation)
- Troubleshooting KVM Virtualization Problem With Log Files
- KVM Virsh: Redirect FreeBSD Console To A Serial Port
- KVM: Starting / Stopping Guest Operating Systems With virsh Command
- Linux KVM: Disable virbr0 NAT Interface
- FreeBSD / OpeBSD Running in KVM Does Not Accept FTP Traffic
- KVM: Start a Virtual Machine / Guest At Boot Time
- KVM virt-install: Install OpenBSD As Guest Operating System
- Linux KVM: OpenBSD Guest Hangs At Starting tty Flags
- KVM Virtualization: Start VNC Remote Access For Guest Operating Systems















{ 1 comment… read it below or add one }
I think you have a typo: ttyd0 had to be ttyu0 for me to get this working.
I just found it in the reference link you posted :)
Thanks!