Jump to content
xisto Community
Ahsaniqbalkmc

Operating Two Computers With One Usb Keyboard And Mouse

Recommended Posts

I have a dual monitor setup for my work where there is an extra montior attached to my laptop in extended mode to give me extra viewing space. In some scenarios, this might not add to the productivity but I have to say that in most situations, it does greatly improve the overall productivity and efficiency of the work and saves quite a bit of effort and time.Recently, I got an extra computer that I want to use in a specific way. I want to create a setup where the experience is same as my dual-monitor setup but the programs running on the seocnd monitor use the processing power of the second computer instead of my laptop.In other words, I would like to create a setup where two computers (each with its own monitor) are connected in such a way that they can be operated by a single mouse and keyboard.The harder and foolish way of operating two computers with a one usb mouse and one usb keyboard would be to perform attach/detach cycles on need basis that is connect the keyboard to one computer and do some work there and when some work needs to be done on the other computer, detach the keyboard from the first one and attach it to the second one. This would be very foolish, boring and effort taking way of doing it. So I am looking for something more practical and enjoyable.The ideal scenario would be that the two computers, each with its own display are connected to each other by some way (maybe a cross-link ethernet cable, or an ad-hoc wifi connection or some other way). And there is some sort of software that tells second computer to use the input devices connected to the usb ports of the first computer. The same software also makes necessary arrangements for the displays so that they behave as if they were connected to the same computer in an extended mode.The practical imagination of the above scenario would be the dual-monitor setup (an extra monitor connected to the first computer) where a guest Virtual machine is running in full screen mode in the extra monitor and the host machine's desktop can be seen in the primary monitor.Let me explain this practical imagination scenario in a bit more detail so that you folks can understand. Suppose that I have an extra monitor attached to my laptop in extended mode. So basically I have a primary monitor (the laptop's own screen) and the secondary monitor (the extra monitor that I have attached to the vga port of the laptop). Also suppose that I have vmware installed on my system and a virtual machine created. I would start the vmware virtual machine, move the vmware window containing this virtual machine to the secondary monitor and make it full screen. On the primary display, I will have the desktop of the host OS, which would occupy the primary monitor completely. On the secondary monitor I would have the virtual machine in full screen mode so in effect, the desktop of the guest OS would occupy the secondary monitor completely. Now I can move my mouse from the primary display (host OS) to the secondary display (guest OS). Same is true for my keybord i.e. I can use to type in bot the host OS and guest OS depending on where the focus currently is.I want the exactly same behavior in the scenario where instead of the virtual machine, there would be an actual computer and the display won't be connected to the first computer directly. Instead it would be connected to the second computer. The computer would be connected to each other.Have anyone any idea how such a setup can be created. Is it even possible ?? Any help, suggestion or constructive criticism is appreciated.

Share this post


Link to post
Share on other sites

OK, vnc does the job.vnc server is running on the computer without keyboard.vnc client is running on the computer which has a keyboard.The vnc client gives you remote accces to the remote computer with your own mouse and keyboard.With alt-tab you shift to the vnc window, and you are on the remote computer. And you move your mouse dow the menu bar to go back to your local computer.Of course, if you have a lot of money for buying hardware, the kvm switch perfectly does the job : each computer is connected to the switch, as well as your keyboard-mouse, and you go from one computer to the next one through simple key sequences (control-control, as far as I remember).

Share this post


Link to post
Share on other sites

There's a device called a Network USB Hub, which allows an auto/manual type switching by doing keyboard commands that switch it from 1 computer to another. I'm not sure how many computers it supports but I assume you're only limited by how many different keyboard combinations you could configure for it.I use to have a similar setup in my server room but using a 2xPS/2 and 1xVGA switching hub. This allowed me to have 1 monitor 1 keyboard and 1 mouse for all 7 servers that were in my server room as you really don't want 1 setup for each server, especially in a small confined room like that. These were all considered headless machines, except for the fact I had the switch. The only difference with your setup is that you have separate monitors and only want to share the keyboard and mouse which again is still possible as there wasn't really a rule to what you could share, if you didn't use a keyboard, you could manually switch from the device itself.For handling virtual machines, VNC could work well, another up and coming protocol is SPICE which I may write a guide on since it's related to gnome-boxes which is just a frontend over qemu/kvm. That is what I used in my tutorial on the minimal install. You can remotely connect to these virtual machines from a network. Apart from using VNC or SPICE for virtual machines, it's also used like Remote Desktop, allowing you to see the screen of the other computer.Cheers,MC

Share this post


Link to post
Share on other sites

OK, vnc does the job.vnc server is running on the computer without keyboard.
vnc client is running on the computer which has a keyboard.
The vnc client gives you remote accces to the remote computer with your own mouse and keyboard.
With alt-tab you shift to the vnc window, and you are on the remote computer. And you move your mouse dow the menu bar to go back to your local computer.

Vnc seems to be a good idea but I have a few questions.. According to what I know, for vnc to work, the computers don't need to be directly connected to each other. However, it is essential that both computers are connected to the Internet. This might not be seen as a problem for many, but on slow internet connections, the performance really lacks. The display of the remote machine (the machine with the vnc server) on the current machine (the machine with the vnc client installed on it) is not very fluid and there are a lot of hiccups. So the experience might not be very satisfying and sometimes even unusable.


As a reference, my current internet connection gives a maximum download speed of 100 kb/s. Now distribute this to two computers so when both are using the connection at max level, they get the average speed of 50kb/s. This will be the case if I remove all other devices that use my connection, which isn't a very practical option but still I may be able to do it.. So will the vnc work fine with this kind of speed.


The other thing that I want to discuss is the second montior. Normally, vnc is used so that two computers can be handled from a single display (according to my understanding). But in my case, I have the extra monitor for the second computer and I just need both computers to work with a single mouse and keyboard because of usability issues. If my concept about vnc is right.... vnc will render the display connected to the second computer (with vnc server installed on it) useless, because the activities of the second computer will be displayed in the vnc client window on the first computer.
One way to fix this would be to return to the normal dual-monitor setup (that I described in my first post). In this way, I would keep the vnc client window open (likely in fullscreen mode) on the secondary display and thus the entire setup would closely resemble the vmware virtual machine setup (also described in my first post).
I think this should be ok for me. But the problem of usability with my current internet speed persists.

Of course, if you have a lot of money for buying hardware, the kvm switch perfectly does the job : each computer is connected to the switch, as well as your keyboard-mouse, and you go from one computer to the next one through simple key sequences (control-control, as far as I remember).

Kvm switch seems to be a good idea but I don't know how would it work with two displays and one mouse + keyboard. But it is the option of least priority because I would like to create my setup without investing any money (or investing very little amount).

There's a device called a Network USB Hub, which allows an auto/manual type switching by doing keyboard commands that switch it from 1 computer to another. I'm not sure how many computers it supports but I assume you're only limited by how many different keyboard combinations you could configure for it.

If the network usb hub does support mouse and keyboard, and if the connected mouse and keyboard work fine (i.e. there are no hiccups or other performance issues) then it is a good way to go. But again there are two issues in my case. First I don't want to invest any money to create the setup as it is more of an experimental thing rather than what I really need. And boy.... 60 pounds is significant amount of money for me.
The second issue again would be: how this setup would work with my second monitor. I really don't have any experience or sufficient knowledge about the network usb hub so maybe someone here can help me understand how it would work with two computers each with its own display.....


The only difference with your setup is that you have separate monitors and only want to share the keyboard and mouse which again is still possible as there wasn't really a rule to what you could share, if you didn't use a keyboard, you could manually switch from the device itself.

I really didn't understand what you mean by “which again is still possible as there wasn't really a rule to what you could share”...
Can you elaborate this a bit more @Mastercomputers......

Share this post


Link to post
Share on other sites

As a reference, my current internet connection gives a maximum download speed of 100 kb/s

The download speed is not the important speed. The important speed is the speed of the link between you and your wifi routeur, and from the router to the second PC, so inside your house, not the speed with the worldwide web.And of course the trick is to start something on the second computer (through vnc) which means typing in the monitor 3 (the one which has no mouse), then iconify the vnc window and click in monitor two and work on monitor two, then click on monitor one and type inside monitor one, then click on vnc and work on monitor three.

Share this post


Link to post
Share on other sites

What I meant is that you only need to share the devices you want to share, e.g. just a keyboard and mouse. There's no need to share a monitor if each machine will use a separate monitor. The network USB device is expensive, the cheaper alternative would be a PS/2 switch but that also means having PS/2 devices, but in total it should still be less than the network USB, however, that's to share over a network, it could be possible to having a switch just between USB devices, in which eliminating the network aspect, there might be a slightly cheaper device.The way you want it to happen though still requires the ability of switching the devices. Any remote connection, is usually a single computer sharing the same resources including monitor, so unless you have a dual monitor setup, it's not going to work how you want.At the stage, the way you change devices is so far the cost effective way. Getting another keyboard and mouse for the system maybe the next cheapest way. Getting something that can switch the devices between can be another cheap option if you can find the right device. There are so much mass production of these items from india, china, etc, that they go for quite cheap.You could also try to create the device yourself, which means 2 USB cables you can cut, a manual switch and a USB hub minimum of 2 ports, but it doesn't sound like it'd be any cheaper.Cheers,MC

Share this post


Link to post
Share on other sites

There are many things that I don't understand about vnc, and I think the best way to move forward would be to first try the vnc myself. I will then post any issues or other things worth sharing....Hope it all goes easy for me....

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.