Tom's FreeBSD blog

February 2, 2010

VMware serial consoles.

Filed under: FreeBSD,Virtualization — tmclaugh @ 5:45 pm

I’ve recently run into a problem with 7-STABLE on VMware ESXi 3.5u4.  With a recent change my VM shuts off shortly after probing the LSI (mpt) disk controller.  The same behavior started occurring over the summer in HEAD and the quick workaround is to change the VM’s disk controller type from LSI to BusLogic.  Lately I have some time to poke people about this issue so I figured I would.  The problem is getting as much as I can while booting and having some usable boot messages for someone to look at.  This would usually be accomplished by redirecting console output to a serial port on the problem machine and hooking up a cross over cable between it and another box.  I haven’t done this on VMware before though so I had to do a little googling and it’s pretty simple.

On the FreeBSD side the following needs to be added to /boot/loader.conf:

console=”vidconsole,comconsole”

This will redirect the console to both the video display and a serial port.  Once that is done shutdown the VM so the serial port can be added and configured.

With the crashing VM turned off go to “Edit Settings”:

Edit options screen

Click the “Add” button to add a serial port to the VM:

Add Hardware screen

For the serial port output select “Connect to named pipe”:

Port Type screen

Finally configure the pipe:

Named Pipe settings screen

The name of the pipe should be a file location on the VM host machine, not the guest.  The near end is “Server” since I want to see the output from this VM and the far end will be another virtual machine.  For the VM I’ll be connecting from to view the console output I would do the same but near end would be “Client”.

Once all this is done, from the second working VM launch cu(1).

# cu -l cuad0

After that boot the crashing VM and kernel messages should appear on the second VM.  That’s all it takes to setup a serial connection between two FreeBSD VMs on VMware.

Update: Images fixed.

4 Comments »

  1. Did you find the problem? I should add that I also have 7-stable machines running on ESXi 3.5 (only u3) without problems.

    Comment by Ivan Voras — February 2, 2010 @ 9:59 pm

  2. Thanks, a useful post. What I’d find even more useful is a way to connect the first VM’s serial port to an IP port on the VM host. Then it could be connected to from any remote system over the network to access the console of the VM. And it could be done for as many VMs as there were on the host.

    Comment by Tim — February 3, 2010 @ 3:43 am

  3. @Ivan: I’ve tracked it down to probably either r203047 or r203073 as the culprits. Both were in the time frame between me being able to build a working kernel and then having a broken kernel after testing yesterday. Can you try an amd64 VM? I should try an i386 VM and see what happens.

    @Tim: If there was something like that or even physical serial port pass through then ESXi would be come a possible option for use in the FreeBSD cluster.

    Comment by tmclaugh — February 3, 2010 @ 9:50 am

  4. Website Trackback Link…

    [...]the time to read or visit the content or sites we have linked to below the[...]…

    Trackback by Buy Guaranteed Facebook Fans — December 1, 2011 @ 6:05 am

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress