FTP Server Setup in a Windows VM

FTP Server Setup in a Windows VM

How to Set Up and Use an FTP Server in a Windows 11 VM

FTP (File Transfer Protocol) is a standard network protocol used to transfer files between clients and servers. Setting up an FTP server in a Virtual Machine (VM) on a Windows host can help keep your main operating system secure and provide a controlled environment for file transfers. This guide will walk you through the steps to set up an FTP server using IIS (Internet Information Services) on a Windows 11 VM and then demonstrate how to use the FTP command line interface to interact with it.

Step 1: Enable IIS and FTP Server Features

Open Control Panel:

Press Windows + R, type control, and press Enter.

Navigate to Programs and Features:

Go to Programs > Programs and Features.
Click on Turn Windows features on or off in the left pane.

Enable IIS and FTP Server:

In the Windows Features dialog, expand the Internet Information Services node.
Expand FTP Server.
Check FTP Service and FTP Extensibility.
Ensure Web Management Tools and World Wide Web Services are also checked.

Install Features:

Click OK and wait for the features to be installed.

Step 2: Configure the FTP Server

Open IIS Manager:

Press Windows + R, type inetmgr, and press Enter.

Add FTP Site:

In IIS Manager, expand the node for your computer in the Connections pane.
Right-click Sites and select Add FTP Site.

FTP Site Details:

Site Name: Enter a name for your FTP site.

Physical Path: Select the folder you want to use for FTP file storage.
Click Next.

Binding and SSL Settings:

IP Address: Select the IP address of your VM or leave it as All Unassigned.

Port: Default is 21.

SSL: For a demo, you can choose No SSL.
Click Next.

Authentication and Authorization:

Authentication: Select Basic.

Authorization: Choose Specified users and enter your Windows username.
Set Permissions to Read and Write if you want to allow both uploading and downloading.
Click Finish.

Step 3: Configure Firewall Rules

Open Windows Firewall:

Press Windows + R, type firewall.cpl, and press Enter.

Allow FTP through Firewall:

Click on Advanced settings.
In the left pane, click Inbound Rules.
In the right pane, click New Rule.
Select Port and click Next.
Choose TCP and specify port 21.
Click Next, allow the connection, and complete the rule setup.

Step 4: Access the FTP Server

Find VM’s IP Address:

Open Command Prompt (cmd), type ipconfig, and find the IP address of your VM.

Test FTP Connection:

You may need to turn off the VM’s firewall. Do turn on back once testing is done.
Ensure the VM’s network is set to Bridged-Adapter.

Using the FTP Command Line Interface

Let’s explore some hands-on examples using the FTP command line interface. These examples assume you have an FTP server set up and running.

Connecting to an FTP Server:

Open Command Prompt on your Windows host machine.
Connect to the FTP server using its IP address:

ftp <ftp_server_address>

Logging In:

Enter your username and password:

Name (ftp_server_address:username): your_username
Password: your_password

Listing Files:

List the files in the current directory:

ftp> ls

Changing Directories:

Change to a different directory:

ftp> cd <directory_name>

Downloading a File:

Download a file from the FTP server:

ftp> get <file_name>

Uploading a File:

Upload a file to the FTP server:

ftp> put <file_name>

Exiting the FTP Session:

Exit the FTP session:

ftp> bye

Conclusion

Setting up an FTP server in a Windows 11 VM on your Windows host is a recommended practice for ensuring security and isolation. By following the steps above, you can install and configure an FTP server using IIS on a Windows 11 VM, configure necessary firewall rules, and interact with the server using the FTP command line interface from your Windows host. This setup provides a robust and secure environment for managing file transfers.

Please follow and like us:
Pin Share