Skip to content

u/spryfigure

In this archive from Jan 2016 to Nov 2026

36
posts
497
comments
1
media
1.9k
score
3 saved before deletion

Top posts

It's 2020. Is btrfs good enough yet? For which use cases would you recommend or advise against?

I use ext4 for laptops and zfs for servers, so I never had interest in using btrfs. Things like the write hole which seemingly don't get fixed for 7 years or more now kept me away from it. However, after getting used to snapshotting the fs when doing package upgrade / installations, I am spoiled now...

56 points76 comments
Open on Reddit

Every second day, there's the question here of "what distribution should I use". I have a spin of this. What distribution should I teach *others* to use in a seminar?

To clarify: I was asked to give a seminar for new Linux users, mainly converting from MS Windows to Linux. Their Level is interested beginners mainly. Maybe some with a little more knowledge, but this is community college level, not uni professionals. Age group more retirement than student. I am tor...

36 points53 comments
Open on Reddit

Top comments

#How to run samba reliably with Windows 7 / 8 / 10

##Preface

This is about how to get Samba to work reliably with Windows 7 / 8 / 10 in the proper Windows way, i. e. with Network Neighbourhood, without having to enter server names manually.

WS-Discovery (WSD) is built into Windows since Windows Vista.

It's a little-known replacement discovery protocol built into Windows. You can disable all three of SMB1, NetBIOS and WINS, and WSD will take over all the discovery they did, and ensure your shares turn up in Explorer as normal - and do a far better job of it as well.

Although WSD is not widely known, it has a huge advantage - it's already built into Windows Explorer, and daemons are available for FreeBSD, Linux and other systems. mDNS might be more widely used, but unless you're on Win10, it doesn't plug into Windows Explorer, like most other discovery methods.


Problem: WSD isn't built into Samba, so non-Windows shares offering SMB/CIFS sharing may not be discovered.

Solution: A small open source scripted daemon that provides WSD for BSD and Linux systems. Run that, and now your non-Windows shares can join the party too. It's written in Python3, so it's highly cross-platform-able. Turn off everything else.


Theoretically, you could use Shell Extensions, which are plugins that can add items to Windows Explorer. In the future, someone could use this to write a shell extension that manages file shares and Network Neighbourhood.

Win10 is getting Bonjour/mDNS/dns-sd added, so that may help in some situations. But not all. There will be plenty of Windows users who still just need Network Neighbourhood to work as it should.

##Concrete steps

Listed are both registry entries and CLI commands - use whichever you prefer.

First, kill off SMB1 on all your Windows machines (this won't take effect until the next reboot). In a registry editor file or command prompt, run either of these as you prefer:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\mrxsmb10]
"Start"=dword:00000004
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters]
"SMB1"=dword:00000000

or

sc config mrxsmb10 start=disabled

for Win 10, use:

Disable-WindowsOptionalFeature `
   -Online `
   -FeatureName smb1protocol

and

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v SMB1 /t REG_DWORD /d 0 /f

Next, ensure that the services that WSD relies on are run automatically. Their full names are "Function Discovery Provider Host" and "Function Discovery Resource Publication". The registry edits/commands are either of these, as you prefer:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\fdPHost]
"Start"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\FDResPub]
"Start"=dword:00000002

or

sc config fdPHost start=auto
sc config FDResPub start=auto

If either service isn't running, these also won't take effect until either the next reboot, or until the services are manually started.

If you have used WINS, you'll also want to switch that off as well. If it's allocated via your router using DHCP, clear that setting. If it's statically defined in Network Adapter Properties, clear those settings.

You can quickly check that Windows systems are free of WINS, by forcing them to disconnect/reconnect from the network: unplug/disable, then plug in/enable, and then open a cmd window and type ipconfig /all. Just check there's no WINS server listed below DNS servers.

Next, reboot Windows. None of these changes will have much effect until you do. When it restarts, check that Network Neighbourhood is still working nicely even with SMB1, NetBIOS and WINS all disabled. It should be working even better than before - more snappily, all PCs showing up for the first time. We haven't got the Samba machine on board yet, so for now, that computer will be missing.

With the Windows PCs dealt with, what we've got left is the discovery of the Samba machines and any other non-Windows devices offering SMB/CIFS shares or printers.

First of all, if you have any WINS related settings in your Samba config (including "local" or "domain" master), disable/remove/comment them out. If SMB1 is enabled, kill that as well. A line with

min protocol = SMB2

in the [global] section will do. You can also disable the service for Samba's NetBIOS name server nmbd which handles NetBIOS discovery since it is no longer needed.

Make sure any Windows boxes renew their IP configs - either by having just rebooted, or by simply disabling/re-enabling the adapter in the Network Control Panel, or disconnecting/reconnecting them briefly from the LAN. (You can also make sure the NAS has ditched WINS as well, just restarting Samba should be enough).

Test your work also in a couple of other ways, it's worthwhile to do so.

First, when you click on and expand "Network Neighbourhood", if you choose "View" -> "Detail" and right click on the column headings, you'll see an option to choose columns. You can add "discovery method" and "IP Address". If this has worked, you'll get "WSD" as discovery method. Second, you can use Wireshark or any other packet sniffer. If it's worked, you will see traffic on ports such as 1702 (or maybe 3702), rather than NetBIOS ports 137-139, 445.

If you want to test beyond doubt, go to your network adapter's properties, go into IPv4 properties, and choose the "ADVANCED" button near the bottom. Go to the "WINS" tab, and disable NetBIOS over TCP. Close properties. Go to command prompt, type ipconfig /all and config no WINS server and NetBIOS over TCP disabled. You should find Network Neighbourhood still works.

There's only one last thing to do - on any non-Windows platforms offering SMB/CIFS shares (Linux, FreeNAS etc, you'll want to run wsdd.py (link to github), which allows Windows Explorer Network Neighbourhood to discover your Samba/NAS/SMB/CIFS shares natively in Vista/7/8/8.1.earlier10/server versions, without relying on NetBIOS.

Firewalling shouldn't be an issue either on Windows or on your NAS. But if it is, then the rules you need are: Incoming and outgoing multicast traffic on port 3702 allowed. For IPv4, the multicast address is 239.255.255.250, for IPv6 the link local SSDP multicast address (fe02::c) is used. Also, incoming TCP traffic (and related outgoing traffic) on port 5357 must be allowed.

Save the wsdd.service file from the etc folder on Github to your /lib/systemd/system/ folder. The following listing of wsdd.service has the changes needed for bog-standard Ubuntu:

[Unit]
Description=Web Services Dynamic Discovery host daemon
; Start after the network has been configured
After=network-online.target
Wants=network-online.target
; It makes sense to have Samba running when wsdd starts, but is not required
Wants=smb.service

[Service]
Type=simple
ExecStart=/usr/bin/wsdd --shortlog
; Replace those with an unprivileged user/group that matches your environment,
; like nobody/nogroup or daemon:daemon or a dedicated user for wsdd
User=nobody
Group=nogroup

[Install]
WantedBy=multi-user.target

Save the wsdd.py file from the src folder on Github to your /usr/bin/ folder as wsdd .

Do a

chmod 0755 wsdd 

to allow read+execute access.

You can use

wsdd --help

to view the inbuilt help, and one of these two commands:

wsdd [options] 
wsdd [options] &

to run or to run in background and return to console. With the .service file, everything is taken care of for systemd to run it automatically. Just do a systemctl start wsdd.service to start once or systemctl enable wsdd.service to enable it for all reboots.

To terminate, you can just use <ctrl>-<c> if in the foreground or pkill wsdd.

After you run it, the Samba server should show up in Network Neighbourhood again.

[Adapted from this source](https://www.ixsystems.com/community/resources/how-to-kill-off-smb1-netbios-wins-and-still-have-windows-network-neighbourhood-better-than-ever.106/)

56 points

but i will not enable swap at all, yes i'm a bit rude...

This won't work at all then for you. As soon as a web browser opens, RAM shoots up to 2GB for LXQt, and 2.5GB for KDE. You cannot work comfortably with 2GB without swap. Not an issue of old or young hw or sw, but of the websites.

For day-to-day usage without consciously limiting what you can do, you need either 4GB or 2GB+swap. Use something like systemd-swap for a 'breathing' swap which grows and shrinks according to your needs.

38 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.