cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
8184
Views
8
Helpful
11
Replies

Help with Named Serial Pipe for XRv in VMware Workstation on Ubuntu Linux

Greg Focaccio
Level 1
Level 1

Hi Guys,

I hope someone can help me with this, as I guess it is a fairly common operation.  

I want to (using screen or putty or securecrt) connect to the serial console of XRv running in VMware Workstation 12 running on Ubuntu 16.04.  

I've done it in Virtualbox on Windows with //./pipe/test, but not sure how to create the named pipe in VMware workstation on Linux.

I tried using the /dev/ttyS0, but there are issues with that.   I need to edit the .vmxf file?

My options are:

Use socket (named pipe):  [here I enter] /dev/ttyS0 

From: [options are:] (Server | Client) [I put Server]

To: [options are:] (A Virtual Machine | An Application) [I put An Application]

...I get this message when I start XRv:

A virtual serial port (serial0) is trying to connect to pipe "/dev/ttyS0", which already exists.  

...If I choose to overwrite, I get this:

Virtual device serial0: Cannot unlink "/dev/ttyS0".
The device will be disconnected.

Help and instructions would be greatly appreciated.

Thanks,

Greg

1 Accepted Solution

Accepted Solutions

ah sorry you were asking about a linux host redirection.

that I didnt know, but apparently the procedure is almost the same of using a piping redirect but slightly in a different syntax.

check this read: http://blog.fpmurphy.com/2014/03/accessing-vmware-guest-virtual-serial-port-on-linux-host.html

scroll down a bit because at first it talks about windows host also :)

cheers

xander

View solution in original post

11 Replies 11

smailmilak
Level 4
Level 4

Have you checked this guide?

https://supportforums.cisco.com/document/12088696/running-ios-xrv-vmware-fusionworkstation

I am using ESXi and thus not able to help you better.

Thanks! I will give it a try then update this discussion.

Fusion/OSX could behave like Workstation/Linux, so the below (from fusion/osx) might work

serial0.present = "TRUE"
serial0.fileType = "network"
serial0.fileName = "telnet://127.0.0.1:9001"
serial0.startConnected = "TRUE"
serial0.yieldOnMsrRead = "TRUE"

Curious, how do you connect to the serial console of your XRv devices running in ESXi?

I also found this:

http://pubs.vmware.com/workstation-12/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-70C25BED-6791-4AF2-B530-8030E39ED749.html

Which I will also try.  Basically instead of \\.\pipe\name which works on Windows, use /tmp/socket  (with settings Server and Application as I had them)

Seems too easy, we'll see...

hi greg,

you probably want to edit the config file for the virtual machine and add a serial with a reverse telnet so that you can tcp connect to the virtual serial port. having the virtual machine create a "fake" serial port requires some drivers and tricks to create a new hardware reference for that serial so that you can connect putty to the "com" port (or /dev/ttySx). having it with a reverse telnet allows you to connect to the console from pretty much anywhere and is I think a little easier to manage/handle from that standpoint.

One other thing I wanted to point out is that if you start the virtual machine, the vmachine console stays black or only prints a single line or so (or very minimal). the XR booting process can be followed via that serial.

cheers

xander

Hi xander,

Have you ever gone through the process of getting the vm to create the /dev/ttySx port, or have a link or two I can look at.  I'd like to learn this method also.  

It is surprising to me that making a named serial pipe work on a windows system seems easier than doing it with linux.  Maybe it is not really harder with linux, but I just don't know the steps and windows is automating some things that in linux require specific configuration.

I might take this discussion up on a vmware or linux/ubuntu forum since I am interested in being able to created named serial pipes to VMs in linux.

Regards,

Greg

hi greg, yeah here are a few steps, it is not as useful as the telnet we just created, but if you like the VM to spawn a /dev/ttySx on your linux host, thisi s what you need to do:

Right-click VM in Library > Settings.

In the hardware tab "Add", choose serial port
Select the output type to be a pipe
A name needs to start with backslash backslash dot pipe followed by a name:

\\.\pipe\mypipe


Choose "This end is the server"
Choose "The other end is a virtual machine"
Tick Connect at power on (or not)

Power on the vmdk

Start a termserver on the host, like hyperterm, putty, screen, something:)

Point the select Serial to the pipe name you defined earlier.

It may also be easier to edit the config file of the virtual machine and enter that pipe there.

xander

Hi xander,

Thanks for those steps on getting an XRv vm to create a serial pipe to read from on the host.  I was able to get this working on a system where the host is Windows.

Do you know where find the steps to do the same thing with a Linux host?

I've found some links and have been trying some things, but each time there are errors/technical issues.  I think this might be best addressed in a Linux or VMware forum.  

Thanks again for your input.  I'm really looking forward to working with XRv!

Cheers,

Greg

ah sorry you were asking about a linux host redirection.

that I didnt know, but apparently the procedure is almost the same of using a piping redirect but slightly in a different syntax.

check this read: http://blog.fpmurphy.com/2014/03/accessing-vmware-guest-virtual-serial-port-on-linux-host.html

scroll down a bit because at first it talks about windows host also :)

cheers

xander

xander,

Thanks! That link was the key.  Also, Thanks to Gerhard Rieger
 (socat) and Finnbarr P. Murphy

So yes:

1. Create a Named Serial Pipe in vmware as:

/tmp/NSP  (using Server and Application checks also)

2. Launch VM (XRv)

3. Run socat with the UXIX-CONNECT as such

root@fxihs:/tmp# socat -d -d -d UNIX-CONNECT:/tmp/NSP PTY

4. Look at the debug to find the correct /dev in my case it was:

2017/02/27 06:33:44 socat[6701] N PTY is /dev/pts/6
5. Now I can screen to the device!

6. I can even now echo to the device

root@fxihs:/dev# echo sh ver > /dev/pts/6
root@fxihs:/dev#

...

RP/0/0/CPU0:ios#sh ver
Mon Feb 27 06:36:33.602 UTC

Cisco IOS XR Software, Version 4.3.2[Default]
Copyright (c) 2013 by Cisco Systems, Inc

This is a successful creation of named serial pipe in VMware workstation on Linux to an XRv vm, allowing direct access to the console! Stoked!  

(Some future day I could look into exactly what UNIX-CONNECT and socat are doing, for now I'm satisfied using the tools as is!)

Cheers!

awesome!! nice greg great to hear we nailed it :)

cheers!

xander

Got "serial console" access via telnet working, thanks for the tip (and also as xander pointed out below)

RP/0/0/CPU0:ios#sh clock
Sun Feb 26 08:59:49.350 UTC
08:59:49.360 UTC Sun Feb 26 2017
RP/0/0/CPU0:ios#sh int des
Sun Feb 26 08:59:56.980 UTC

Interface          Status      Protocol    Description
--------------------------------------------------------------------------------
Nu0                up          up           
Mg0/0/CPU0/0       admin-down  admin-down   
Gi0/0/0/0          admin-down  admin-down   

RP/0/0/CPU0:ios#sh ver
Sun Feb 26 09:00:06.179 UTC

Cisco IOS XR Software, Version 4.3.2[Default]
Copyright (c) 2013 by Cisco Systems, Inc.

ROM: GRUB, Version 1.99(0), DEV RELEASE

ios uptime is 5 minutes
System image file is "bootflash:disk0/xrvr-os-mbi-4.3.2/mbixrvr-rp.vm"

cisco IOS XRv Series (Intel 686 F6M14S5) processor with 4193854K bytes of memory.
Intel 686 F6M14S5 processor at 3037MHz, Revision 2.174
IOS XRv Chassis

1 Management Ethernet
1 GigabitEthernet
9178k bytes of non-volatile configuration memory.
1794032k bytes of disk0: (Sector size 512 bytes).

Configuration register on node 0/0/CPU0 is 0x2102
Boot device on node 0/0/CPU0 is disk0:
Package active on node 0/0/CPU0:
iosxr-infra, V 4.3.2[Default], Cisco