Page 1 of 1

Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 16:00
by Milleniumaire
I have just installed an Oracle Linux 6.4 guest onto a Windows 7 host using Oracle Virtual Box 4.2.16.

In VB I I have created two bridged network adapters; one for my wireless network card and one for the wired network card. The two unique mac addresses are setup in an address reservation table on my router and are allocated specific ip addresses every time.

I can ping both ip addresses from ANY machine on my network and I can ping ANY machine from within the Linux guest, so the networking is working.

I need to be able to transfer files from my network machines (including host) to the Linux guest, but when I try to use ftp I get the following:

From ANY machine on the network (including the host):
ftp 192.168.0.4 (IP address of wired network adapter on VM)
ftp> ls
Not connected.
ftp> quit

From the Linux guest to the Windows host:
ftp 192.168.0.21 (IP address of Windows host):
ftp: connect: Connection timed out
ftp>

As you can see, when trying to use ftp from any machine, it appears to connect instantly, but doesn't ask for login details and when I try to do anything it simply says "Not connected". From the Linux guest, after a while, it simply times out.

I would appreciate any pointers on how I can enable ftp. I don't particular care which direction, I just need to be able to get some files and data into the Linux guest and at the moment this isn't possible.

Thanks.

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 17:10
by mpack
If you just want to get files in, what's wrong with shared folders?

Configuring an FTP server is probably beyond the scope of these forums: you have already established that the VirtualBox networking stuff is working.

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 17:22
by Milleniumaire
I've tried using shared folders but I'm getting an error when trying to install the extension pack (something about my linux kernel header not matching - this is from memory).

I decided that using ftp may be simpler and quicker as it is something I've always used at work for copying between unix servers and windows machines, without any problems.

I don't want to create an ftp server, I simply want to use an ftp client to copy files between machines or are you saying that in order to even ftp from Linux it needs to be configured as an ftp server?

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 17:31
by mpack
Milleniumaire wrote:I've tried using shared folders but I'm getting an error when trying to install the extension pack (something about my linux kernel header not matching - this is from memory).
I assume you mean the guest additions, since the extension pack is not required to get shared folders working. The user manual has quite good instructions on how to install the GAs in a Linux guest.
Milleniumaire wrote:are you saying that in order to even ftp from Linux it needs to be configured as an ftp server?
I'm not a FTP user, but I assume there must be two ends to every FTP connection, a server which receives calls and a client which makes them, and the server end will need to be configured with passwords, allowed folders etc. Do you expect that Linux defaults to exposing all folders and files to any Tom, Dick or Harold that connects via FTP? A constantly open connection by default? Even as a non-FTP user I would think that was unlikely.

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 21:48
by Milleniumaire
mpack wrote:The user manual has quite good instructions on how to install the GAs in a Linux guest.
Clearly, you have a lot of Linux experience as despite spending hours following these instructions I've still been unable to install the guest additions. What gets me is the fact that I've downloaded Oracle Linux 6.4 to be installed in Oracle Virtualbox and I'm STILL having problems!!!! You would expect these to be VERY compatible.

After your comments on using guest additions instead of ftp, I tried to install guest additions again, carefully following the Virtualbox instruction manual (as much as I can as it seems to be riddled with backwards and forwards links to other parts of the manual). Unfortunately, I've just wasted another evening trying to get Linux to do something that should be relatively easy! :evil:

Back to ftp.......

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 22:30
by Perryg
This should help Howto: Install Linux Guest Additions

Use the Fedora example.

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 22:35
by Milleniumaire
*** Stop Press ***

I persevered for another hour and finally succeeded in installing the guest additions, then I setup a shared folder and was even able to access my usb stick directly from within the Linux guest (not sure if I could always do this or if this functionality is only available as part of guest additions).

The guest additions provides other nice functionality as well, including mouse integration and a resizeable Linux window.

Now to get ftp working. I don't need it any more, but I like a challenge (sometimes) :D

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 22:38
by Milleniumaire
Installing dkms was my issue - it wouldn't install or it wasn't found (seemed to vary from one attempt to another) and this was causing errors when I tried to install guest additions, then I installed the following package:

yum install kernel-uek-devel

and hey presto, after a reboot, everything suddenly worked!

Re: Unable to ftp to/from Linux guest

Posted: 3. Sep 2013, 22:39
by noteirak
Glad to see you got the shared folders working, but for the sake of the discussion, here are some food for thoughts on your FTP issues.

Let's get back to some facts :
You can ping the guest from anywhere and the guest can ping anywhere -> network connectivity is fine, Virtualbox did its job.
You have issue with a FTP connection, which can be 4 things :
1. Networking missconfiguration either on host or guest
2. Firewall blocking the connection
3. Missconfiguration of the server
4. Missconfiguration of the client


For point #1, you said this :
In VB I I have created two bridged network adapters; one for my wireless network card and one for the wired network card. The two unique mac addresses are setup in an address reservation table on my router and are allocated specific ip addresses every time.
I understand that you configured a system with two interface in the same network? That's a really bad idea and will cause you a lot of issues, since your OS will have two exit point for a single network, and you'll effectively drop 50% of your packets either at your router or your destination

#2 Please double check that there are no firewall anywhere, host or guest.

#3 Are your sure the server is running and listening on port 21? Did you try using netcat or telnet from another computer and see if you actually get a connection in the first place?

Re: Unable to ftp to/from Linux guest

Posted: 4. Sep 2013, 09:00
by Milleniumaire
Ni noteirak,

Thanks for the feedback regarding my ftp issue.

I can confirm that the guest Linux system has the firewall turned off, however Windows 7 is running a standard Windows firewall, but turning this off doesn't make any difference.

I haven't done anything with the standard Linux install to setup/run an ftp server, so suspect I need to look into this as was pointed out by mpack.

Regarding the use of two bridged networks, that's interesting, I hadn't realised it would cause problems.

What I ideally want to setup is for my network (host and other Windows computers running Oracle client software) to connect to the laptop using the wired connection, when it is in place, and therefore for the wired adapter in VB to be used to access the Linux guest, but when there is no wired connection to use the wireless connection and wireless VB adapter.

I don't usually turn off my wireless network card on the laptop when it is plugged into the network, and I seem to recall reading somewhere that Windows will select the "best connection" when it has multiple to chose from. I assumed therefore the wired 1Gb connection would always be selected over the wireless connection.

I guess if this applies to the connection Windows selects, it maybe that VB/Linux aren't as clever! This is definitely something I need to look into, but for now, I'm still building the system.

Re: Unable to ftp to/from Linux guest

Posted: 4. Sep 2013, 17:48
by noteirak
Milleniumaire wrote:What I ideally want to setup is for my network (host and other Windows computers running Oracle client software) to connect to the laptop using the wired connection, when it is in place, and therefore for the wired adapter in VB to be used to access the Linux guest, but when there is no wired connection to use the wireless connection and wireless VB adapter.
Then that's a network feature known as Virtual IP, that is handled at the network equipment level aswell as the server and is way above hardware level - and as such, out of scope of Virtualbox.
Very advanced stuff there, especially with wired and wireless interfaces.
Milleniumaire wrote:I don't usually turn off my wireless network card on the laptop when it is plugged into the network, and I seem to recall reading somewhere that Windows will select the "best connection" when it has multiple to chose from. I assumed therefore the wired 1Gb connection would always be selected over the wireless connection.
That is true, but only to some extend. It tends to work fine for things going OUT of your laptop, but will start to get nasty for things coming IN, and for your network equipement.
Milleniumaire wrote:I guess if this applies to the connection Windows selects, it maybe that VB/Linux aren't as clever! This is definitely something I need to look into, but for now, I'm still building the system.
Linux will not take such descision for you, like Windows does, but that's part of the ideaology itself of Linux, so definitly a problem there.

All in all, your issue will not be located at a Virtualbox level, but at an OS & network configuration level.