Page 1 of 1

[SOLVED] how to add much more serial port /dev/ttyS

Posted: 27. Dec 2012, 18:58
by alexferro
Hi,

My host: Linux CentOS6 with 2 base serial port (ttyS0 ttyS1) and 1 pci-e Oxford with 4 serial port ( ttyS4 ttyS5 ttyS6 ttyS7 )

My guest: Linux kernel 2.4 with only 2 serial port:
/dev/ttyS0 attached to host /dev/ttyS4 (running very well)
/dev/ttyS1 attached to host /dev/ttyS5 (running very well)

I need to add 2 new serial port to guest (I think /dev/ttyS4 and /dev/ttyS5) and connect them to host's serial port:
guest /dev/ttyS4 to host /dev/ttyS6
guest /dev/ttyS5 to host /dev/ttyS7

How can I add much more 2 serial port to guest?

any ideas?

Thanks, Alessandro

Re: how to add much more serial port /dev/ttyS

Posted: 27. Dec 2012, 19:23
by Perryg
See section 3.9 in your VirtualBox users manual. But you can only assign up to two serial ports per guest.

Re: how to add much more serial port /dev/ttyS

Posted: 27. Dec 2012, 23:26
by alexferro
Hi Perrig,

thanks for your answer.

I learn about socat to forward by tcp/ip host's physical serial port to a new-add guest's virtual serial port...

It is possible to do?!

Alessandro

Re: how to add much more serial port /dev/ttyS

Posted: 28. Dec 2012, 01:04
by Perryg
AFAIK you can only assign/configure 2 serial ports to the same guest in VirtualBox. You need to look at these as separate PCs.

Re: how to add much more serial port /dev/ttyS

Posted: 28. Dec 2012, 14:39
by jorgensen
With an USB serial adapter, there is no real limit for how many serials ports you can have at the guest.

[SOLVED] how to add much more serial port /dev/ttyS

Posted: 29. Dec 2012, 18:31
by alexferro
I added into guest's inittab these lines:

t1:5:respawn:/usr/local/bin/socat pty,link=/dev/ttyS4,raw,nonblock tcp:192.168.5.138:54320
t2:5:respawn:/usr/local/bin/socat pty,link=/dev/ttyS5,raw,nonblock tcp:192.168.5.138:54321
t3:5:respawn:/usr/local/bin/socat pty,link=/dev/ttyS6,raw,nonblock tcp:192.168.5.138:54322
t4:5:respawn:/usr/local/bin/socat pty,link=/dev/ttyS7,raw,nonblock tcp:192.168.5.138:54323

now my Linux guest has 4 new virtual serial lines named /dev/ttyS4 /dev/ttyS5 /dev/ttyS6 /dev/ttyS7 and 192.168.5.138 is my Linux host .

Then into my Linux host I added new service ser2net with above configuration file /etc/ser2net.conf:

54320:raw:0:/dev/ttyS4:38400 RTSCTS
54321:raw:0:/dev/ttyS5:38400 RTSCTS
54322:raw:0:/dev/ttyS6:38400 RTSCTS
54323:raw:0:/dev/ttyS7:38400 RTSCTS

to any serial port is attached a modem/fax ROCKWELL RC288DPi/ACF3_V1.702-V90_P21_FSH

Now I can send fax with hylafax into my Linux guest using 4 phisical modem!!!

Alessandro