Page 1 of 1

Crashing when trying to initialise a serial port

Posted: 18. Feb 2011, 12:28
by alansecker
Following a system crash a couple of weeks ago I have been trying to recover access to a serial modem.
This is what # setserial found:

[root@asandco ~]# setserial -g /dev/ttyS*
/dev/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4
/dev/ttyS1, UART: 16550A, Port: 0x02f8, IRQ: 3
/dev/ttyS2, UART: unknown, Port: 0x03e8, IRQ: 4
/dev/ttyS3, UART: unknown, Port: 0x02e8, IRQ: 3

I have Port 1 set to COM1
Port Mode to 'Host Pipe' , create pipe is currently checked.
and the path set to /dev/ttyS0

I have tried other combinations but no hits so far. VB returns variations of:

Failed to open a session for the virtual machine WinXP.
NamedPipe#0 failed to connect to local socket /dev/ttyS0 (VERR_NET_CONNECTION_REFUSED).
Unknown error creating VM (VERR_NET_CONNECTION_REFUSED).

Advice would be most welcome. :?

Re: Crashing when trying to initialise a serial port

Posted: 26. Feb 2011, 18:00
by Maddog Battie
I'm failing to get this going too.

Suggested elsewhere was to check that the permissions for the serial port are set right.

ls -al /dev/ttyS* will tell you the owner of the serial port

for my machine I get
crw-rw---- 1 root dialout 4, 64 2011-02-26 15:48 /dev/ttyS0
crw-rw---- 1 root dialout 4, 65 2011-02-26 09:29 /dev/ttyS1
crw-rw---- 1 root dialout 4, 66 2011-02-26 09:29 /dev/ttyS2
crw-rw---- 1 root dialout 4, 67 2011-02-26 09:29 /dev/ttyS3

The important bit here is the group dialout. You want to check that your username is included in the dialout group so that you have access to the serial port.

I have done this and had access so it didn't fix it for me but it might for you.

Re: Crashing when trying to initialise a serial port

Posted: 26. Feb 2011, 18:02
by Maddog Battie
Also elsewhere is states that VB 4.0.4 doesn't announce to Windows that a serial port is available. You therefore have to set it up by hand in the device manager. I've done this and it still doesn't work...

Re: Crashing when trying to initialise a serial port

Posted: 28. Feb 2011, 01:19
by Maddog Battie
Solved my issue at least. I'll post my solution so hopefully it is useful to others:

With Linux host:

Set Serial Port Settings to:
COM1
Host Device
/dev/ttyS0 (Note - that is a captial S followed by a zero)

With Windows host:
Set Serial Port Settings to:
COM1
Host Device
COM1: (Note - that is in all caps and finishes with a colon)


In Windows 7 guest you need to add the com port manually. It won't automagically find it.

Bring up Device Manager.
Action->Add Legacy Hardware
next -> Install the hardware that I manually select from a list
Ports (COM & LPT)
Communications Port
Finish (warning message displayed)
You will have a Coms port now listed (as COM3) with a little yellow warning triangle
Double click on it
Port Settings -> Advanced
Change COM Port Number to COM1
Resources -> Set Configuration Manually
Untick Use automatic settings (Very Important!)
Find a config that matches that set up in VB serial settings (probably Basic Configuration 0000)
OK
Reboot
Check Device Manager - Warning triangle should have gone
Success (hopefully)