KVM Virsh: Redirect FreeBSD Console To A Serial Port

by on June 3, 2010 · 1 comment· LAST UPDATED February 1, 2011

in , ,

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:

Fig.01: Virsh console connected to FreeBSD guest

Fig.01: Virsh console connected to FreeBSD guest

References:



If you would like to be kept up to date with our posts, you can follow us on Twitter, Facebook, Google+, or even by subscribing to our RSS Feed.


{ 1 comment… read it below or add one }

1 G June 14, 2012 at 11:29 am

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!

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , , , , , , , , , , ,

Previous Faq:

Next Faq: