Step by step solutions to IT problems

XP Direct Cable to Linux

A not-so-hard guide to linking an XP box to a Linux box with a serial cable ( null modem ) using XP's direct cable connection. Connecting to a Linux box with a serial cable can save you all the time and effort setting up a network, with network cards, cabling and a switch, and lets you transfer data at any speed up to 115Kbps, which is twice an ordinary modem. For a simple connection, or for testing websites at different modem speeds, without the need to run up a big phone bill, joining computers with a serial cable is the simple solution.

Adding a Direct Connection in XP

Click on Start then Control Panel to bring up the XP Control Panel. Then click on Network and Internet Connections. Now click on the Network Connections Control Panel Icon in the bottom section of the screen [img].

In the Network Connections Window, click on Create a new connection in the menu on the Left hand side [img], which should start the New Connection Wizard [img]. Click Next to run the Wizard.

Select Set up an advanced connection [img] and then click next. Select Connect Directly to another computer [img] and then click next. Select Guest [img] as then click next. It now asks you for the name of the other computer [img]. It doesn't matter what you type as the name is only used to label the connection, and does not affect the connection at all. I usually type in Serial Link [img]. Then click Next.

Select the Serial Port you are going to use, this will usually be COM1 [img], and click next. Tick the box to stick an icon for the connection on your desktop, as it will make finding it easier, and now click Finish to set it all up.

We now just need to make a few adjustments to the connection to make it connect to Linux. Once the connection has been setup, it usually pops up the Connect Dialog (If not double click on the icon on your desktop) . Click on the properties button on the Connect Popup [img].

Under the general tab [img], it should have your serial cable selected, so click on configure and change the maximum speed to 115200 [img], then click OK. Now go to the Networking Tab [img] and click on the Settings Button under Type of Dialup Server I am calling and untick Enable Software Compression on the Popup [img], and then Click OK to close the popup. Click on OK on the remainnig dialog box to return to the Connect Dialog.

Now Windows Is Ready, and we just need to set up Linux.

Setting up PPPD under Linux

Setting up Linux is even simpler, as we can just use the pppd package. Most Linux installations will have pppd installed by default, if not, check your linux setup to add it.

The Direct Connection from the XP box, is just a basic PPP connection with a small amount of Microsoft specific handshaking first. You can either use the ppp options file, usually found in /etc/ppp/options or as I prefer, put all the settings on the command line.

You need a small settings file to handle the Microsoft specific handshaking. Put the following lines in a file at /etc/ppp/


If you just want to be able to access only the Linux box , then you don't need to enable IP Forwarding. If the Linux box is connected to a network that you want to be able to access from the XP box, then you need to enable IP Forwarding. The simple script to start IP Forwarding and then PPPD is shown below. Remember to make the script executable ( chmod +x scriptname should be enough) before trying to run it.


# enable ip-forwarding echo 1 > /proc/sys/net/ipv4/ip_forward

# Start a 115200 baud ppp server on ttyS0. pppd 115200 nodetach netmask crtscts connect 'chat -v -f /etc/ppp/' lock local ms-dns persist proxyarp silent /dev/ttyS0

# disable ip-forwarding echo 0 > /proc/sys/net/ipv4/ip_forward

The pppd line assumes that the Linux box has IP address, the XP box will be given IP address and the DNS server is at You need to change these addresses to match your own network settings.

For more information on setting up the linux end of the serial connection read the pppd man page, and the serial and laplink linux howto guides.

Connecting from XP to Linux

Because we have not setup and username and password requirements under Linux, we do no need to pass in a username and password, so from the XP box connect dialog box, Click on the Connect Button to dialup the Linux Box [img].

If all goes according to plan , you should now be connected just the same as dialing up with a modem. If you get an error during dialup, make sure the Linux and XP boxes are set to connect at the same speed (115200). If you want to connect at a different speed, you need to adjust the speed setting on both the XP and Linux boxes.

Submit to    digg    reddit    simpy