SMB/CIFS Mount

Just got a MiSTer and need some help? Join the forum and post your questions here!
nizce
Posts: 32
Joined: Fri Sep 03, 2021 9:22 am
Has thanked: 9 times
Been thanked: 2 times

SMB/CIFS Mount

Unread post by nizce »

Hi!
Just about to setup my mister for the first time. 8-)
I’d like to use my NAS for storing all games and such.

What folder layout should I have on the share, just copy the content from /media/fat/ on the SD card from a fresh install?

Also, will I run into trouble using NAS together with update or update all script(I guess not since the smb mount points will look the same to mister?

Oh, and are there any downsides with using NAS?
User avatar
Crystal
Posts: 51
Joined: Sun May 24, 2020 8:52 pm
Has thanked: 8 times
Been thanked: 11 times

Re: SMB/CIFS Mount

Unread post by Crystal »

If you want use your NAS with your MiSTer as much as you can, you can use the following template on your NAS.
If you don't have it already, you will also need to get cifs_mount.sh (also cifs_unmount.sh) and edit it accordingly, based on your needs and circumstances. I recommend having a dedicated user for MiSTer to access share on your NAS.
Following is excerpt of how I run this script, to offload as much as I can off the microsd card and on to NAS.

Code: Select all

#Your CIFS Server, i.e. your NAS name or its IP address.
SERVER="192.168.XXX.XXX"

#The share name on the Server.
SHARE="name_of_share/folder/subfolder"

#The user name, leave blank for guest access.
USERNAME="mister"

#The user password, irrelevant (leave blank) for guest access.
PASSWORD="PASSWORD_HERE"

#Local directory/directories where the share will be mounted.
LOCAL_DIR="*"

#"true" in order to wait for the CIFS server to be reachable;
#useful when using this script at boot time.
WAIT_FOR_SERVER="true"

#"true" for automounting CIFS shares at boot time;
#it will create start/kill scripts in /etc/network/if-up.d and /etc/network/if-down.d.
MOUNT_AT_BOOT="true"



#========= ADVANCED OPTIONS =========
BASE_PATH="/media/fat"
#MISTER_CIFS_URL="https://github.com/MiSTer-devel/CIFS_MiSTer"
KERNEL_MODULES="md4.ko|md5.ko|des_generic.ko|fscache.ko|cifs.ko"
IFS="|"
SINGLE_CIFS_CONNECTION="true"
#Pipe "|" separated list of directories which will never be mounted when LOCAL_DIR="*"
SPECIAL_DIRECTORIES="config|linux|System Volume Information"
Same as default script, I also dont recommend having config,linux and System Volume Information on NAS.
What I've personally noticed, is that MiSTer seems to be a bit slow at initializing network [talking 3-9 seconds], so if you use things like last core boot, it might not always be reliable, depending on how fast will your MiSTer mount your shares. But as long as it's mounted(check for network icon to initialize), everything works very nicely, including update script[I only use the official one, you'll have to experiment with update_all on your own)
Attachments
nas_dir_template.zip
(2.13 KiB) Downloaded 727 times
nizce
Posts: 32
Joined: Fri Sep 03, 2021 9:22 am
Has thanked: 9 times
Been thanked: 2 times

Re: SMB/CIFS Mount

Unread post by nizce »

Thank you!
Just tried it and it seems to work great, as in it mounts all directories and the update script is running and hitting my server.
I'm just waiting for OTG cable so I'm able to connect my keyboard so SSH will do for now, can't wait to get the keyboard and some controllers connected :)
User avatar
Crystal
Posts: 51
Joined: Sun May 24, 2020 8:52 pm
Has thanked: 8 times
Been thanked: 11 times

Re: SMB/CIFS Mount

Unread post by Crystal »

nizce wrote: Fri Sep 10, 2021 7:59 pm Thank you!
Just tried it and it seems to work great, as in it mounts all directories and the update script is running and hitting my server.
I'm just waiting for OTG cable so I'm able to connect my keyboard so SSH will do for now, can't wait to get the keyboard and some controllers connected :)
glad to hear its working for you nicely! if you are gonna use multiple devices, you might want to consider a powered usb hub [alternatively, there are sellers who make usb powered boards and other expansion boards with case for mister]
User avatar
NightShadowPT
Posts: 224
Joined: Mon May 25, 2020 9:56 am
Has thanked: 5 times
Been thanked: 12 times

Re: SMB/CIFS Mount

Unread post by NightShadowPT »

Hi Guys,

Trying to implement this, but fumbling :(

When I run the scrip, I'm getting the message:

"Mount: /tmp/cifs_mount: mount(2) system call failed: Operation not supported"

Here is the content of my cifs_mount file:

Code: Select all

#!/bin/bash

#=========   USER OPTIONS   =========
#You can edit these user options or make an ini file with the same
#name as the script, i.e. mount_cifs.ini, containing the same options.

#Your CIFS Server, i.e. your NAS name or its IP address.
SERVER="192.168.1.44"

#The share name on the Server.
SHARE="RetroGaming/MiSTer"

#The user name, leave blank for guest access.
USERNAME="MiSTer"

#The user password, irrelevant (leave blank) for guest access.
PASSWORD="************"

#Optional user domain, when in doubt leave blank.
DOMAIN=""

LOCAL_DIR="*"

ADDITIONAL_MOUNT_OPTIONS=""

WAIT_FOR_SERVER="true"

MOUNT_AT_BOOT="true"

#========= ADVANCED OPTIONS =========
BASE_PATH="/media/fat"
#MISTER_CIFS_URL="https://github.com/MiSTer-devel/CIFS_MiSTer"
KERNEL_MODULES="md4.ko|md5.ko|des_generic.ko|fscache.ko|cifs.ko"
IFS="|"
SINGLE_CIFS_CONNECTION="true"
#Pipe "|" separated list of directories which will never be mounted when LOCAL_DIR="*"
SPECIAL_DIRECTORIES="config|linux|System Volume Information"


#=========CODE STARTS HERE=========

ORIGINAL_SCRIPT_PATH="$0"
if [ "$ORIGINAL_SCRIPT_PATH" == "bash" ]
then
	ORIGINAL_SCRIPT_PATH=$(ps | grep "^ *$PPID " | grep -o "[^ ]*$")
fi
INI_PATH=${ORIGINAL_SCRIPT_PATH%.*}.ini
if [ -f $INI_PATH ]
then
	eval "$(cat $INI_PATH | tr -d '\r')"
fi

if [ "$SERVER" == "" ]
then
	echo "Please configure"
	echo "this script"
	echo "either editing"
	echo "${ORIGINAL_SCRIPT_PATH##*/}"
	echo "or making a new"
	echo "${INI_PATH##*/}"
	exit 1
fi 

for KERNEL_MODULE in $KERNEL_MODULES; do
	if ! cat /lib/modules/$(uname -r)/modules.builtin | grep -q "$(echo "$KERNEL_MODULE" | sed 's/\./\\\./g')"
	then
		if ! lsmod | grep -q "${KERNEL_MODULE%.*}"
		then
			echo "The current Kernel doesn't"
			echo "support CIFS (SAMBA)."
			echo "Please update your"
			echo "MiSTer Linux system."
			exit 1
#			if ! insmod "/media/fat/linux/$KERNEL_MODULE" > /dev/null 2>&1
#			then
#				echo "Downloading $KERNEL_MODULE"
#				curl -L "$MISTER_CIFS_URL/blob/master/$KERNEL_MODULE?raw=true" -o "/media/fat/linux/$KERNEL_MODULE"
#				case $? in
#					0)
#						;;
#					60)
#						if ! curl -kL "$MISTER_CIFS_URL/blob/master/$KERNEL_MODULE?raw=true" -o "/media/fat/linux/$KERNEL_MODULE"
#						then
#							echo "No Internet connection"
#							exit 2
#						fi
#						;;
#					*)
#						echo "No Internet connection"
#						exit 2
#						;;
#				esac
#				if ! insmod "/media/fat/linux/$KERNEL_MODULE" > /dev/null 2>&1
#				then
#					echo "Unable to load $KERNEL_MODULE"
#					exit 1
#				fi
#			fi
		fi
	fi
done

if [ "$(basename "ORIGINAL_SCRIPT_PATH")" != "mount_cifs.sh" ]
then
	if [ -f "/etc/network/if-up.d/mount_cifs" ] || [ -f "/etc/network/if-down.d/mount_cifs" ]
	then
		mount | grep "on / .*[(,]ro[,$]" -q && RO_ROOT="true"
		[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
		rm "/etc/network/if-up.d/mount_cifs" > /dev/null 2>&1
		rm "/etc/network/if-down.d/mount_cifs" > /dev/null 2>&1
		sync
		[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
	fi
fi
NET_UP_SCRIPT="/etc/network/if-up.d/$(basename ${ORIGINAL_SCRIPT_PATH%.*})"
NET_DOWN_SCRIPT="/etc/network/if-down.d/$(basename ${ORIGINAL_SCRIPT_PATH%.*})"
if [ "$MOUNT_AT_BOOT" ==  "true" ]
then
	WAIT_FOR_SERVER="true"
	if [ ! -f "$NET_UP_SCRIPT" ] || [ ! -f "$NET_DOWN_SCRIPT" ]
	then
		mount | grep "on / .*[(,]ro[,$]" -q && RO_ROOT="true"
		[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
		echo "#!/bin/bash"$'\n'"$(realpath "$ORIGINAL_SCRIPT_PATH") &" > "$NET_UP_SCRIPT"
		chmod +x "$NET_UP_SCRIPT"
		echo "#!/bin/bash"$'\n'"umount -a -t cifs" > "$NET_DOWN_SCRIPT"
		chmod +x "$NET_DOWN_SCRIPT"
		sync
		[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
	fi
else
	if [ -f "$NET_UP_SCRIPT" ] || [ -f "$NET_DOWN_SCRIPT" ]
	then
		mount | grep "on / .*[(,]ro[,$]" -q && RO_ROOT="true"
		[ "$RO_ROOT" == "true" ] && mount / -o remount,rw
		rm "$NET_UP_SCRIPT" > /dev/null 2>&1
		rm "$NET_DOWN_SCRIPT" > /dev/null 2>&1
		sync
		[ "$RO_ROOT" == "true" ] && mount / -o remount,ro
	fi
fi

if [ "$USERNAME" == "" ]
then
	MOUNT_OPTIONS="sec=none"
else
	MOUNT_OPTIONS="username=$USERNAME,password=$PASSWORD"
	if [ "$DOMAIN" != "" ]
	then
		MOUNT_OPTIONS="$MOUNT_OPTIONS,domain=$DOMAIN"
	fi
fi
if [ "$ADDITIONAL_MOUNT_OPTIONS" != "" ]
then
	MOUNT_OPTIONS="$MOUNT_OPTIONS,$ADDITIONAL_MOUNT_OPTIONS"
fi

if ! echo "$SERVER" | grep -q "^[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}$"
then
	if iptables -L > /dev/null 2>&1; then IPTABLES_SUPPORT="true"; else IPTABLES_SUPPORT="false"; fi
	[ "$IPTABLES_SUPPORT" == "true" ] && if iptables -C INPUT -p udp --sport 137 -j ACCEPT > /dev/null 2>&1; then PRE_EXISTING_FIREWALL_RULE="true"; else PRE_EXISTING_FIREWALL_RULE="false"; fi
	[ "$IPTABLES_SUPPORT" == "true" ] && [ "$PRE_EXISTING_FIREWALL_RULE" == "false" ] && iptables -I INPUT -p udp --sport 137 -j ACCEPT > /dev/null 2>&1
	if [ "$WAIT_FOR_SERVER" == "true" ]
	then
		echo "Waiting for $SERVER"
		until nmblookup $SERVER &>/dev/null
		do
			[ "$IPTABLES_SUPPORT" == "true" ] && [ "$PRE_EXISTING_FIREWALL_RULE" == "false" ] && iptables -D INPUT -p udp --sport 137 -j ACCEPT > /dev/null 2>&1
			sleep 1
			[ "$IPTABLES_SUPPORT" == "true" ] && if iptables -C INPUT -p udp --sport 137 -j ACCEPT > /dev/null 2>&1; then PRE_EXISTING_FIREWALL_RULE="true"; else PRE_EXISTING_FIREWALL_RULE="false"; fi
			[ "$IPTABLES_SUPPORT" == "true" ] && [ "$PRE_EXISTING_FIREWALL_RULE" == "false" ] && iptables -I INPUT -p udp --sport 137 -j ACCEPT > /dev/null 2>&1
		done
	fi
	SERVER=$(nmblookup $SERVER|awk 'END{print $1}')
	[ "$IPTABLES_SUPPORT" == "true" ] && [ "$PRE_EXISTING_FIREWALL_RULE" == "false" ] && iptables -D INPUT -p udp --sport 137 -j ACCEPT > /dev/null 2>&1
else
	if [ "$WAIT_FOR_SERVER" == "true" ]
	then
		echo "Waiting for $SERVER"
		until ping -q -w1 -c1 $SERVER &>/dev/null
		do
			sleep 1
		done
	fi
fi

if [ "$LOCAL_DIR" == "*" ] || { echo "$LOCAL_DIR" | grep -q "|"; }
then
	if [ "$SINGLE_CIFS_CONNECTION" == "true" ]
	then
		SCRIPT_NAME=${ORIGINAL_SCRIPT_PATH##*/}
		SCRIPT_NAME=${SCRIPT_NAME%.*}
		mkdir -p "/tmp/$SCRIPT_NAME" > /dev/null 2>&1
		if mount -t cifs "//$SERVER/$SHARE" "/tmp/$SCRIPT_NAME" -o "$MOUNT_OPTIONS"
		then
			echo "//$SERVER/$SHARE mounted"
			if [ "$LOCAL_DIR" == "*" ]
			then
				LOCAL_DIR=""
				for DIRECTORY in "/tmp/$SCRIPT_NAME"/*
				do
					if [ -d "$DIRECTORY" ]
					then
						DIRECTORY=$(basename "$DIRECTORY")
						for SPECIAL_DIRECTORY in $SPECIAL_DIRECTORIES
						do
							if [ "$DIRECTORY" == "$SPECIAL_DIRECTORY" ]
							then
								DIRECTORY=""
								break
							fi
						done
						if [ "$DIRECTORY" != "" ]
						then
							if [ "$LOCAL_DIR" != "" ]
							then
								LOCAL_DIR="$LOCAL_DIR|"
							fi
							LOCAL_DIR="$LOCAL_DIR$DIRECTORY"
						fi
					fi
				done
			fi
			for DIRECTORY in $LOCAL_DIR
			do
				mkdir -p "$BASE_PATH/$DIRECTORY" > /dev/null 2>&1
				if mount --bind "/tmp/$SCRIPT_NAME/$DIRECTORY" "$BASE_PATH/$DIRECTORY"
				then
					echo "$DIRECTORY mounted"
				else
					echo "$DIRECTORY not mounted"
				fi
			done
		else
			echo "//$SERVER/$SHARE not mounted"
		fi
	else
		if [ "$LOCAL_DIR" == "*" ]
		then
			LOCAL_DIR=""
			for DIRECTORY in "$BASE_PATH"/*
			do
				if [ -d "$DIRECTORY" ]
				then
					DIRECTORY=$(basename "$DIRECTORY")
					for SPECIAL_DIRECTORY in $SPECIAL_DIRECTORIES
					do
						if [ "$DIRECTORY" == "$SPECIAL_DIRECTORY" ]
						then
							DIRECTORY=""
							break
						fi
					done
					if [ "$DIRECTORY" != "" ]
					then
						if [ "$LOCAL_DIR" != "" ]
						then
							LOCAL_DIR="$LOCAL_DIR|"
						fi
						LOCAL_DIR="$LOCAL_DIR$DIRECTORY"
					fi
				fi
			done
		fi
		for DIRECTORY in $LOCAL_DIR
		do
			mkdir -p "$BASE_PATH/$DIRECTORY" > /dev/null 2>&1
			if mount -t cifs "//$SERVER/$SHARE/$DIRECTORY" "$BASE_PATH/$DIRECTORY" -o "$MOUNT_OPTIONS"
			then
				echo "$DIRECTORY mounted"
			else
				echo "$DIRECTORY not mounted"
			fi
		done
	fi
else
	mkdir -p "$BASE_PATH/$LOCAL_DIR" > /dev/null 2>&1
	if mount -t cifs "//$SERVER/$SHARE" "$BASE_PATH/$LOCAL_DIR" -o "$MOUNT_OPTIONS"
	then
			echo "$LOCAL_DIR mounted"
	else
			echo "$LOCAL_DIR mounted"
	fi
fi

echo "Done!"
exit 0
Not sure what I'm doing wrong...
User avatar
jlancaster86
Posts: 148
Joined: Sat Jun 27, 2020 1:33 pm
Has thanked: 130 times
Been thanked: 35 times

Re: SMB/CIFS Mount

Unread post by jlancaster86 »

You're supposed to add the settings to the INI file (cifs_mount.ini), not the script itself. I'm guessing the script is reading the blank settings in the INI file and that's why it's failing.

These are the contents of my cifs_mount.ini:

Code: Select all

SERVER="QNAP-NAS"
SHARE="MiSTer"
USERNAME="MiSTer"
PASSWORD="MiSTer"
LOCAL_DIR="*"
WAIT_FOR_SERVER="true"
MOUNT_AT_BOOT="true"
EDIT: Unless you don't have an INI file at all, in which case it would be reading your settings from the script, and something else must be a problem.
User avatar
jlancaster86
Posts: 148
Joined: Sat Jun 27, 2020 1:33 pm
Has thanked: 130 times
Been thanked: 35 times

Re: SMB/CIFS Mount

Unread post by jlancaster86 »

Another thought: I think it's trying to connect via SMBv1. Does your share have SMBv1 enabled? SMBv2 is often the minimum version enabled by default these days, and if your shared folder is on a modern Windows PC, that's definitely the case.
User avatar
NightShadowPT
Posts: 224
Joined: Mon May 25, 2020 9:56 am
Has thanked: 5 times
Been thanked: 12 times

Re: SMB/CIFS Mount

Unread post by NightShadowPT »

jlancaster86 wrote: Mon Jan 31, 2022 9:46 am You're supposed to add the settings to the INI file (cifs_mount.ini), not the script itself. I'm guessing the script is reading the blank settings in the INI file and that's why it's failing.

EDIT: Unless you don't have an INI file at all, in which case it would be reading your settings from the script, and something else must be a problem.
Thanks for your quick reply jlancaster86,

I don't seem to have the ini file (at least not on the root nor the scripts directory).

Also, I am using a Synology NAS and double checked... SMBv1 is enabled.
User avatar
jlancaster86
Posts: 148
Joined: Sat Jun 27, 2020 1:33 pm
Has thanked: 130 times
Been thanked: 35 times

Re: SMB/CIFS Mount

Unread post by jlancaster86 »

Maybe I had it backwards—maybe the script is trying to use a version of SMB that's newer that what your NAS supports (although, I wouldn't expect that to be a problem with a Synology NAS). Searching for your error, I just keep seeing pages that suggest specifying the SMB version.

See: https://www.programmersought.com/article/11001414771/

You could try using "ADDITIONAL_MOUNT_OPTIONS" to add the "vers=x.y" parameter.

Does the share on your NAS have SMBv2 and SMBv3 enabled too? Maybe there's just some weird negotiation problem.

I have a QNAP NAS, so I can't directly compare my configuration with yours, unfortunately.
User avatar
NightShadowPT
Posts: 224
Joined: Mon May 25, 2020 9:56 am
Has thanked: 5 times
Been thanked: 12 times

Re: SMB/CIFS Mount

Unread post by NightShadowPT »

jlancaster86 wrote: Mon Jan 31, 2022 12:00 pm You could try using "ADDITIONAL_MOUNT_OPTIONS" to add the "vers=x.y" parameter.
Bingo!

Adding vers=1.0 or vers=2.0 works like a charm.

Thank you so much for your help... much appreciated.

Now, on to transferring all the games :D
pac
Posts: 77
Joined: Mon May 25, 2020 6:11 am
Has thanked: 70 times
Been thanked: 26 times

Re: SMB/CIFS Mount

Unread post by pac »

jlancaster86 wrote: Mon Jan 31, 2022 9:55 am Another thought: I think it's trying to connect via SMBv1. Does your share have SMBv1 enabled? SMBv2 is often the minimum version enabled by default these days, and if your shared folder is on a modern Windows PC, that's definitely the case.
I remember setting this up for a Synology NAS, and it only worked once SMBv3 was enabled on the NAS. Which is a good thing, who wants to use v1 nowadays.
User avatar
redsteakraw
Posts: 245
Joined: Sun May 24, 2020 11:19 pm
Has thanked: 1 time
Been thanked: 41 times

Re: SMB/CIFS Mount

Unread post by redsteakraw »

pac wrote: Mon Jan 31, 2022 5:03 pm
jlancaster86 wrote: Mon Jan 31, 2022 9:55 am Another thought: I think it's trying to connect via SMBv1. Does your share have SMBv1 enabled? SMBv2 is often the minimum version enabled by default these days, and if your shared folder is on a modern Windows PC, that's definitely the case.
I remember setting this up for a Synology NAS, and it only worked once SMBv3 was enabled on the NAS. Which is a good thing, who wants to use v1 nowadays.
You want to use v1 if you want to interact with the older PC core and older systems on the network. Think also the OPL softmodded PS2 doesn't support the latest versions, seeing as the MiSTer is supporting older platforms why would you want to lock your cores out from your NAS?
Fear is the mind killer!
pac
Posts: 77
Joined: Mon May 25, 2020 6:11 am
Has thanked: 70 times
Been thanked: 26 times

Re: SMB/CIFS Mount

Unread post by pac »

redsteakraw wrote: Tue Feb 01, 2022 2:53 pm
pac wrote: Mon Jan 31, 2022 5:03 pm
jlancaster86 wrote: Mon Jan 31, 2022 9:55 am Another thought: I think it's trying to connect via SMBv1. Does your share have SMBv1 enabled? SMBv2 is often the minimum version enabled by default these days, and if your shared folder is on a modern Windows PC, that's definitely the case.
I remember setting this up for a Synology NAS, and it only worked once SMBv3 was enabled on the NAS. Which is a good thing, who wants to use v1 nowadays.
You want to use v1 if you want to interact with the older PC core and older systems on the network. Think also the OPL softmodded PS2 doesn't support the latest versions, seeing as the MiSTer is supporting older platforms why would you want to lock your cores out from your NAS?
My only use case for the NAS when it comes to videogames is to load ROMs, disc images and HDD images for the MiSTer. Therefore I have no need to downgrade to SMBv1.
astromaddie
Posts: 6
Joined: Wed Feb 23, 2022 12:04 pm

Re: SMB/CIFS Mount

Unread post by astromaddie »

I've been struggling to set up cifs mounting, hopefully someone can help me :)

Currently, this is my cifs_mount.ini:

Code: Select all

SERVER="DESKTOP"
SHARE="MiSTer"
USERNAME="mister"
PASSWORD="mister"
LOCAL_DIR="*"
WAIT_FOR_SERVER="false"
MOUNT_AT_BOOT="false"
#ADDITIONAL_MOUNT_OPTIONS="vers=2.0"
(additional_mount_options have been commented out since I tried vers=1.0, 2.0, and even as a last resort, 3.0... no dice.)
This is the error I get:

Code: Select all

mount: /tmp/cifs_mount: mount(2) system call failed: Operation now in progress.
//192.168.x.x/MiSTer not mounted
Done!
I'm providing my host machine name, and it's pulling my right internal IP address, so there's some successful communication going on. If I set it to wait_for_server="true", it runs a bit slower, but still fails. I'm sharing Windows 10 and have confirmed via powershell that Samba 1 and 2 are both enabled, but I'm at a loss on what to try next.

Edit: figured it out. Windows Firewall disables SMB access from incoming connections by default :roll: Even for private networks.
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 497 times
Been thanked: 467 times

Re: SMB/CIFS Mount

Unread post by akeley »

I would like to finally switch from using an SD card as the main storage, to a shared folder on my PC. But I'm notorioulsy bad with solving even simplest network things, and haven't really got a clue how to approach this.

So, I'm about to install an extra LAN card in my PC (it's not a NAS, just my everyday work/play PC), and then I suppose I should connect it to MiSTer with RJ45 cable and have a folder ready for sharing. Any tips on what to do next? Run the cifs_mount script?

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: SMB/CIFS Mount

Unread post by jca »

Why the need for a second LAN card?
Bas
Top Contributor
Posts: 622
Joined: Fri Jan 22, 2021 4:36 pm
Has thanked: 80 times
Been thanked: 324 times

Re: SMB/CIFS Mount

Unread post by Bas »

Use a switch or hub to build a network. Adding network cards to your PC is not the way to go on this. Maybe read a few blogs on how to set up a home network.
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 497 times
Been thanked: 467 times

Re: SMB/CIFS Mount

Unread post by akeley »

The first LAN is taken by internet from the router. If I have to do anything more complicated than just plugging into my current PC I will pass...there's enough hardware/cables in my den as it is.

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: SMB/CIFS Mount

Unread post by jca »

Don't you have a spare connection in your router? Plugin the cable into your router seems a lot easier than adding a LAN board to your PC and in the end you have the same number of cables.
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 497 times
Been thanked: 467 times

Re: SMB/CIFS Mount

Unread post by akeley »

Look mate, I said I have absolutely no clue about networking. So I don't know if I can plug into the router or not :)

At the moment I have a router - meaning the box my net provider put in - which is connected to the big internet cable from outside. Then it is connected to my PC via network cable. It does have some spare RJ45 slots. Are you saying I could connect MiSTer directly to that router with a network cable and then it'd connect to my PC and use the shared rom folder?

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: SMB/CIFS Mount

Unread post by jca »

Just connect MISTer to the router. After that it is just a software problem, I do not use share folder so I cannot tell you off my head how to proceed but I am sure someone will pitch in.
Basically your MISTer is connected to your PC using the same cable as the one which provides you with internet.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: SMB/CIFS Mount

Unread post by jca »

Once you made the connection from MISTer to the router you can check it is working:
Use the OSD to check the IP address of your MISTer and on your PC ping that IP.
Malor
Top Contributor
Posts: 860
Joined: Wed Feb 09, 2022 11:50 pm
Has thanked: 64 times
Been thanked: 194 times

Re: SMB/CIFS Mount

Unread post by Malor »

akeley wrote: Mon Mar 07, 2022 6:36 pm The first LAN is taken by internet from the router. If I have to do anything more complicated than just plugging into my current PC I will pass...there's enough hardware/cables in my den as it is.
In all seriousness, if you're this resolutely against learning new things, then boy, did you get involved in the wrong emulation project.
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 497 times
Been thanked: 467 times

Re: SMB/CIFS Mount

Unread post by akeley »

Really? How I wish you were here 2 years ago, you could've saved me a lotta cash and time with this helpful advice.
*eyeroll*
These kind of preachy, elitist attitudes are the reason why so many people stay away from the FPGA scene.

Not that it really needs explaining, but there are limited hours in the day, especially for an adult with a job/family life. So, wasting time on "learning" something that I have inherent dislike for, that has actually very little connection to this "emulation project", and what I will most likely never need again, seems quite pointless.

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

User avatar
porjay
Posts: 10
Joined: Sun Oct 24, 2021 2:47 am
Has thanked: 6 times
Been thanked: 4 times

Re: SMB/CIFS Mount

Unread post by porjay »

akeley wrote: Wed Mar 09, 2022 9:16 am Really? How I wish you were here 2 years ago, you could've saved me a lotta cash and time with this helpful advice.
*eyeroll*
These kind of preachy, elitist attitudes are the reason why so many people stay away from the FPGA scene.

Not that it really needs explaining, but there are limited hours in the day, especially for an adult with a job/family life. So, wasting time on "learning" something that I have inherent dislike for, that has actually very little connection to this "emulation project", and what I will most likely never need again, seems quite pointless.
Unfortunately getting the MiSTer to work with SMB/CIFS will require you to dig into the config files and set some parameters. You'll also need to work out a way to have the DE-Nano 10 connect into the network so it can properly communicate with your PC.

For the cifs_mount.sh if it isn't already will need to be placed in your Scripts folder
https://github.com/MiSTer-devel/Scripts ... s_mount.sh

You'll want to edit from lines 43 to 52 dependant on how you setup the shares on your PC.

Code: Select all

#=========   USER OPTIONS   =========
#You can edit these user options or make an ini file with the same
#name as the script, i.e. mount_cifs.ini, containing the same options.

#Your CIFS Server, i.e. your NAS name or its IP address.
SERVER=""

#The share name on the Server.
SHARE="MiSTer"

#The user name, leave blank for guest access.
USERNAME=""

#The user password, irrelevant (leave blank) for guest access.
PASSWORD=""
This is a good guide for setting up CIFS on a Windows PC:
https://www.contradodigital.com/2019/09 ... e-network/

You could try the USB WiFi route but from my personal experience, I found it wasn't the most reliable. It could be my particular USB Wifi so your mileage may vary?
Duffygag
Posts: 96
Joined: Tue Nov 03, 2020 10:57 am
Has thanked: 12 times
Been thanked: 25 times

Re: SMB/CIFS Mount

Unread post by Duffygag »

Are you looking for a Network class on a Mister forum ?

If you have specific questions we can help, if you need an explanation on how the Universe was born, it will get more complicated, since you value your time I am sure you will value ours as well, so documenting yourself a bit could be the first step for not being a moron.
jca
Top Contributor
Posts: 1911
Joined: Wed May 27, 2020 1:59 pm
Has thanked: 145 times
Been thanked: 454 times

Re: SMB/CIFS Mount

Unread post by jca »

I sincerely hope that the forum moderator will intervene, user Duffygag has no place to be in this forum. Regarding user Malor, what is your point? You don't bring anything of value in the discussion, I guess you just want to show your "superiority". Such is the internet. Sad.
Stupid Dufus
Posts: 157
Joined: Sun Aug 30, 2020 12:04 am
Has thanked: 98 times
Been thanked: 46 times

Re: SMB/CIFS Mount

Unread post by Stupid Dufus »

I think installing another network card in your PC rather than connecting the MiSTer to a spare rj45 port of the router is going to add unnecessary complication.

If you can, have your PC and MiSTer each connected to an rj45 port on your router at the same time each with their own cables.

After that, it's a matter of setting up a shared folder and the networking portion of MiSTer, which porjay described above.
Duffygag
Posts: 96
Joined: Tue Nov 03, 2020 10:57 am
Has thanked: 12 times
Been thanked: 25 times

Re: SMB/CIFS Mount

Unread post by Duffygag »

jca wrote: Wed Mar 09, 2022 11:46 am I sincerely hope that the forum moderator will intervene, user Duffygag has no place to be in this forum. Regarding user Malor, what is your point? You don't bring anything of value in the discussion, I guess you just want to show your "superiority". Such is the internet. Sad.
You are hurting my feelings now sniff sniff
akeley
Top Contributor
Posts: 1441
Joined: Mon May 25, 2020 7:54 pm
Has thanked: 497 times
Been thanked: 467 times

Re: SMB/CIFS Mount

Unread post by akeley »

porjay wrote: Wed Mar 09, 2022 10:30 am Unfortunately getting the MiSTer to work with SMB/CIFS will require you to dig into the config files and set some parameters.
Of course, I don't mind doing that and following some advice and pointers regarding this particular scenario - that's what my question was for after all. What I don't want to do is waste time reinventing the wheel and learning a heap of unnecessary stuff.

Thanks for your and the other folks advice, it was exactly what I was looking for. I also found this : https://www.reddit.com/r/fpgagaming/com ... lp_needed/ which has some other step by step things. I'll give it a try in a day or two, see how it goes.

CRT SCR$ Project - building a collection of high-quality photos of CRT displays
CRT ART Books - retro-gaming books with authentic CRT photos

Post Reply