Categories


Authors

MikroTik Hyper-V Serial Console

MikroTik Hyper-V Serial Console

You can now get MikroTik training direct from Manito Networks. MikroTik Security Guide and Networking with MikroTik: MTCNA Study Guide by Tyler Hart are both available in paperback and Kindle!

I do a lot of work with virtual MikroTik routers, mostly in Microsoft Hyper-V. The CHR is great for labbing-out solutions and developing configuration templates for clients. Unfortunately copy-and-paste operations aren't really possible through the built-in Hyper-V console. Winbox is another solution, but much of what I do happens at the command line. The cleanest solution I've come up with is using the built-in serial device functionality with named pipes for the VMs. PuTTY provides a handy serial interface for accessing the virtual device.

First we'll add a serial device to the CHR's VM configuration. Then we'll use it to create a named pipe. Finally, we'll use PuTTY to access the serial console.

CHR Configuration

Adding a serial port to the CHR gives us the "hardware" that we need, even though it's virtual. In Hyper-V right-click the CHR VM. Then select Settings and COM1 to the left. Note how no device was included by default in the configuration:

default-no-serial.png

Select the Named Pipe option and enter a name:

named-pipe.png

Remember the full name, beginning with .\pipe\ and ending with the chosen name.

PuTTY Serial

Launch PuTTY with administrative privileges, otherwise the named pipe can't be accessed in Windows. Select the Serial option, then use the named pipe string:

putty-serial.png

Click Open, then click inside the PuTTY window and press [Enter]. The RouterOS login prompt should appear. If the router is rebooted we can quickly restart the serial session by right-clicking the title bar:

Restarting virtual serial connection

Restarting virtual serial connection

MikroTik Winbox Security

MikroTik Winbox Security

IPv4 Overview

IPv4 Overview