How to access SMB/CIFS Share of my Windows 11 bhyve VM from FreeBSD

with freebsd 12 and samba 48 I can use SMBv3 and AES-128-CMAC.
The Samba shares (defined in smb4.conf) can be authenticated with SMBv2 or SMBv3. This has nothing to do with using FreeBSD as a SMB/CIFS client.
 
can you explain in details what is not working in your samba server? What step you did so i can try and reproduce it?
What is your smb4.conf and what error message you get when you try to open the shared folder from your windows machine?
 
Sure. I've been able to reach different goals with samba,but none of them satisfied me. What I want to do is to start a samba server on WIndows 11 and I want to share some disks and then I want to mount them on FreeBSD. And I also want disable samba vers. 1 on Windows. So :

1) I started samba server version 1 on Windows and I've mounted the shared disks like this :

Code:
#  mount_smbfs -I 192.168.1.4 -U marietto //Marietto-window/h /mnt/windows-drive-h

but version 1 is not secure. So this is not a good solution.

2) I also used the samba client on FreeBSD like this :

Code:
smbclient \\\\192.168.1.4\h
WARNING: The "encrypt passwords" option is deprecated
Enter WORKGROUP\marietto's password:
Try "help" to get a list of possible commands.
file1 file2 file3
smb: > exit

but I want to show the content of the disk using thunar,so this solution is not good for me.

3) I tried to use fusefs-smbnetfs. I have modified the file : /root/.smb/smbnetfs.conf like so : (now the IP of Windows is 192.168.1.5) ;


Code:
auth 192.168.1.5/h "marietto" "pass"
host 192.168.1.5 visible=true
smb_query_browsers      "false"
show_hidden_hosts       "true"

and then I did :

Code:
smbnetfs /mnt/windows-drive-h
cd /mnt/windows-drive-h/192.168.1.5 #

BUT it gave this error :

Code:
ls: .: Operation not permitted

4) I tried to mount on FreeBSD a disk shared in Windows 11 over SSH. You can read the whole thread going here :


but it didn't work.
 
Change the file permission of /root/.smb/smbnetfs.conf using
chmod 600 /root/.smb/smbnetfs.conf

In /root/.smb/smbnetfs.conf change the auth line
auth "marietto" "pass"

Load the fusefs
kldload fusefs

start smbnetfs
smbnetfs ~/mountpouint/

navigate to the shared folder using
cd ~/mountpoint/192.168.1.5

You didn't post the smb4.conf but it should contain only the following:
[global]
security = domain
 
It works ! very thanks. The instructions were not clear at all and I didn't find in any place the working configuration that you gave to me :

Code:
# ls /mnt/windows-drive-h/192.168.1.5
C       G       H       Users

/mnt/windows-drive-h/192.168.1.5/H # rm -r found.000
rm: found.000: Permission denied

do u know how to give also the write permissions to the windows shared disks ?
 
caja stopped showing the content of the shared drives,giving this error :

Caja-Share-Message: Called "net usershare info" but it failed: 'net usershare' returned error 255: net usershare: usershares are currently disabled

but I still continue to see the content of the disks using the terminal.
 
UPDATE : I don't know what happened,but the previous error came back :

# ls /mnt/windows-drives/G
ls: /mnt/windows-drives/G: Input/output error

the same error happens with drive C and H.
 
Thank you for this thread. I have been able to get a basic read-only mount to my workplace's SMB shared folders. I too am running into the Input/output error when trying to write to any of the drives, so I will be watching this thread.
 
Thank you for this thread. I have been able to get a basic read-only mount to my workplace's SMB shared folders. I too am running into the Input/output error when trying to write to any of the drives, so I will be watching this thread.

Actually I'm using another method. On Windows 11 :

Code:
λ start-nfs


WinNFSd.exe -pathFile C:\Users\virtu\Downloads\cmder\NFS\Server\drives.txt

=====================================================

WinNFSd 2.4.0 [5f7f224]

Network File System server for Windows

Copyright (C) 2005 Ming-Yang Kao

Edited in 2011 by ZeWaren

Edited in 2013 by Alexander Schneider (Jankowfsky AG)

Edited in 2014 2015 by Yann Schepens

Edited in 2016 by Peter Philipp (Cando Image GmbH), Marc Harding

=====================================================

Path #1 is: C:\, path alias is: /share-c

Path #2 is: G:\, path alias is: /share-g

Path #3 is: H:\, path alias is: /share-h

Portmap daemon started

NFS daemon started

Mount daemon started

Listening on 0.0.0.0

Type 'help' to see help

On FreeBSD :

Code:
192.168.1.5.sh :


#!/usr/local/bin/bash
sudo -u root umount /mnt/winnfsd/drive-g
sudo -u root umount /mnt/winnfsd/drive-h
sudo -u root mount -o vers=3 192.168.1.5:/share-g /mnt/winnfsd/drive-g
sudo -u root mount -o vers=3 192.168.1.5:/share-h /mnt/winnfsd/drive-h
gksu -u root "caja /mnt/winnfsd"

it seems that it works almost good,right now. I say "almost" because yesterday I've removed a file while I was inside the Windows VM and the tool stopped working. It totally crashed when I was accessing the files using caja on FreeBSD,maybe because it was expecting to find the file that I had previously deleted on Windows but it was unable to find it. Samba is giving me a lot of troubles at the moment. I think that it could work better if I wanted to start the server on FreeBSD and the client on Windows. But the problem is that I'm running Windows in a 1440x900 window and it is uncomfortable to show the files in this little window,compared to the screen that I can have when I use FreeBSD,because FreeBSD runs on a 1920x1080 screen. So,I'm obliged to run the samba server on Windows and samba "client" on FreeBSD ; anyway,I'm thinking to stop using samba. Maybe it is a better idea if I start using sshfs,instead.
 
Back
Top