I am running Ubuntu 22.04 (Computer A) as a host and Ubuntu 20.04 inside a virtualbox (Computer B). I want to be able to ftp from the host to the VB, but I get connection refused whenever I try to ftp or ssh.
I set up an ftp server using vsftpd using instructions online. I can manage to ftp into computer B from itself using ftp localhost, so I think the server is setup properly.
run@write:/etc$ ftp localhost
Connected to localhost.
220 (vsFTPd 3.0.3)
Name (localhost:run): run
331 Please specify the password.
Password:
230 Login successful.
I have setup the firewall to listen on the relevant ports
run@write:/etc$ sudo ufw status
Status: active
To Action From
-- ------ ----
21/tcp ALLOW Anywhere
20/tcp ALLOW Anywhere
990/tcp ALLOW Anywhere
40000:50000/tcp ALLOW Anywhere
OpenSSH ALLOW Anywhere
21/tcp (v6) ALLOW Anywhere (v6)
20/tcp (v6) ALLOW Anywhere (v6)
990/tcp (v6) ALLOW Anywhere (v6)
40000:50000/tcp (v6) ALLOW Anywhere (v6)
OpenSSH (v6) ALLOW Anywhere (v6)
ipconfig on computer B showed that the IP address was 10.0.2.15 so I set up port-forwarding in the networking settings in VB.
Port Forwarding List
But when I try to ftp into B from A I get connection refused using ftp. I don't even get to asking for username and password.
I tried to telnet to localhost and the port number but got connection refused. I used nmap to see which ports were open, but none of the ones specified in ufw are open and two other ones are open so I'm wondering where the breakdown is happening.
nmap localhost
Starting Nmap 7.80 ( https://nmap.org ) at 2022-11-21 23:04 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000028s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
631/tcp open ipp
5500/tcp open hotline
Is the issue with how I set up the virtual box or how I'm trying to ftp to the virtual box?