I could use some smb help. Linux mint <> Windows 10

Hello and thank you for looking.

I could use some help with connecting my linux mint machine to my windows 10 file server.

Current conditions are:
Linux mint 21.3 Cinnamon (wired)
Windows 10 (wireless)
Windows is actively sharing a full drive and all other windows machines can see it.
My linux machine is refusing to play ball.
I have tried smb4k. JFTP, Modifying the smba file with root via various different guides with no luck to even see the windows machine, let alone attempt to interact. I’ve tried using IP and file paths to force my way to see it. I have installed cif-utils and tried to mount the windows machine via a share command in terminal with the computer ID and/or IP with again no luck.
I have made sure that smb protocol in the smb4k is min of 1.0 and max of 3.0 just to cover everything I thought might be relevant even though I know the windows machine is using 1.0.

Anyway I don’t know what information about my linux system I can share at this point to be beneficial and pertinent to my miscommunication dilemma. I look forward to answering any questions in the hopes of being victorious in my quest for file freedom.

Could you please post some terminal output when you try to go connect to the share? The error messages should help point us in to the right direction.

sudo mount -t cifs //server/share /DESKTOP-JSAT2RQ -o guest,uid=owner

Couldn’t chdir to /DESKTOP-JSAT2RQ: No such file or directory

sudo mount -t cifs //server/share /192.168.0.101 -o guest,uid=owner

Couldn’t chdir to /192.168.0.101: No such file or directory

are you sure that you are specifying them in the correct order?

sudo mount -t cifs -o username=<win_share_user> //WIN_SHARE_IP/<share_name> /path/to/win_share/on/linux/host
1 Like

Thank you for attempting to help.

I was not aware of an “order” per-se but simply tried to follow a generic guide and piece my information into it.

To be level here, any understanding and attempt at getting this to work will probably have to start from the ground up.

The string you gave me will need some explanation because I have almost no knowledge in how to use that code. But thank you again for the help you are offering.

sudo mount -t cifs -o username=<win_share_user> //WIN_SHARE_IP/<share_name> /path/to/win_share/on/linux/host

let’s break it down

sudo mount = run the mount command with admin priviledges

-t cifs = specify the type of mount that will be mounted. CIFS is linux speak for a SMB (aka windows) share.

-o username=<win_share_user> = the username of the windows user who has the permission to mount the share

//WIN_SHARE_IP/<share_name> = the path of the share that appears in the file explorer to windows hosts

/path/to/win_share/on/linux/host the folder on your linux host that the windows share will be mapped to.

2 Likes

one moment please while I piece this together.

sudo mount -t cifs -o owner=<win_share_user> //192.168.0.101/D:/ /Network:///
win_share_user: No such file or directory

Progress? I think?

2nd attempt**

sudo mount -t cifs -o owner //192.168.0.101/D:/ /Network://Windows Network/
mount: bad usage
Try ‘mount --help’ for more information.

when you see stuff between the greater/less than signs it means you need to fill it in with your details

e.g:

<win_share_user> would be YuiOni

Remove the Network: too

And lastly, make sure the directory (folder) you are mounting the share to on your linux host exists.

The file I’m point to does exist I think. It came with mint out of the box. I wasn’t able to access it until recently. Maybe I need to point elsewhere?

OWNER-MS-7D78 ← This is my share folder after I was able to get linux into the idea of trying to share something.

3rd Try.**

sudo mount -t cifs -o owner //192.168.0.101/D:/
mount: //192.168.0.101/D:/: can’t find in /etc/fstab.

you do not include drive letters in the mount

That has me questioning how I share the entire drive then?

when you set up the share in windows you give it a name and drive letter.

Linux does not see the drive letter it sees a network location that it will mount to any local arbitrary directory

Ok. So I’m still stuck with the same error message. What should be my next step?

give the windows user name that has access to the share

the network location of the share

the folder on your linux host you will mount it to and Ill make you the link?

So by what you requested I was able to understand better of what the system was looking for and tried again. This is what I got in return.

sudo mount -t cifs -o owner //192.168.0.101/ /home/owner/Desktop
Password for root@//192.168.0.101/:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Now the windows user account has no password so I hit enter for the password. Is that where this failed? I would rather learn to do this then be given the answer if possible. I do want to learn at the same time get to the solution. Thank you again for helping!

1 Like

it should actually look something like this:

sudo mount -t cifs -o username=owner //192.168.0.101/ ~/myshare

You do not want to mount an external drive underneath your Desktop directory for you linux user.

The above would mount the contents of the share from the IP address to a directory your user controls with the short hand path for myshare. The absolute path would be /home/$USER/myshare.

In your examples you were missing the -o username=<name> parameter

Thank you for the assistance. I have tried to implement your new information and this is the outcome. I did make a new folder to follow along with “~/myshare” because it did not exist originally when I tried the command the first time.

sudo mount -t cifs -o username=owner //192.168.0.101/ ~/myshare
Password for owner@//192.168.0.101/:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

Again I have no password for the windows machine. The “owner” username is the admin account, it shares no other users on that system.

2nd Attempt**

sudo mount -t cifs -o username=owner //192.168.0.101/ /home/owner/myshare
Password for owner@//192.168.0.101/:
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) and kernel log messages (dmesg)

The full-drive should be exposed as C$ or D$.

You will want to check the details of the SMB version in the Windows 10 host, using Get-SmbConnection in a PowerShell window (open the Start Menu and type PowerShell). Windows 10 defaults to SMB protocol version 3.1.1 and doesn’t like to downgrade, so you are likely denying any connection by specifying 3.0 as maximum. MS have their own guide to checking and enabling/disabling SMB v1/v2/v3, find it in your preferred search engine with a URL that ends: troubleshoot/detect-enable-and-disable-smbv1-v2-v3.

K3n.

Thank you for your help. You are semi correct in this case. The “$” symbol was actually causing a problem. I found this out by some back and forth with chatGPT.

The issue has been resolved and the share has been completed. :white_check_mark: :+1:

The command that finally made this whole mess work was:

sudo mount -t cifs -o username=owner,guest,nounix,noperm //192.168.0.101/D /home/owner/myshare

I also went into smb4k and removed any smb restrictions by unchecking the min and max options and restoring everything to default. (Not sure this had anything to do with anything as I’m using the terminal to make this happen but I did to be sure.)

Anyway. Thank you guys again for all the help and the knowledge you guys bring to the table is amazing! I do appreciate you and your efforts.

1 Like