How to use two different computers with two differents OSes seemlessly


At home I have two computers, one on ArchLinux for work, and one under Vista for games. But switching between the two is really confusing when we’re a little tired, so I decided that I’d use only one soundcard, keyboard and mouse on the two computers…

I’m gonna explain you how to do this, in this tutorial I’ll use my windows box as the “master” as it has the best soundcard, keyboard and such of the two computers. Let’s starts:

Keyboard and Mouse

Keyboard and Mouse are probably the easiest part of this – Synergy is a small utility that allow you to share a mouse/keyboard between multiple computers, download the binary for windows and launch it, there set the computer as a server, and click configure. Set two screens, for the name use the hostnames of each computers, then create two links like in the following screenshot:

Don’t forget to create the two links ! Or when you’ll switch one the second computer, you will not be able to go back :D

Then on our archlinux box, do the following:

pacman -S synergy
synergyc 192.168.xxx.xxx

That will launch the synergy client and connect to your server and voila, you can use only one keyboard/mouse between the two computers. Don’t forget to setup autostart in synergy on Windows, and add the client command in the Gnome Session Manager. Now it’s time to take care of the sound.

Using the sound over the network

Here is the hard part, setting up the sound over the network is a long task. First, download pulseaudio for windows here. Extract the thing in a folder like C:\pulseaudio then create a config file named default.pa containing the following:

load-module module-native-protocol-tcp listen=0.0.0.0
load-module module-waveout

And put it in this folder. The first line tells pulseaudio to listen to all connections on the local network while the second line allow us to output sound. Next step is to double-click on pulseaudio.exe – Don’t paye attention to the warnings and go to C:\Users\<username> on Vista or C:\Document And Settings\<username> on previous windows then copy the .pulse-cookie here ( create by pulseaudio.exe ) to /etc/pulse-cookie on your linux box ( using WinSCP for example ). You can now add pulseaudio.exe to windows start ( there are lots of softs out there allowing it, just use whatever you want ) and we’re done with the windows box.

Now for our archlinux, we need to works on lots of things, let’s start on installing/configuring pulse:

pacman -S pulseaudio padevchooser paman paprefs pavucontrol pavumeter

Then add to your rc.conf

DAEMONS=(... avahi-daemon pulseaudio)

Avahi is needed for network communications in pulse. Now change our cookie modes:

chown pulse:pulse-access /etc/pulse-cookie
cmod 0640 /etc/pulse-cookie

And finally setup pulseaudio by editing /etc/pulse/client.conf:

cookie-file = /etc/pulse-cookie
default-server = 192.168.xxx.xxx # change this to your windows box ip

We are now done with pulse itself. Don’t forget to add your users to the pulse-access group.
Let’s configure ALSA to use Pulse by editing /etc/asound.conf ( create it if it doesn’t exists ) and add the following lines:

pcm.pulse {
    type pulse
}
ctl.pulse {
    type pulse
}

pcm.!default {
    type pulse
}
ctl.!default {
    type pulse
}

With all that, you should be ok, try launching mplayer using the -ao=alsa flag and you should hear the sound on your windows box :)

, , ,

  1. No comments yet.
(will not be published)