Establish a direct file sharing link between Windows 10 and Linux Mint 21.2 by configuring static IP addresses on both machines, enabling the Samba service on Linux, and adjusting firewall rules to allow SMB traffic over your ethernet connection. This setup ensures reliable access to shared directories without relying on wireless networks or complex routing configurations.
Physical Connection and Network Configuration
The foundation of this setup is the physical cable and the network interface settings. While modern network adapters support Auto-MDI/MDIX, allowing standard ethernet cables to work for direct connections, using a crossover cable guarantees compatibility with older hardware. Connect the two computers directly using the ethernet port on each machine.
Once connected, you must assign static IP addresses because there is no DHCP server to handle address assignment automatically. On Linux Mint 21.2, open the Network Settings application. Navigate to the Ethernet section and select the connected interface. Change the IPv4 method from Automatic (DHCP) to Manual. Enter an IP address such as
192.168.1.10 with a subnet mask of
255.255.255.0. Save the changes.
On the Windows 10 machine, right-click the Start button and select "Network Connections." Click on the Ethernet adapter, then go to Properties. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties. Choose "Use the following IP address" and enter
192.168.1.11 with the same subnet mask
255.255.255.0. Leave the gateway and DNS fields blank since these devices are communicating directly. Verify connectivity by opening a command prompt on Windows and pinging the Linux IP address.
Installing and Configuring Samba on Linux Mint
Samba is the software that allows Linux systems to communicate with Windows clients using the Server Message Block (SMB) protocol. Open a terminal in Linux Mint and ensure Samba is installed by running
sudo apt update && sudo apt install samba. If it is already installed, proceed to configuration.
Create a directory you wish to share. For example, create a folder named
shared_files in your home directory. Set permissions so that your user has full control:
chmod 775 ~/shared_files. Next, edit the Samba configuration file located at
/etc/samba/smb.conf using a text editor like
nano. Add the following block at the end of the file:
[SharedFiles]
path = /home/YOUR_USERNAME/shared_files
browseable = yes
read only = no
guest ok = no
valid users = YOUR_USERNAME
Replace
YOUR_USERNAME with your actual Linux username. You must also set a Samba password for this user, which can be different from your login password. Run
smbpasswd -a YOUR_USERNAME and follow the prompts. Finally, restart the Samba services to apply changes:
sudo systemctl restart smbd nmbd.
Firewall Adjustments
Linux Mint typically uses UFW (Uncomplicated Firewall) to manage incoming connections. By default, it may block SMB traffic. Check the status with
sudo ufw status. If it is active, you need to allow Samba traffic. Run
sudo ufw allow samba. This command opens the necessary ports for SMB/CIFS communication. If you prefer manual port management, allow ports 139 and 445 specifically. Restart the firewall service if required, though usually, the rule takes effect immediately.
For security considerations, refer to
Which FW rules to make smb safer (and still usable) in Win and Mac? to understand broader implications of exposing SMB services.
Accessing Shares from Windows 10
Return to your Windows 10 machine. Open File Explorer and navigate to the Network section. You should see the Linux Mint computer listed. If it does not appear immediately, double-check that the Samba service is running on Linux and that the firewall rules are correct. Alternatively, press
Win + R, type
\\192.168.1.10, and press Enter.
You will be prompted for credentials. Enter the Linux username and the Samba password you created earlier. Once authenticated, you will see the
SharedFiles directory. You can map this network drive for persistent access by right-clicking the folder and selecting "Map network drive." Assign a drive letter and check "Reconnect at sign-in."
If you encounter issues where Office applications open files in protected view, see
Office applications open files stored on local Samba server in protected view for resolution steps regarding application-specific security zones.
Troubleshooting Common Connectivity Issues
If the connection fails, verify that both machines are on the same subnet. Ensure that the Windows 10 network profile is set to Private rather than Public, as Public profiles often restrict file discovery. Disable network discovery temporarily to test basic connectivity. Use the
net use command in Windows Command Prompt to manually connect:
net use Z: \\192.168.1.10\SharedFiles. This provides specific error messages if authentication fails.
Check the Samba logs on Linux at
/var/log/samba/log.smbd for detailed error information. Common issues include incorrect permissions on the shared directory or mismatched usernames. Ensure the Linux user exists and has write permissions to the target folder.
For general troubleshooting advice applicable to mixed OS environments, consult
Troubleshooting Common Issues with Windows 7, Windows 10, MacOS, and Hard Drives.
Frequently Asked Questions
Can I use a standard ethernet cable instead of a crossover cable?
Yes, most modern network interface cards support Auto-MDI/MDIX, which automatically detects the cable type and adjusts the wiring accordingly. However, using a crossover cable is recommended for guaranteed compatibility with older hardware or specific embedded systems.
Why do I get an "Access Denied" error when connecting?
This usually occurs when the Samba password does not match the Linux system password or when directory permissions are too restrictive. Ensure you have run
smbpasswd -a and verified that the shared folder allows read/write access for your user account.
Is it safe to leave Samba enabled on my local network?
While SMB is widely used, it has known vulnerabilities. Restricting access to a private network segment and disabling SMBv1 significantly reduces risk. Always keep your Samba package updated to patch security flaws.
How can I make the shared drive appear permanently in Windows?
Use the "Map network drive" feature in File Explorer and check the box for "Reconnect at sign-in." This creates a persistent entry in your Windows registry, ensuring the drive is available every time you log in.
What should I do if the Linux machine does not show up in Windows Network?
Ensure that network discovery is turned on in Windows and that the Windows firewall allows File and Printer Sharing. On Linux, verify that the
nmbd service is running, as it handles NetBIOS name resolution required for visibility.