1

I am using a Ubuntu 22.04 guest in Hyper-V in Windows 11. I have created a file share and shared it for a local user ("shareuser"). I am trying to automatically mount it with cifs and corresponding changes in /etc/fstab but am totally unable to. When I do the mount in the command line, it is telling me:

sudo mount -t cifs -o domain=WORKGROUP,username=shareuser,password=pass1234 
//172.22.0.1/sharename /home/otheruser/share
mount: /home/otheruser/share: cannot mount //172.22.0.1/sharename read-only.

sharename is definitely not read-only since I can connect with smbclient and transfer files totally fine. Just cifs doesn't work the way it should.

The connect with smbclient that works looks like this:

smbclient -U WORKGROUP/shareuser --password 'pass1234' //172.22.0.1/sharename

Strange thing is I have another Ubuntu 22.04 VM where everything works fine. I found lots of posts which go into the same direction but none with the same exact error message. Also --verbose doesn't output more than the error message above. Every hint is appreciated.

1 Answers1

1

Connecting from Linux CIFS to Windows 11 requires SMB3. Here are the two variants that work for me on Debian 12 ("bookworm"):

w='WORKGROUP'                 # Workgroup or domain; blank if unused
u='shareuser'                 # Username
p='pass1234'                  # Password; no comma allowed
s='//172.22.0.1/sharename'    # Share

mkdir -p /mnt/net mount -t cifs -o "vers=3.02,${w:+domain=$w,}username=$u,password=$p" "$s" /mnt/net

smbclient --user "$u" --max-protocol SMB3 "$s" "$p" --command 'dir'

Chris Davies
  • 4,560