LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Connecting Two Linux Machines (https://www.linuxquestions.org/questions/linux-newbie-8/connecting-two-linux-machines-897221/)

Mak007 08-14-2011 08:03 AM

Connecting Two Linux Machines
 
hi guys .. i am Mak .. hope ur all doin' gud .. i hv a query regarding networkin on linux machine ,, actually i want to use an installed application on other linux machine available via internet without installing the software on my machine .... i can give u an example to understand wt m askin for ...
lets say we have two linux machines A( it has already installed a software or any compiler) and B( this machine has no compiler software and wanna excute its code using machine A on internet )

so it means i hv written a source code but have no compiler to execute it .. for the execution i wanna use the compiler installed on other machine A.. how can i do tht pls tell me :).. i am new to linux i dun even noe how to connect two linux machines !! all replies will be appreciated thnx!! :)

teckk 08-14-2011 10:31 AM

Quote:

i am new to linux i dun even noe how to connect two linux machines !!
Hook both to a switch with CAT5 or CAT6 cables, configure both network interfaces with an IP address, or hook them both together with a crossover cable.
http://www.linuxhomenetworking.com/
http://www.linuxhomenetworking.com/w..._to_Networking
Quote:

i want to use an installed application on other linux machine available via internet without installing the software on my machine
http://linux.die.net/man/1/ssh
Quote:

this machine has no compiler software and wanna excute its code using machine A on internet
Be easier to just install gcc or whatever compiler you want on it. Compilers aren't very big.

theNbomr 08-14-2011 11:43 AM

Firstly, please use proper spelling here; we're not on a bandwidth-limited network and messages can can be arbitrarily long.

What you are attempting is done routinely. You will need to get both hosts configured on the local network, either wired or wireless. You will need to use ssh to log in to the peer host that has the runnable binaries. Then, simply run the program(s). If the program(s) in question use X, you should use the '-X' option when you perform the ssh login.
To provide any further help, it would be helpful to know something about the nature of the respective Linux hosts, especially Linux distribution.
Also, just to be completely clear, you do not need a compiler to execute programs. The compiler is used (along with a linker and sundry other tools) to convert programming language source code into executable object code. If there is enough similarity between your two hosts, it is possible that the executable binaries on one host could be copied to the other, where they would then run as local processes.

--- rod.

kostya 08-14-2011 12:11 PM

Quote:

Originally Posted by Mak007 (Post 4442546)
...

so it means i hv written a source code but have no compiler to execute it .. for the execution i wanna use the compiler installed on other machine A.. how can i do tht pls tell me :).. i am new to linux i dun even noe how to connect two linux machines !! all replies will be appreciated thnx!! :)

Do you mean to COMPILE your source code using a compiler installed on a different machine??

However strange the idea may sound, it is quite possible to do. You may need it in case your source code (for example, your kernel source) is on a machine with very low resources (say, Pentium II 82Mb of RAM) and you want to compile quickly.

Suppose, now, your source code is on the Linux machine A and your compiler on the B machine. If you've established your network connectivity using the above given manuals (which is pretty simple and straightforward, so I need not dwell on that), you can now configure your A machine as a NFS server and some partition (directory) on it as a NFS partition.
Then you can mount your NFS partition via network on your B machine (which will act as a NFS client), where your compiler is. Once NFS-mounted on your B machine, the source code on that partition becomes available on your B machine like any local code. So you can compile it using local compiler. Sure thing, the speed will be limited by the I/O speed of your A machine's HDD controller and bus (as your NFS partition is still on your A machine). But the memory and processor of your B machine will speed things up considerably.

Read the NFS-HOWTO in order to better understand what NFS is. Essentially, NFS is a protocol that allows mounting partition from one machine on another and work with it as though it was a local partition. There's nothing really complicated about this stuff.

I remember doing it when my source code was on a very low resource machine and I needed to compile it rather quickly. That worked fine!
But hey, you can do the same on your Mac, eh?

Mak007 08-14-2011 02:20 PM

thnk u guys :) i hope it will surely work well ... i have to wait for 1 day before setting up this kind of interconnected system .. well thnx !! special thnx to "kostya" who let me know that we can compile our source codes with high speed by using other system via networking .. my english is not too good but its quite fare enough to make you guys help me better :P

kostya 08-14-2011 04:42 PM

I'm terribly sorry, but on a second thought it is not as simple as that.

For that trick to work your two machines must be the same architecture. Then, too, your A machine MUST have a compiler installed on it. Then you just mount your NFS partition and `chroot` into it and just use the installed compiler to compile your code as if you were on your machine A, but using the resources of your machine B.
Note, that when you `chroot` into your partition, you can only use whatever exists in that partition. Therefore if GCC isn't there, you can't use it. But if you have GCC installed on A machine, you'll absolutely be able to do a quicker compilation from machine B if they are the same architecture.

Sorry for my forgetfulness, it was long time ago and I don't remember all details :(.

chrism01 08-14-2011 08:48 PM

If this is really across the internet, NFS is not a good idea. Its plain text and not designed for long distances usage; you'll probably get timeout issues.
I would just use ssh/scp to copy across the src code to the compiler on box A and compile it there.
As mentioned above, normally box A must have the same architecture as box B for the resultant binary to run on box B, although cross-compilation is an option as well.


All times are GMT -5. The time now is 03:08 AM.