Issues with SMB Share

I'm unable to preview media content such as photos, videos and documents such as pdfs and word documents over an smb share.
No description
49 Replies
RealDishwash
RealDishwashOP10mo ago
I'm also unable to play videos over smb using haruna or vlc Works fine using a windows client, I'm able to view PDFs and play videos The only documents I can view properly on bazzite are small things like text and markdown files
HikariKnight
HikariKnight10mo ago
not all applications support this in the same way they do on windows because the smb path implementation is different depending on DEs the best way to do this (and have almost all programs support it) would be to mount the share into a folder using something like fstab
//192.168.10.22/storage/Music /home/hk/Music cifs uid=0,credentials=/path/to/credentialsfile,iocharset=utf8,vers=3.0,noperm,_netdev 0 0
//192.168.10.22/storage/Music /home/hk/Music cifs uid=0,credentials=/path/to/credentialsfile,iocharset=utf8,vers=3.0,noperm,_netdev 0 0
credentials file can contain the username and password in this format
user=myusername
password=mypassword
domain=mydomain
user=myusername
password=mypassword
domain=mydomain
NOTE: haruna managed to play my music files with the path smb://192.168.10.22/storage/Music/file.mp3 when i opened from dolphin, but pdfs did not work in okular. this is a per application issue
RealDishwash
RealDishwashOP10mo ago
can i sidestep this if i just use nfs? i'm fine wth just hosting smb for the windows clients and nfs for the linux devices ok wait i can get video playback working using haruna if i use a local connection instead of through tailscale but yeah pdfs through okular still don't work
HikariKnight
HikariKnight10mo ago
Not if it is the application not supporting how the de does protocols. Gnome kinda works around this using gvfs and does a temp local mount for you. Kde uses a completely different way (not sure exactly what they do, I just noticed when opening remote files in gnome, the file would have a local path through gvfs)
©TriMoon™
©TriMoon™10mo ago
"Say NO to fstab solutions... " - By @©TriMoon™ 😉
These fine How-To's might be interesting read for both of you: - https://forum.manjaro.org/t/root-tip-how-to-systemd-mount-unit-samples/1191/1#smb-network-share-14 (Section: SMB network shares) - https://forum.manjaro.org/t/root-tip-how-to-use-systemd-to-mount-any-device/1185 It's MUCH safer to use systemd-units instead of fidling with fstab... - Because if you make a mistake, only that mount will fail, but your system will stay bootable... - Plus you can have automount/dismount when not used, which is not possible with fstab configs. 🖖
Manjaro Linux Forum
[root tip] [How To] Use systemd to mount ANY device
Difficulty: ★☆☆☆☆ Disk device recognition Manjaro uses udev (see Arch Wiki) to load devices at boot time. The loading of devices is arbitrary and therefore you cannot predict which device will be available at a given path. But static device names do exist and you can assign specific locations to your device and thus ensure e.g. scripts will wo...
Manjaro Linux Forum
[root tip] [How To] systemd mount unit samples
Difficulty: ★★☆☆☆ Example mount units for systemd The examples here are a supplement to the guide on systemd mount units ⚠ Remember to remove the comments placed in the units - they are not writing for copy-paste but as examples. (comments is text beginning with a #) [root tip] [How To] Use systemd to mount ANY device Only use an automoun...
RealDishwash
RealDishwashOP10mo ago
I might just switch to gnome lol Everything functions well using it this works but it creates two mounts
RealDishwash
RealDishwashOP10mo ago
No description
RealDishwash
RealDishwashOP10mo ago
i'm guessing this is cause of how bazzite works?
HikariKnight
HikariKnight10mo ago
because of symlinks you can hide one of them right click --> hide
RealDishwash
RealDishwashOP10mo ago
hmm, the mount works but it's not automounting so i have to run sudo mount -a for the mount to actually work
RealDishwash
RealDishwashOP10mo ago
No description
RealDishwash
RealDishwashOP10mo ago
i get this error if it helps with anything
HikariKnight
HikariKnight10mo ago
guess you will have to make a systemd unit for the mount then
RealDishwash
RealDishwashOP10mo ago
welp lemme figure out how to do that
HikariKnight
HikariKnight10mo ago
will have to be a system unit not a user unit based on that error, at least thats my guess
RealDishwash
RealDishwashOP10mo ago
i'm using usb tethering from a phone for my internet connection and it doesn't actually activate the ethernet connection until i unlock the phone that might be why
HikariKnight
HikariKnight10mo ago
ah that might do it too
RealDishwash
RealDishwashOP10mo ago
so when i login it doesn't have network access
HikariKnight
HikariKnight10mo ago
bit unsure since i dont have a smb mount on boot
RealDishwash
RealDishwashOP10mo ago
i tried doing a login script through kde for sudo mount -a but it didn't work i'll see if i can figure out a systemd unit trying to mount to /mnt says that there's too many levels of symlinks i'll try mount to my home directory
HikariKnight
HikariKnight10mo ago
try mount to /var/mnt
RealDishwash
RealDishwashOP10mo ago
oki, i had the same issue trying to mount to /home/(myuser)/share
RealDishwash
RealDishwashOP10mo ago
No description
RealDishwash
RealDishwashOP10mo ago
i'll try that now same error mounting there as well it seems 😢 actually no new information a bad_network_name and cifs_mount failed w/return code = -2 i get the same bad_network name regardless of if i use tailscale or local ip so i can probably rule that out
HikariKnight
HikariKnight10mo ago
but you are able to mount it with sudo right? using something like sudo mount -t cifs
RealDishwash
RealDishwashOP10mo ago
yup mounting it manually or through fstab works
HikariKnight
HikariKnight10mo ago
cant really help trying things out as im at the countryside with just my phone atm until saturday
RealDishwash
RealDishwashOP10mo ago
no sweat enjoy what ur up to a friend suggested for me to use sshfs and it works fairly well so far i'll see if i can try getting automounting working with sshfs
©TriMoon™
©TriMoon™10mo ago
see what i wrote in https://discord.com/channels/1072614816579063828/1206413112643948555/1206947902514266223 above ☝️ 👆, it has links to how-to's It involves creating a mount unit first followed by an automount unit that activates the mount unit when needed...
RealDishwash
RealDishwashOP10mo ago
I did try that but I ran into some errors with that as well
©TriMoon™
©TriMoon™10mo ago
if you would share what errors you got at what step, i might be able to help... Because that functionality is not related to any Linux version, it is something that should work on all versions that use systemd as process manager..
RealDishwash
RealDishwashOP10mo ago
This screenshot I sent earlier
©TriMoon™
©TriMoon™10mo ago
Share the contents of the unit file(s) using systemctl cat
RealDishwash
RealDishwashOP10mo ago
I am currently in the process of reinstalling bazzite 💀 Lemme see if I can find the mount file I don't have access to it ATM oof
©TriMoon™
©TriMoon™10mo ago
You can paste it here as text using 3 backticks ` on their own line before and after the pasted text, when you have time...
RealDishwash
RealDishwashOP10mo ago
Maybe this morning
©TriMoon™
©TriMoon™10mo ago
Anytime will do, no hurry.. But it's important to provide the output of systemctl cat <unitnamehere>.{auto,}mount, it will provide me with multiple essential info at once..
RealDishwash
RealDishwashOP10mo ago
i think this is close to what it was
[Unit]
Description=Mount SMB share from thinkcentre

[Mount]
What=smb://thinkcentre/Vishwas%20Share/
Where=/home/vishwas/thinkcentre
Options=username=vishwas,password=vishwas,vers=3.0
Type=cifs
TimeoutSec=30

[Install]
WantedBy=multi-user.target
[Unit]
Description=Mount SMB share from thinkcentre

[Mount]
What=smb://thinkcentre/Vishwas%20Share/
Where=/home/vishwas/thinkcentre
Options=username=vishwas,password=vishwas,vers=3.0
Type=cifs
TimeoutSec=30

[Install]
WantedBy=multi-user.target
RealDishwash
RealDishwashOP10mo ago
i can try it on my laptop ig and see if it has the same issue
©TriMoon™
©TriMoon™10mo ago
The output of that command will provide info on name/place you put the unit AND contents and any drop-ins which might alter the functionality etc... So not just a paste of what you used Computers sometimes bark on a comma usage instead of a period, this is same kind...
RealDishwash
RealDishwashOP10mo ago
alrighty
vishwas@yoga:~$ systemctl cat thinkcentre.mount
# /etc/systemd/system/thinkcentre.mount
[Unit]
Description=Mount SMB share from thinkcentre

[Mount]
What=smb://thinkcentre/Vishwas%20Share/
Where=/home/vishwas/thinkcentre
Options=username=vishwas,password=vishwas,vers=3.0
Type=cifs
TimeoutSec=30

[Install]
WantedBy=multi-user.target
vishwas@yoga:~$ systemctl cat thinkcentre.mount
# /etc/systemd/system/thinkcentre.mount
[Unit]
Description=Mount SMB share from thinkcentre

[Mount]
What=smb://thinkcentre/Vishwas%20Share/
Where=/home/vishwas/thinkcentre
Options=username=vishwas,password=vishwas,vers=3.0
Type=cifs
TimeoutSec=30

[Install]
WantedBy=multi-user.target
RealDishwash
RealDishwashOP10mo ago
No description
RealDishwash
RealDishwashOP10mo ago
I'm honestly fine with mounting in fstab but it doesn't automount on boot It needs me to Sudo mount -a every boot for it to actually show my stuff
©TriMoon™
©TriMoon™10mo ago
ok as a thought you made some mistakes, first one(s) that popup in my mind are: 1. Unit name is wrong. (it should be same as the mount-point.) (You need to use systemd-escape --path to generate the unit name properly) 2. When mounting under your homedir, it will get mounted as root and thus not give you access as a user to that directory. 3. /home is actually a symlink to /var/home on uBlue type of OS's like Bazzite, so you need to use /var/home instead.. 4. TimeoutSecs= is something that needs to be used in a .automount unit, not a .mount unit... 5. IIRC you need to use the IP address of the remote host instead of it's single-name hostname in the SMB share name. Due to DNS resolving of that name. 6. DON'T use any [Install] section in the .mount unit if you intend to use automount. (if you had enabled the mount unit already first disable it before removing that section)
RealDishwash
RealDishwashOP10mo ago
Well I'll take that into account and redo it when I can today But it is nearly 2am and I've got a lecture in 5 hours 😭
©TriMoon™
©TriMoon™10mo ago
See the example for SMB mounts in that forum post i linked...
RealDishwash
RealDishwashOP10mo ago
I'll let you know what happens when I wake up
©TriMoon™
©TriMoon™10mo ago
np, take your time, there are plenty of days to fiddle 😉 When you start fiddling with this, it's best to start with a working mount unit (without an [Install] section), the automount functionality can be simply added later which needs to be a separate unit file anyhow... We will be using systemctl start/stop to activate/deactive the mount while changing the unit file as needed. PS: I personally never use the Where= parameter in the mount unit, which allows it to be renamed to mount in a different location.
Want results from more Discord servers?
Add your server