VirtualBox

Opened 8 years ago

Closed 8 years ago

#15188 closed defect (fixed)

serial port using tcp socket does not work in Windows host

Reported by: dldall Owned by:
Component: uart Version: VirtualBox 5.0.12
Keywords: socket Cc:
Guest type: other Host type: Windows

Description

VirtualBox can not create socket for uart in windows 7 32 bit host.

00:00:02.068779 Serial#0: emulating 16550A
00:00:02.068835 VMSetError: F:\tinderbox\win-5.0\src\VBox\Devices\Serial\DrvTCP.cpp(389) int __cdecl drvTCPConstruct(struct PDMDRVINS *,struct CFGMNODE *,unsigned int); rc=VINF_SUCCESS
00:00:02.068838 VMSetError: DrvTCP#0 failed to create socket

the appropriate src file

/*
     * Create/Open the socket.
     */
    int s = socket(PF_INET, SOCK_STREAM, 0);
    if (s == -1)
        return PDMDrvHlpVMSetError(pDrvIns, RTErrConvertFromErrno(errno), RT_SRC_POS,
                                   N_("DrvTCP#%d failed to create socket"), pDrvIns->iInstance);

I have never seen socket(...) failed before and do not know the error source.

Some hints:
-) According MSDN you should not use "-1" in comparison, but rather defined constant INVALID_SOCKET (must not affect)
-) You should use WSAGetLastError instead of errno to get occured error description (winsock is not posix maybe)
-) You should not use 0 as protocol, but IPPROTO_TCP (must not affect)
-) You do wrong thread creation under Windows (runtime win library is not ready to accept new thread)
-) You do wrong import of std Windows functions, that are absent in real windows systems or your compiler has wrong socket implementation for windows.

I have no ideas how to solve the bug, but with the error it is impossible to use several uarts under windows host (single uart on single VM can be used with vmwaregateway tool).

As fast solution in other way than socket, there is vmwaregateway tool for TCP<->pipe bridge, if you can create the same tool with parameters (pipe_name, TCP_port); the uarts could be accessed via pipes.

PS:
more similar reports details listed in common forum topic
http://forums.virtualbox.org/viewtopic.php?p=355780#p355780

Change History (2)

comment:1 by Valery Ushakov, 8 years ago

Should be fixed in a test build, revision 105818 or higher.

more similar reports details listed ...

Bugtracker guidelines explicitly ask for logs, but as far as I can tell none were ever provided either in the forum thread or here. That just wastes everyone's time on the back-and-forth. Please, follow the guidelines in the future.

comment:2 by Frank Mehnert, 8 years ago

Resolution: fixed
Status: newclosed

Fix is part of VBox 5.0.16.

Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use