Telnet server patch for VirtualBox serial port

Discussions related to using the OSE version of VirtualBox.
Post Reply
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Telnet server patch for VirtualBox serial port

Post by Technologov »

Several days of work :)
VirtualBox finally got a serial-telnet-server patch !
Now people can connect to serial port via telnet from remote computers.

This is particularly useful for GNS3 Network Simulator, where we do access remote VM's serial port.
Ugly tricks such as "socat" bridge and "VMware Serial Line Gateway" out; Patch in !
I ask you to include it in the upcoming VirtualBox 4.4, and call it a "major new feature" in changelog :)

Screenshot + patch attached

To install: must be compiled against VirtualBox 4.3.x source code.

UPDATE: telnet patch v2 patch has few changes:
1. renamed "Create pipe" into "Create socket", along with documentation changes
2. updated Changelog
3. tested vs. 5.0.0-BETA1
====
No IPv6 support and no iprt/tcp.h support here.

Enjoy !
--
-"Technologov"
Attachments
screenshot v1
screenshot v1
Telnet_server.png (46.67 KiB) Viewed 7535 times
VirtualBox-5.0-telnet-v2.patch.txt
patch v2
(49.79 KiB) Downloaded 112 times
VirtualBox-4.3.26-telnet-v1.patch.txt
patch
(49.16 KiB) Downloaded 69 times
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: Telnet server patch for VirtualBox serial port

Post by Technologov »

Answered by Klaus:

Alexey,

On 31.03.2015 20:35, Alexey Eromenko wrote:
> Several days of work :)
> VirtualBox finally got a serial-telnet-server patch !
> Ugly tricks such as "socat" bridge and "VMware Serial Line Gateway"
> out; Patch in !

really a brilliant contribution - with one catch: your code is using the socket API directly (always a risk of subtle bugs on Windows, as winsock
is a poor copy of the socket API, with surprises all over the place), and clearly can only handle IPv4. Would you be willing to spend a few
extra minutes to convert it to use the TCP server/client functionality available in include/iprt/tcp.h (you choose if you want the callbacks or
the other variant) plus include/iprt/socket.h (for the actual reading/writing)?

All other issues I found while reviewing the code are idle nagging of a perfectionist - the most prominent one is shown by your screenshot
actually: the GUI has a "Create Pipe" checkbox in this case (controlling server mode), which is misleadingly named in this context. Far from
urgent. Your contribution's usefulness outweighs such really tiny quirks. It actually might be a task for us, using different wording for
this option in all cases, in the light of having a new member in the list of serial port backends.

> This is especially useful for GNS3 Network Simulator, where we do
> access remote VM's serial port.
>
> I ask you to include it in the upcoming VirtualBox 4.4, and call it a
> "major new feature" in changelog :)

I definitely want to get this into the coming release. Actually I wouldn't postpone it even if you said that you don't have time right now
to do the socket API cleanup I mentioned above - then it would be IPv4 only until someone does.

Just a bit sad as with the coming release we want to squash as many places as possible which are IPv4 only - it is becoming an annoying limitation for some users.

> Download patch + screenshot here:
> viewtopic.php?f=10&t=66893&p=317052#p317052

All in all a really good quality contribution.

Thanks so far, and we'll see when in the next week or so someone finds time to include it (let us know if you want to do the cleanup first,
would avoid a tiny bit of additional work for is)!

Klaus
31.Mar.2015.
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Re: Telnet server patch for VirtualBox serial port

Post by Technologov »

TODO: (recommended by Alexander Eichner) -- iprt/tcp.h code example.

src/VBox/Runtime/testcase/tstRTTcp-1.cpp
klaus
Oracle Corporation
Posts: 1110
Joined: 10. May 2007, 14:57

Re: Telnet server patch for VirtualBox serial port

Post by klaus »

The contribution (hopefully working after quite some renaming) is in 5.0.0_BETA2. Yes, I know that a bug crept into the UI label for the server/client checkbox. The text has inverted logic.
Post Reply