Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I plan to change OS on my other PC from Windows XP to Ubuntu and want to have access to it.

Basically please imagine two PCs, each running Ubuntu 11.04 and connected together with twisted cable (Ethernet).
I want to be able to access filesystems in both directions (from either PC to other) in the easiest possible way.


update: I just installed Ubuntu (decided to dual-boot as first), and the process went flawlessly, Gparted resized partions with ease and overall everything was smooth, which I did not expect when computer tasks are in question.

share|improve this question
    
Well if you had a router and were connected locally, I'd use ssh and sshfs. ssh for opening a terminal on the other PC, and sshfs for mounting the other PC on a mountpoint. However, I don't know what kind of networking you can have via a twisted ethernet.. but as long as you can reach the other PC via a IP like 192.168.1.85, then SSH should work –  Matt Sep 30 '11 at 3:54
    
No router, just cable connecting two Ethernet cards. I have not yet removed XP, so can't try your suggestion, but it looks promising if I can just use sshfs to mount filesystems around –  klo Sep 30 '11 at 4:24
    
Yup. Looks like you have 192.168.1.x IPs. I believe ssh should be already installed, so install sshfs: sudo apt-get install sshfs. now on the 192.168.1.1 computer: sshfs root@192.168.1.2:/home/USER/ ~/MountDir, and on 192.168.1.2: sshfs root@192.168.1.1:/home/USER/ ~/MountDir. To make this easier, you could create a script and place it in /usr/games/, and run chmod +x scriptname, then you can mount it with one command. You can also go one step further by going to the startup applications, and adding your script [/usr/games/scriptname] :) cheers –  Matt Oct 8 '11 at 19:51

2 Answers 2

up vote 1 down vote accepted

Connect the 2 pcs directly using a cross network cable and use the ifconfig command to assign the fixed addresses between the pcs.

ie:

ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255

for pc1, and

ifconfig eth0 192.168.1.2 netmask 255.255.255.0 broadcast 192.168.1.255

for pc 2, where eth0 is your network interface name (check ifconfig -a for all your interfaces).

Use ping to see if you have connection between pcs: from pc1 > ping 192.168.1.2, from pc2 > ping 192.168.1.1

If you can ping you can connect, the use of NFS is really simple and fast to use, check it here: Ubuntu NFS howto

share|improve this answer
    
This worked on first try, ping command was success. Linked page (NFS) is a bit more complicated then expected and I did't try it as I have other problem this way. Main PC has wireless Internet connection through USB stick, and connection dropped, which made me think, if it's possible to make other PC (which most of the time is headless) be accessible from this Main PC and not the other way around, so I can keep Internet connection perhaps? –  klo Sep 30 '11 at 10:55
    
Then you need to assign your main computer as a router: 'wireless ----> internet, eth0 ------> internal net'. –  Bruno Pereira Sep 30 '11 at 11:50
    
Yes, Wireless uses "Automatic DHCP" method. What parameters are you suggesting to change? Can I set that workflow with NetworkManager dialog? –  klo Sep 30 '11 at 11:51
    
type: sudo nano /etc/sysctl.conf, edit/add line net.ipv4.ip_forward = 1, do a /etc/init.d/network restart, use iptables to setup ip forwarding and masquerading with iptables --table nat --append POSTROUTING --out-interface wireless -j MASQUERADE and iptables --append FORWARD --in-interface eth0 -j ACCEPT –  Bruno Pereira Sep 30 '11 at 11:56
    
Where wireless is your internet USB interface and eth0 is your wired LAN to the other PC, you need to find the names of the interfaces with ifconfig -a and change that on the instructions. –  Bruno Pereira Sep 30 '11 at 12:00

Just Connect the two PCs with UTP and give each unique IP address. Then you can share folders and access them from Nautilus. I have done this from ubuntu to windows using samba and I don't have reason why it should not work with ubuntu. So share the folders that you need to be accessible to both PCs

share|improve this answer
1  
Maybe a software layer is required at least on one of the two PSs: ssh or ftp server, or samba server (if you don't want to recur to netcat) –  enzotib Sep 30 '11 at 7:23
    
I installed Samba on both PCs ad shared folders on both, but I couldn't see other PC. Tried to set eth0 IPv4 method to "shared" then "manual" with fixed IP address w/o success. I probably miss something –  klo Sep 30 '11 at 10:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.